From a03ec606967434182450cdbad81d25474eb5cd51 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Thu, 22 Nov 2018 12:56:05 +0100 Subject: luci-mod-network: move wifi overview markup and JS code into external files Signed-off-by: Jo-Philipp Wich --- .../model/cbi/admin_network/wifi_overview.lua | 76 +--------------------- 1 file changed, 3 insertions(+), 73 deletions(-) (limited to 'modules/luci-mod-network/luasrc/model/cbi') diff --git a/modules/luci-mod-network/luasrc/model/cbi/admin_network/wifi_overview.lua b/modules/luci-mod-network/luasrc/model/cbi/admin_network/wifi_overview.lua index 3bffb3502c..54720d6889 100644 --- a/modules/luci-mod-network/luasrc/model/cbi/admin_network/wifi_overview.lua +++ b/modules/luci-mod-network/luasrc/model/cbi/admin_network/wifi_overview.lua @@ -64,68 +64,6 @@ function guess_wifi_hw(dev) end end -local tpl_radio = tpl.Template(nil, [[ -
-
- -
-
- <%=dev:name()%> -
-
- <%=hw%>
- -
-
-
- - - -
-
-
- - - - <% if #wnets > 0 then %> - <% for i, net in ipairs(wnets) do local disabled = (dev:get("disabled") == "1" or net:get("disabled") == "1") %> -
-
- .png" /> 0% -
-
"> - <%= disabled and translate("Wireless is disabled") or translate("Collecting data...") %> -
-
-
- <% if disabled then %> - - - <% else %> - - - <% end %> - - - - - -
-
-
- <% end %> - <% else %> -
-
- <%:No network configured on this device%> -
-
- <% end %> - -
-
-]]) - m = Map("wireless", translate("Wireless Overview")) m:chain("network") @@ -147,15 +85,10 @@ end local _, dev, net for _, dev in ipairs(ntm:get_wifidevs()) do s = m:section(TypedSection) + s.template = "admin_network/wifi_overview" s.wnets = dev:get_wifinets() - - function s.render(self, sid) - tpl_radio:render({ - hw = guess_wifi_hw(dev), - dev = dev, - wnets = self.wnets - }) - end + s.dev = dev + s.hw = guess_wifi_hw(dev) function s.cfgsections(self) local _, net, sl = nil, nil, { } @@ -208,9 +141,6 @@ for _, dev in ipairs(ntm:get_wifidevs()) do end end -s = m:section(NamedSection, "__script__") -s.template = "admin_network/wifi_overview_status" - s = m:section(NamedSection, "__assoclist__") function s.render(self, sid) -- cgit v1.2.3