From c50ff5e2a331a0384d69b8d5ea10186099a34d10 Mon Sep 17 00:00:00 2001 From: Jan Pazdziora Date: Thu, 9 Jan 2025 22:57:23 +0100 Subject: [PATCH] luci-mod-dashboard: make the DHCP Devices and Wireless proper tables with headers. 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 --- .../view/dashboard/include/20_lan.js | 23 ++++++++----------- .../view/dashboard/include/30_wifi.js | 14 +++-------- 2 files changed, 12 insertions(+), 25 deletions(-) diff --git a/modules/luci-mod-dashboard/htdocs/luci-static/resources/view/dashboard/include/20_lan.js b/modules/luci-mod-dashboard/htdocs/luci-static/resources/view/dashboard/include/20_lan.js index 1e9d5a7a47..20bce46f3b 100644 --- a/modules/luci-mod-dashboard/htdocs/luci-static/resources/view/dashboard/include/20_lan.js +++ b/modules/luci-mod-dashboard/htdocs/luci-static/resources/view/dashboard/include/20_lan.js @@ -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; diff --git a/modules/luci-mod-dashboard/htdocs/luci-static/resources/view/dashboard/include/30_wifi.js b/modules/luci-mod-dashboard/htdocs/luci-static/resources/view/dashboard/include/30_wifi.js index 2872c6a3e8..7233282e33 100644 --- a/modules/luci-mod-dashboard/htdocs/luci-static/resources/view/dashboard/include/30_wifi.js +++ b/modules/luci-mod-dashboard/htdocs/luci-static/resources/view/dashboard/include/30_wifi.js @@ -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; -- 2.30.2