Skip to content

Commit

Permalink
luci-mod-dashboard: make the DHCP Devices and Wireless proper tables …
Browse files Browse the repository at this point in the history
…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 <[email protected]>
  • Loading branch information
adelton authored and systemcrash committed Jan 14, 2025
1 parent edeb9de commit c50ff5e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand All @@ -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', {}, [
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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' })
Expand Down Expand Up @@ -79,19 +77,16 @@ 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')),
E('th', { 'class': 'th' }, _('Transferred') + ' %s / %s'.format( _('Up.'), _('Down.')))
])
]);

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];
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit c50ff5e

Please sign in to comment.