summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-mod-network/htdocs/luci-static/resources
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2021-06-17 09:45:48 +0200
committerJo-Philipp Wich <jo@mein.io>2021-06-17 09:45:48 +0200
commit36350e9867ca9fd2f9b137ed76f0fabe0e57c880 (patch)
tree6a483bf62e2a93a040fda9a7834190dd6f052d87 /modules/luci-mod-network/htdocs/luci-static/resources
parentf6f1eacb012b0364940c1dc9b9392fc0e60405b9 (diff)
luci-mod-network: change port status layout in vlan filter config
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-mod-network/htdocs/luci-static/resources')
-rw-r--r--modules/luci-mod-network/htdocs/luci-static/resources/tools/network.js37
1 files changed, 25 insertions, 12 deletions
diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/tools/network.js b/modules/luci-mod-network/htdocs/luci-static/resources/tools/network.js
index ce6388b6cd..88d268e404 100644
--- a/modules/luci-mod-network/htdocs/luci-static/resources/tools/network.js
+++ b/modules/luci-mod-network/htdocs/luci-static/resources/tools/network.js
@@ -108,25 +108,38 @@ function updatePortStatus(node, dev) {
var carrier = dev.getCarrier(),
duplex = dev.getDuplex(),
speed = dev.getSpeed(),
- desc;
-
- if (carrier && speed > 0 && duplex != null)
- desc = E('abbr', {
- 'title': '%d MBit/s, %s'.format(speed, duplex == 'full' ? _('full-duplex') : _('half-duplex'))
- }, [ '%d%s'.format(speed, duplex == 'full' ? 'FD' : 'HD') ]);
- else if (carrier)
- desc = document.createTextNode(_('Connected'));
- else
- desc = document.createTextNode(_('no link'));
+ desc, title;
+
+ if (carrier && speed > 0 && duplex != null) {
+ desc = '%d%s'.format(speed, duplex == 'full' ? 'FD' : 'HD');
+ title = '%s, %d MBit/s, %s'.format(_('Connected'), speed, duplex == 'full' ? _('full-duplex') : _('half-duplex'));
+ }
+ else if (carrier) {
+ desc = _('Connected');
+ }
+ else {
+ desc = _('no link');
+ }
+
+ dom.content(node, [
+ E('img', {
+ 'class': 'middle',
+ 'src': L.resource('icons/port_%s.png').format(carrier ? 'up' : 'down')
+ }),
+ '\x0a', desc
+ ]);
- dom.content(node, [ desc ]);
+ if (title)
+ node.setAttribute('data-tooltip', title);
+ else
+ node.removeAttribute('data-tooltip');
return node;
}
function renderPortStatus(dev) {
return updatePortStatus(E('span', {
- 'class': 'port-status-link',
+ 'class': 'ifacebadge port-status-link',
'data-device': dev.getName()
}), dev);
}