From: Jaroslav Kysela Date: Sun, 7 May 2017 21:46:41 +0000 (+0200) Subject: webui: identify enabled adapters in input tree by color, fixes #4346 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2261fd6b995e0857fe6cf14fa91fd45ca725d516;p=thirdparty%2Ftvheadend.git webui: identify enabled adapters in input tree by color, fixes #4346 --- diff --git a/src/webui/static/app/ext-access.css b/src/webui/static/app/ext-access.css index 45e755965..10a85a11e 100644 --- a/src/webui/static/app/ext-access.css +++ b/src/webui/static/app/ext-access.css @@ -54,4 +54,3 @@ a { .x-progress-text-back { color: #fff; } - diff --git a/src/webui/static/app/ext.css b/src/webui/static/app/ext.css index 0a5acd21b..8749e8e97 100644 --- a/src/webui/static/app/ext.css +++ b/src/webui/static/app/ext.css @@ -78,6 +78,20 @@ background-image: url(../icons/tv_cards.png); } +.x-tree-node-on a::before { + content: " \25cf"; + color: lightgreen; +} + +.x-tree-node-on a { + font-weight: bold; +} + +.x-tree-node-off a::before { + content: " \25cf"; + color: lightcoral; +} + .ux-mselect { overflow: auto; background: white; diff --git a/src/webui/static/app/idnode.js b/src/webui/static/app/idnode.js index 799c4ce26..178c85326 100644 --- a/src/webui/static/app/idnode.js +++ b/src/webui/static/app/idnode.js @@ -2616,6 +2616,8 @@ tvheadend.idnode_tree = function(panel, conf) } if (n.attributes.uuid === uuid) n.select(); + if (conf.node_added) + conf.node_added(n); } loader.on('load', function(l, n, r) { diff --git a/src/webui/static/app/tvadapters.js b/src/webui/static/app/tvadapters.js index 81283b111..ecb103f35 100644 --- a/src/webui/static/app/tvadapters.js +++ b/src/webui/static/app/tvadapters.js @@ -6,7 +6,18 @@ tvheadend.tvadapters = function(panel, index) { title: _('TV adapters'), iconCls: 'tvCards', tabIndex: index, - comet: 'hardware' + comet: 'hardware', + node_added: function(n) { + var p = n.attributes.params; + if (!p) return; + for (var i = 0; i < p.length; i++) + if (p[i].id == "enabled" && p[i].value) { + n.ui.addClass('x-tree-node-on'); + break; + } + if (i >= p.length) + n.ui.addClass('x-tree-node-off'); + } }); return panel;