luci-mod-admin-full: fix device selection in wireless and bandwidth realtime stats
authorJo-Philipp Wich <jow@openwrt.org>
Wed, 20 Jan 2016 12:45:27 +0000 (13:45 +0100)
committerJo-Philipp Wich <jow@openwrt.org>
Wed, 20 Jan 2016 12:45:27 +0000 (13:45 +0100)
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
modules/luci-mod-admin-full/luasrc/view/admin_status/bandwidth.htm
modules/luci-mod-admin-full/luasrc/view/admin_status/wireless.htm

index 04da3c12397013611cb2a2edb8980ff4dd21bbb0..33bbee78432ffd8ef5b38e457a0da835ad564691 100644 (file)
@@ -14,8 +14,7 @@
                end
        end
 
-       local curdev = luci.dispatcher.context.requestpath
-             curdev = curdev[#curdev] ~= "bandwidth" and curdev[#curdev] or devices[1]
+       local curdev = luci.http.formvalue("dev") or devices[1]
 -%>
 
 <%+header%>
 
 <ul class="cbi-tabmenu">
        <% for _, dev in ipairs(devices) do %>
-               <li class="cbi-tab<%= dev == curdev and "" or "-disabled" %>"><a href="<%=pcdata(dev)%>"><%=pcdata(dev)%></a></li>
+               <li class="cbi-tab<%= dev == curdev and "" or "-disabled" %>"><a href="?dev=<%=pcdata(dev)%>"><%=pcdata(dev)%></a></li>
        <% end %>
 </ul>
 
index f1859261045b6d24e8c2166ca8ef55b4f90adf19..aa658ff0cbda599eb64c1512078cd6c162b42d07 100644 (file)
@@ -14,8 +14,7 @@
                end
        end
 
-       local curdev = luci.dispatcher.context.requestpath
-             curdev = curdev[#curdev] ~= "wireless" and curdev[#curdev] or devices[1]
+       local curdev = luci.http.formvalue("dev") or devices[1]
 -%>
 
 <%+header%>
 
 <ul class="cbi-tabmenu">
        <% for _, dev in ipairs(devices) do %>
-               <li class="cbi-tab<%= dev == curdev and "" or "-disabled" %>"><a href="<%=pcdata(dev)%>"><%=pcdata(dev)%></a></li>
+               <li class="cbi-tab<%= dev == curdev and "" or "-disabled" %>"><a href="?dev=<%=pcdata(dev)%>"><%=pcdata(dev)%></a></li>
        <% end %>
 </ul>