Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional add link to ip to view data #10286

Open
joubertredrat opened this issue Jul 11, 2016 · 9 comments
Open

Optional add link to ip to view data #10286

joubertredrat opened this issue Jul 11, 2016 · 9 comments
Labels
c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself.

Comments

@joubertredrat
Copy link
Contributor

Hi guys,
When I'm on indexVisitorLog action, I copy IP and paste in other site to see other IP informations (rDNS, location, blacklists, etc).

So I had an idea, why not set a optional link on IP to open in other sites?

Example:
If i set on config url with ip joker, ip will have link to open, as examples below:
http://www.tcpiputils.com/browse/ip-address/{$ip}
https://mxtoolbox.com/SuperTool.aspx?action=blacklist%3a{$ip}&run=toolpage
https://db-ip.com/{$ip}

If you not set config url, indexVisitorLog will display IP only a text, as it is today.

What you think guys?

@mattab
Copy link
Member

mattab commented Jul 11, 2016

Hi @joubertredrat - thanks for the suggestion. our thoughts on this will be more around creating a new small plugin (published on the marketplace) that would let people, in the Plugin settings area, easily choose one of a pre-existing list of IP data websites, or input their own custom link. It would be awesome to have such new plugin!

@joubertredrat
Copy link
Contributor Author

Hi @mattab, if is possible to make this as plugin, I will provide this then 👍

@mattab
Copy link
Member

mattab commented Jul 12, 2016

@joubertredrat sounds good! let us know if you manage to create this plugin 👍

@hpvd
Copy link

hpvd commented Jul 12, 2016

+1

@joubertredrat
Copy link
Contributor Author

joubertredrat commented Jul 14, 2016

Hi guys,

@mattab the plugin is almost ready, as you can see on https://github.com/joubertredrat/Piwik-LinkForIP but I have little question about template.

On template, visitIp isn't escaped with raw, then is display as string, as image below:
screenshot-0 0 0 0 9090 2016-07-14 11-34-36

If I add raw on variable (IP: {{ visitor.getColumn('visitIp')|raw }}) in template, works fine:
screenshot-0 0 0 0 9090 2016-07-14 11-38-51

Then a question, have one alternative to don't scape data without raw or really will necessary a PR with this change if is allowed?

Other alternative is javascript, get string into span, regex to get IP and add bind click, but I think that isn't good idea.

@mattab mattab changed the title [Feature suggestion] optional add link to ip to view data Optional add link to ip to view data Jul 15, 2016
@mattab
Copy link
Member

mattab commented Jul 15, 2016

Hi @joubertredrat - I think in this case, maybe it works easier if we add a class to the STRONG containing the IP address. Then you could get & change in this element and add the <a href=..>...</a> in JavaScript dynamically. Maybe you could make a PR changing the <strong element showing the IP to be a SPAN with a special class?

@mattab mattab added this to the 2.16.x (LTS) milestone Jul 15, 2016
@joubertredrat
Copy link
Contributor Author

joubertredrat commented Jul 15, 2016

Hi @mattab I really don't think that is good to use javascript because it can broken browser if have a lot of lines, javascript to manipulate elements after DOM loaded consumes a lot of memory and have other possible problem, on pagination or data reload, will be necessary manipulate again by javascript.

I will test to see if is possible using data html atribute data-ip='x.x.x.x' on span and bind with click and open url by ip defined on data-ip value.

Another way is instead IP: {{ visitor.getColumn('visitIp')|raw }}, create other filter and use on template, IP: {{ visitor.getColumn('visitIp')|url_ip }} but I'm not good with Twig, I don't know if is easy to make this.

http://twig.sensiolabs.org/doc/advanced.html#filters

@mattab
Copy link
Member

mattab commented Jul 19, 2016

I will test to see if is possible using data html atribute data-ip='x.x.x.x' on span and bind with click and open url by ip defined on data-ip value.

This also sounds pretty good solution! let us know

@mattab mattab added the c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. label Jul 19, 2016
@mattab mattab modified the milestones: 2.16.x (LTS), Mid term Aug 25, 2016
@joubertredrat
Copy link
Contributor Author

Hi guys,

@mattab sorry for delay, a lot of work here :(
I tried with data-bind, but without success. Then I can talk with you if have problems to changes in twig as above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself.
Projects
None yet
Development

No branches or pull requests

3 participants