From f598b10c49ff5d196baea7c92a2859da70869a5f Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 21 Nov 2018 21:07:34 +0100 Subject: luci-mod-network: move interface overview JS into external file Signed-off-by: Jo-Philipp Wich --- .../luasrc/model/cbi/admin_network/network.lua | 63 +------ .../luasrc/view/admin_network/iface_overview.htm | 53 ++++++ .../view/admin_network/iface_overview_status.htm | 183 --------------------- 3 files changed, 55 insertions(+), 244 deletions(-) create mode 100644 modules/luci-mod-network/luasrc/view/admin_network/iface_overview.htm delete mode 100644 modules/luci-mod-network/luasrc/view/admin_network/iface_overview_status.htm (limited to 'modules/luci-mod-network/luasrc') diff --git a/modules/luci-mod-network/luasrc/model/cbi/admin_network/network.lua b/modules/luci-mod-network/luasrc/model/cbi/admin_network/network.lua index 0c0ca5263d..b98086dea6 100644 --- a/modules/luci-mod-network/luasrc/model/cbi/admin_network/network.lua +++ b/modules/luci-mod-network/luasrc/model/cbi/admin_network/network.lua @@ -15,59 +15,6 @@ m:chain("dhcp") m.pageaction = false -local tpl_networks = tpl.Template(nil, [[ -
-
- <% - for i, net in ipairs(netlist) do - local z = net[3] - local c = z and z:get_color() or "#EEEEEE" - local t = z and translate("Part of zone %q" % z:name()) or translate("No zone assigned") - local disabled = (net[4]:get("auto") == "0") - local dynamic = net[4]:is_dynamic() - %> -
-
-
-
- <%=net[1]:upper()%> -
-
-
- ? -
-
-
-
- <%:Collecting data...%> -
-
-
- /> - - <% if disabled then %> - - /> - <% else %> - - /> - <% end %> - - '" title="<%:Edit this interface%>" value="<%:Edit%>" id="<%=net[1]%>-ifc-edit"<%=ifattr(dynamic, "disabled", "disabled")%> /> - - - /> -
-
-
- <% end %> -
-
-
- '" /> -
-]]) - local _, net local ifaces, netlist = { }, { } @@ -102,6 +49,8 @@ table.sort(netlist, end) s = m:section(TypedSection, "interface", translate("Interface Overview")) +s.template = "admin_network/iface_overview" +s.netlist = netlist function s.cfgsections(self) local _, net, sl = nil, nil, { } @@ -113,12 +62,6 @@ function s.cfgsections(self) return sl end -function s.render(self) - tpl_networks:render({ - netlist = netlist - }) -end - o = s:option(Value, "__disable__") function o.write(self, sid, value) @@ -138,8 +81,6 @@ function o.write(self, sid, value) end -m:section(SimpleSection).template = "admin_network/iface_overview_status" - if fs.access("/etc/init.d/dsl_control") then local ok, boarddata = pcall(json.parse, fs.readfile("/etc/board.json")) local modemtype = (ok == true) diff --git a/modules/luci-mod-network/luasrc/view/admin_network/iface_overview.htm b/modules/luci-mod-network/luasrc/view/admin_network/iface_overview.htm new file mode 100644 index 0000000000..4fd46e2bff --- /dev/null +++ b/modules/luci-mod-network/luasrc/view/admin_network/iface_overview.htm @@ -0,0 +1,53 @@ +
+
+ <% + for i, net in ipairs(self.netlist) do + local z = net[3] + local c = z and z:get_color() or "#EEEEEE" + local t = z and translate("Part of zone %q" % z:name()) or translate("No zone assigned") + local disabled = (net[4]:get("auto") == "0") + local dynamic = net[4]:is_dynamic() + %> +
+
+
+
+ <%=net[1]:upper()%> +
+
+
+ ? +
+
+
+
+ <%:Collecting data...%> +
+
+
+ /> + + <% if disabled then %> + + /> + <% else %> + + /> + <% end %> + + '" title="<%:Edit this interface%>" value="<%:Edit%>" id="<%=net[1]%>-ifc-edit"<%=ifattr(dynamic, "disabled", "disabled")%> /> + + + /> +
+
+
+ <% end %> +
+
+ +
+ '" /> +
+ + diff --git a/modules/luci-mod-network/luasrc/view/admin_network/iface_overview_status.htm b/modules/luci-mod-network/luasrc/view/admin_network/iface_overview_status.htm deleted file mode 100644 index 7427154a04..0000000000 --- a/modules/luci-mod-network/luasrc/view/admin_network/iface_overview_status.htm +++ /dev/null @@ -1,183 +0,0 @@ -<%# - Copyright 2010-2018 Jo-Philipp Wich - Licensed to the public under the Apache License 2.0. --%> - - -- cgit v1.2.3