Feature #4331
Status: Country flags
0%
Description
Hello!
I would like to see next to the IP of the users an indicative flag of the country to which they belong.
I have attached an image of a possible aspect of the functionality
Regards.
Files
History
Updated by Poul Kalff over 7 years ago
saen acro wrote:
This option (GeoIP) take to much space and resources
What? Really? Isn't it just a simple API-call; http://api.geoiplookup.net/?query=104.31.95.73
Updated by Poul Kalff over 7 years ago
Poul Kalff wrote:
saen acro wrote:
This option (GeoIP) take to much space and resources
What? Really? Isn't it just a simple API-call; http://api.geoiplookup.net/?query=104.31.95.73
... and then parse for <countrycode>
Updated by saen acro over 7 years ago
Working with external sources is not most stable.
if someone try to make it better to use tool-tip.
Updated by Poul Kalff over 7 years ago
saen acro wrote:
Working with external sources is not most stable.
if someone try to make it better to use tool-tip.
Well, this is 2017, and everything is an external source :-) Kodi relies heavily on external sources for scraping, can't see how this is different. In fact, all data that tvheadend is build to handle is external sources
Updated by Jaroslav Kysela over 7 years ago
Here's a dirty code, when you have an HTTP server which can return the country flag image for queried IP:
diff --git a/src/webui/static/app/status.js b/src/webui/static/app/status.js index c35d464..27a9c9c 100644 --- a/src/webui/static/app/status.js +++ b/src/webui/static/app/status.js @@ -91,7 +91,13 @@ tvheadend.status_subs = function(panel, index) id: 'hostname', header: _("Hostname"), dataIndex: 'hostname', - sortable: true + sortable: true, + renderer: function(v) { + if (!v.startswith('10.') && !v.startswith('192.168.') && + !v.startswith('172.16.') && !v.startwith('127.')) + return '<img src="URL_image_country_flag/?"' + v + '"/>' + v; + return v; + } }, { width: 50,
Updated by Pablo R. over 7 years ago
I get following in tvheadend log and nothing is show, just loading.
Comet failure [e=v.startswith is not a function]
Any tip to fix it?
Updated by Mark Clarkstone over 7 years ago
Pablo RodrÃguez wrote:
I get following in tvheadend log and nothing is show, just loading.
Comet failure [e=v.startswith is not a function]
Any tip to fix it?
"startswith" should be "startsWith". looks like Jaroslav confused function names between languages, glad I'm not the only one who does this!