luci-mod-network: adjust assoclist markup for easier styling

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
Jo-Philipp Wich 2020-03-23 22:14:02 +01:00
parent be62595c5b
commit 1b7e923cf6

View file

@ -65,8 +65,18 @@ function render_signal_badge(signalPercent, signalValue, noiseValue, wrap) {
title = _('Interface is disabled'); title = _('Interface is disabled');
} }
return E('div', { 'class': wrap ? 'center' : 'ifacebadge', 'title': title }, return E('div', {
[ E('img', { 'src': icon }), wrap ? E('br') : ' ', value ]); 'class': wrap ? 'center' : 'ifacebadge',
'title': title,
'data-signal': signalValue,
'data-noise': noiseValue
}, [
E('img', { 'src': icon }),
E('span', {}, [
wrap ? E('br') : ' ',
value
])
]);
} }
function render_network_badge(radioNet) { function render_network_badge(radioNet) {
@ -543,20 +553,26 @@ return L.view.extend({
var hint; var hint;
if (name && ipv4 && ipv6) if (name && ipv4 && ipv6)
hint = '%s (%s, %s)'.format(name, ipv4, ipv6); hint = '%s <span class="hide-xs">(%s, %s)</span>'.format(name, ipv4, ipv6);
else if (name && (ipv4 || ipv6)) else if (name && (ipv4 || ipv6))
hint = '%s (%s)'.format(name, ipv4 || ipv6); hint = '%s <span class="hide-xs">(%s)</span>'.format(name, ipv4 || ipv6);
else else
hint = name || ipv4 || ipv6 || '?'; hint = name || ipv4 || ipv6 || '?';
var row = [ var row = [
E('span', { 'class': 'ifacebadge' }, [ E('span', {
'class': 'ifacebadge',
'data-ifname': bss.network.getIfname(),
'data-ssid': bss.network.getSSID()
}, [
E('img', { E('img', {
'src': L.resource('icons/wifi%s.png').format(bss.network.isUp() ? '' : '_disabled'), 'src': L.resource('icons/wifi%s.png').format(bss.network.isUp() ? '' : '_disabled'),
'title': bss.radio.getI18n() 'title': bss.radio.getI18n()
}), }),
E('span', [
' %s '.format(bss.network.getShortName()), ' %s '.format(bss.network.getShortName()),
E('small', '(%s)'.format(bss.network.getIfname())) E('small', '(%s)'.format(bss.network.getIfname()))
])
]), ]),
bss.mac, bss.mac,
hint, hint,
@ -2143,7 +2159,7 @@ return L.view.extend({
.then(L.bind(this.poll_status, this, nodes)); .then(L.bind(this.poll_status, this, nodes));
}, this), 5); }, this), 5);
var table = E('div', { 'class': 'table', 'id': 'wifi_assoclist_table' }, [ var table = E('div', { 'class': 'table assoclist', 'id': 'wifi_assoclist_table' }, [
E('div', { 'class': 'tr table-titles' }, [ E('div', { 'class': 'tr table-titles' }, [
E('div', { 'class': 'th nowrap' }, _('Network')), E('div', { 'class': 'th nowrap' }, _('Network')),
E('div', { 'class': 'th hide-xs' }, _('MAC-Address')), E('div', { 'class': 'th hide-xs' }, _('MAC-Address')),