From 0b44d33dd768ab2e3bf543905f838eec7f0762de Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 18 Jul 2018 10:02:07 +0200 Subject: [PATCH] luci-mod-admin-full: properly reset internal device form field In some cases the hidden internal device field was not reset, e.g. after aborting a wifi scan and using the browser back buttons to navigate to the overview page again. In such a case, the previous device hidden field was still present and a new one getting created, causing further wireless scan attempts to get invoked with multiple radio names as parameter which fails. Fix this issue by using the new generic cbi_submit() helper any by dropping the faulty wifi_action() function. Signed-off-by: Jo-Philipp Wich (cherry picked from commit 90f9c59a2d392837bbef39b5acf402531ab2d9be) --- .../luasrc/model/cbi/admin_network/wifi_overview.lua | 4 ++-- .../luasrc/view/admin_network/wifi_overview_status.htm | 8 -------- 2 files changed, 2 insertions(+), 10 deletions(-) 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 dcd03cb0f..32bf1965f 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 @@ -79,8 +79,8 @@ 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 cc6db1721..9730bc2c9 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,14 +26,6 @@ { 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) { -- 2.25.1