luci-mod-dashboard: make the DHCP Devices and Wireless proper tables with headers.
authorJan Pazdziora <jan.pazdziora@code.adelton.com>
Thu, 9 Jan 2025 21:57:23 +0000 (22:57 +0100)
committerPaul Donald <newtwen+github@gmail.com>
Tue, 14 Jan 2025 01:01:04 +0000 (02:01 +0100)
Also, the Lan and WiFi tables are half-width, we should not use the table-titles which has @media rules about 992px.

Signed-off-by: Jan Pazdziora <jan.pazdziora@code.adelton.com>
modules/luci-mod-dashboard/htdocs/luci-static/resources/view/dashboard/include/20_lan.js
modules/luci-mod-dashboard/htdocs/luci-static/resources/view/dashboard/include/30_wifi.js

index 1e9d5a7a47d60e639621d82dc966afc7f2b9b82b..20bce46f3b6fcd9d1e7d0627ca48bfea7f1c36b8 100644 (file)
@@ -25,16 +25,6 @@ return baseclass.extend({
 
                var container_wapper = E('div', { 'class': 'router-status-lan dashboard-bg box-s1' });
                var container_box = E('div', { 'class': 'lan-info devices-list' });
-               var container_devices = E('table', { 'class': 'table assoclist devices-info' }, [
-                       E('tr', { 'class': 'tr table-titles  dashboard-bg' }, [
-                               E('th', { 'class': 'th nowrap' }, _('Hostname')),
-                               E('th', { 'class': 'th' }, _('IP Address')),
-                               E('th', { 'class': 'th' }, _('MAC')),
-                       ])
-               ]);
-
-               var container_deviceslist = E('table', { 'class': 'table assoclist devices-info' });
-
                container_box.appendChild(E('div', { 'class': 'title'}, [
                        E('img', {
                                'src': L.resource('view/dashboard/icons/devices.svg'),
@@ -45,10 +35,18 @@ return baseclass.extend({
                        E('h3', this.title)
                ]));
 
+               var container_devices = E('table', { 'class': 'table assoclist devices-info' }, [
+                       E('tr', { 'class': 'tr dashboard-bg' }, [
+                               E('th', { 'class': 'th nowrap' }, _('Hostname')),
+                               E('th', { 'class': 'th' }, _('IP Address')),
+                               E('th', { 'class': 'th' }, _('MAC')),
+                       ])
+               ]);
+
                for(var idx in this.params.lan.devices) {
                        var device = this.params.lan.devices[idx];
 
-                       container_deviceslist.appendChild(E('tr', { 'class': 'tr cbi-rowstyle-1'}, [
+                       container_devices.appendChild(E('tr', { 'class': 'tr cbi-rowstyle-1'}, [
 
                                E('td', { 'class': 'td device-info'}, [
                                        E('p', {}, [
@@ -70,10 +68,7 @@ return baseclass.extend({
                        ]));
                }
 
-               container_box.appendChild(E('hr'));
                container_box.appendChild(container_devices);
-               container_box.appendChild(E('hr'));
-               container_box.appendChild(container_deviceslist);
                container_wapper.appendChild(container_box);
 
                return container_wapper;
index 2872c6a3e89932666610d7c25f48c5757f4dcbed..7233282e33c9d4ee5624c860879a898ef8858d2e 100644 (file)
@@ -46,8 +46,6 @@ return baseclass.extend({
                        E('h3', this.title)
                ]));
 
-               container_box.appendChild(E('hr'));
-
                for (var i =0; i < this.params.wifi.radios.length; i++) {
 
                        container_radio_item = E('div', { 'class': 'radio-info' })
@@ -79,7 +77,7 @@ return baseclass.extend({
                container_box.appendChild(container_radio);
 
                var container_devices = E('table', { 'class': 'table assoclist devices-info' }, [
-                       E('tr', { 'class': 'tr table-titles  dashboard-bg' }, [
+                       E('tr', { 'class': 'tr dashboard-bg' }, [
                                E('th', { 'class': 'th nowrap' }, _('Hostname')),
                                E('th', { 'class': 'th' }, _('SSID')),
                                E('th', { 'class': 'th', 'width': '45%' }, _('Signal Strength')),
@@ -87,11 +85,8 @@ return baseclass.extend({
                        ])
                ]);
 
-               var container_devices_item;
-               var container_devices_list = E('table', { 'class': 'table assoclist devices-info' });
-
                for (var i =0; i < this.params.wifi.devices.length; i++) {
-                       container_devices_item = E('tr', { 'class': 'tr cbi-rowstyle-1' });
+                       var container_devices_item = E('tr', { 'class': 'tr cbi-rowstyle-1' });
 
                        for(var idx in this.params.wifi.devices[i]) {
                                var device = this.params.wifi.devices[i];
@@ -127,13 +122,10 @@ return baseclass.extend({
                                container_devices_item.appendChild(container_content);
                        }
 
-                       container_devices_list.appendChild(container_devices_item);
+                       container_devices.appendChild(container_devices_item);
                }
 
-               container_devices.appendChild(container_devices_list);
-               container_box.appendChild(E('hr'));
                container_box.appendChild(container_devices);
-               container_box.appendChild(container_devices_list);
                container_wapper.appendChild(container_box);
 
                return container_wapper;