From: Jo-Philipp Wich Date: Sun, 15 Jul 2018 11:14:24 +0000 (+0200) Subject: luci-mod-admin-full: fix wifi add and scan actions X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f6ffc3d739ef48c3186b3313e2480c8787f42fcd;p=oweals%2Fluci.git luci-mod-admin-full: fix wifi add and scan actions Due to conversion to CBI, the inline forms are now nested and thus do not work anymore. Signed-off-by: Jo-Philipp Wich --- diff --git a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/wifi_overview.lua b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/wifi_overview.lua index dda31fb1e..dcd03cb0f 100644 --- a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/wifi_overview.lua +++ b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/wifi_overview.lua @@ -78,18 +78,9 @@ local tpl_radio = tpl.Template(nil, [[
- - -
- - - -
-
- - - -
+ + +
diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_overview_status.htm b/modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_overview_status.htm index 9730bc2c9..cc6db1721 100644 --- a/modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_overview_status.htm +++ b/modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_overview_status.htm @@ -26,6 +26,14 @@ { token: '<%=token%>' }, XHR.run); } + function wifi_action(ev, action) { + var i = ev.target, + e = i.getAttribute('data-radio'); + + i.parentNode.appendChild(E('input', { type: 'hidden', name: 'device', value: e })); + i.form.action = '<%=url('admin/network/wireless_')%>' + action; + } + var networks = [ ]; document.querySelectorAll('[data-network]').forEach(function(n) {