mirror of
https://github.com/openwrt/luci.git
synced 2025-12-21 19:14:34 +04:00
luci-mod-network: simplify cbi_update_table in dhcp.js
cbi_update_table() can already take a string suitable for .querySelector() as its first argument. In addition, it will do the right thing if the element isn't found, so this can be simplified a bit. Signed-off-by: David Härdeman <david@hardeman.nu>
This commit is contained in:
committed by
Paul Donald
parent
495380a926
commit
57afc27d2d
@@ -761,7 +761,7 @@ return view.extend({
|
||||
var leases = Array.isArray(leaseinfo.dhcp_leases) ? leaseinfo.dhcp_leases : [],
|
||||
leases6 = Array.isArray(leaseinfo.dhcp6_leases) ? leaseinfo.dhcp6_leases : [];
|
||||
|
||||
cbi_update_table(mapEl.querySelector('#lease_status_table'),
|
||||
cbi_update_table('#lease_status_table',
|
||||
leases.map(function(lease) {
|
||||
var exp;
|
||||
var vendor;
|
||||
@@ -796,10 +796,10 @@ return view.extend({
|
||||
exp
|
||||
];
|
||||
}),
|
||||
E('em', _('There are no active leases')));
|
||||
E('em', _('There are no active leases'))
|
||||
);
|
||||
|
||||
if (has_dhcpv6) {
|
||||
cbi_update_table(mapEl.querySelector('#lease6_status_table'),
|
||||
cbi_update_table('#lease6_status_table',
|
||||
leases6.map(function(lease) {
|
||||
var exp;
|
||||
|
||||
@@ -829,8 +829,8 @@ return view.extend({
|
||||
exp
|
||||
];
|
||||
}),
|
||||
E('em', _('There are no active leases')));
|
||||
}
|
||||
E('em', _('There are no active leases'))
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user