Feature #4331
open
Added by Pablo R. almost 8 years ago.
Updated almost 8 years ago.
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
This option (GeoIP) take to much space and resources
Working with external sources is not most stable.
if someone try to make it better to use tool-tip.
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
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,
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?
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!
Also available in: Atom
PDF