luci-mod-status: adjust assoclist markup for easier styling
authorJo-Philipp Wich <jo@mein.io>
Mon, 23 Mar 2020 21:01:06 +0000 (22:01 +0100)
committerJo-Philipp Wich <jo@mein.io>
Thu, 7 May 2020 17:40:49 +0000 (19:40 +0200)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit e26b6c8c1408586ccbf59aac7368420c7a055097)

modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/60_wifi.js

index e4c623289886094c85fe9843c986fce9ad6fbf71..115fe9909550e3c45cbdc3eb48d0dd0c38da83ea 100644 (file)
@@ -121,7 +121,7 @@ return baseclass.extend({
                if (!table.lastElementChild)
                        return null;
 
-               var assoclist = E('div', { 'class': 'table' }, [
+               var assoclist = E('div', { 'class': 'table assoclist' }, [
                        E('div', { 'class': 'tr table-titles' }, [
                                E('div', { 'class': 'th nowrap' }, _('Network')),
                                E('div', { 'class': 'th hide-xs' }, _('MAC-Address')),
@@ -170,23 +170,37 @@ return baseclass.extend({
                                var hint;
 
                                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))
-                                       hint = '%s (%s)'.format(name, ipv4 || ipv6);
+                                       hint = '%s <span class="hide-xs">(%s)</span>'.format(name, ipv4 || ipv6);
                                else
                                        hint = name || ipv4 || ipv6 || '?';
 
                                var row = [
-                                       E('span', { 'class': 'ifacebadge', 'title': networks[i].getI18n() }, [
+                                       E('span', {
+                                               'class': 'ifacebadge',
+                                               'title': networks[i].getI18n(),
+                                               'data-ifname': networks[i].getIfname(),
+                                               'data-ssid': networks[i].getActiveSSID()
+                                       }, [
                                                E('img', { 'src': L.resource('icons/wifi.png') }),
-                                               ' ', networks[i].getShortName(),
-                                               E('small', {}, [ ' (', networks[i].getIfname(), ')' ])
+                                               E('span', {}, [
+                                                       ' ', networks[i].getShortName(),
+                                                       E('small', {}, [ ' (', networks[i].getIfname(), ')' ])
+                                               ])
                                        ]),
                                        bss.mac,
                                        hint,
-                                       E('span', { 'class': 'ifacebadge', 'title': sig_title }, [
+                                       E('span', {
+                                               'class': 'ifacebadge',
+                                               'title': sig_title,
+                                               'data-signal': bss.signal,
+                                               'data-noise': bss.noise
+                                       }, [
                                                E('img', { 'src': icon }),
-                                               ' ', sig_value
+                                               E('span', {}, [
+                                                       ' ', sig_value
+                                               ])
                                        ]),
                                        E('span', {}, [
                                                E('span', wifirate(bss.rx)),