luci-app-mwan3: move/rename hotplugscript tab
authorFlorian Eckert <fe@dev.tdt.de>
Wed, 10 Jan 2018 14:17:19 +0000 (15:17 +0100)
committerFlorian Eckert <fe@dev.tdt.de>
Thu, 11 Jan 2018 13:44:59 +0000 (14:44 +0100)
- move hotplugscript tab to Configuration
- rename hotplugscript tab to notify

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
applications/luci-app-mwan3/luasrc/controller/mwan3.lua
applications/luci-app-mwan3/luasrc/model/cbi/mwan/advanced_hotplugscript.lua [deleted file]
applications/luci-app-mwan3/luasrc/model/cbi/mwan/notify.lua [new file with mode: 0644]
applications/luci-app-mwan3/luasrc/view/mwan/advanced_diagnostics.htm
applications/luci-app-mwan3/luasrc/view/mwan/advanced_hotplugscript.htm [deleted file]
applications/luci-app-mwan3/luasrc/view/mwan/advanced_mwanconfig.htm
applications/luci-app-mwan3/luasrc/view/mwan/advanced_networkconfig.htm
applications/luci-app-mwan3/luasrc/view/mwan/advanced_troubleshooting.htm
applications/luci-app-mwan3/luasrc/view/mwan/advanced_wirelessconfig.htm

index c24beda281e06696eb6adda31a0a60e8df86e52c..4877f611ec75d088d88a026963a8fcccefeda629 100644 (file)
@@ -43,12 +43,13 @@ function index()
        entry({"admin", "network", "mwan", "configuration", "rule"},
                arcombine(cbi("mwan/rule"), cbi("mwan/ruleconfig")),
                _("Rules"), 40).leaf = true
+       entry({"admin", "network", "mwan", "configuration", "notify"},
+               cbi("mwan/notify"),
+               _("Notification"), 50).leaf = true
 
        entry({"admin", "network", "mwan", "advanced"},
-               alias("admin", "network", "mwan", "advanced", "hotplugscript"),
+               alias("admin", "network", "mwan", "advanced", "mwanconfig"),
                _("Advanced"), 100)
-       entry({"admin", "network", "mwan", "advanced", "hotplugscript"},
-               form("mwan/advanced_hotplugscript"))
        entry({"admin", "network", "mwan", "advanced", "mwanconfig"},
                form("mwan/advanced_mwanconfig"))
        entry({"admin", "network", "mwan", "advanced", "networkconfig"},
diff --git a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/advanced_hotplugscript.lua b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/advanced_hotplugscript.lua
deleted file mode 100644 (file)
index 1b97080..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
--- ------ hotplug script configuration ------ --
-
-fs = require "nixio.fs"
-ut = require "luci.util"
-
-script = "/etc/mwan3.user"
-
-m5 = SimpleForm("luci", nil)
-       m5:append(Template("mwan/advanced_hotplugscript")) -- highlight current tab
-
-f = m5:section(SimpleSection, nil,
-       translate("This section allows you to modify the content of \"/etc/mwan3.user\".<br />" ..
-       "The file is also preserved during sysupgrade.<br />" ..
-       "<br />" ..
-       "Notes:<br />" ..
-       "This file is interpreted as a shell script.<br />" ..
-       "The first line of the script must be &#34;#!/bin/sh&#34; without quotes.<br />" ..
-       "Lines beginning with # are comments and are not executed.<br />" ..
-       "Put your custom mwan3 action here, they will<br />" ..
-       "be executed with each netifd hotplug interface event<br />" ..
-       "on interfaces for which mwan3 is enabled.<br />" ..
-       "<br />" ..
-       "There are three main environment variables that are passed to this script.<br />" ..
-       "<br />" ..
-       "$ACTION Either \"ifup\" or \"ifdown\"<br />" ..
-       "$INTERFACE Name of the interface which went up or down (e.g. \"wan\" or \"wwan\")<br />" ..
-       "$DEVICE Physical device name which interface went up or down (e.g. \"eth0\" or \"wwan0\")<br />" ..
-       "<br />"))
-
-t = f:option(TextValue, "lines")
-       t.rmempty = true
-       t.rows = 20
-       function t.cfgvalue()
-               return fs.readfile(script)
-       end
-       function t.write(self, section, data) -- format and write new data to script
-               return fs.writefile(script, ut.trim(data:gsub("\r\n", "\n")) .. "\n")
-       end
-
-return m5
diff --git a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/notify.lua b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/notify.lua
new file mode 100644 (file)
index 0000000..8746072
--- /dev/null
@@ -0,0 +1,39 @@
+-- ------ hotplug script configuration ------ --
+
+fs = require "nixio.fs"
+ut = require "luci.util"
+
+script = "/etc/mwan3.user"
+
+m5 = SimpleForm("luci", nil)
+
+f = m5:section(SimpleSection, nil,
+       translate("This section allows you to modify the content of \"/etc/mwan3.user\".<br />" ..
+       "The file is also preserved during sysupgrade.<br />" ..
+       "<br />" ..
+       "Notes:<br />" ..
+       "This file is interpreted as a shell script.<br />" ..
+       "The first line of the script must be &#34;#!/bin/sh&#34; without quotes.<br />" ..
+       "Lines beginning with # are comments and are not executed.<br />" ..
+       "Put your custom mwan3 action here, they will<br />" ..
+       "be executed with each netifd hotplug interface event<br />" ..
+       "on interfaces for which mwan3 is enabled.<br />" ..
+       "<br />" ..
+       "There are three main environment variables that are passed to this script.<br />" ..
+       "<br />" ..
+       "$ACTION Either \"ifup\" or \"ifdown\"<br />" ..
+       "$INTERFACE Name of the interface which went up or down (e.g. \"wan\" or \"wwan\")<br />" ..
+       "$DEVICE Physical device name which interface went up or down (e.g. \"eth0\" or \"wwan0\")<br />" ..
+       "<br />"))
+
+t = f:option(TextValue, "lines")
+       t.rmempty = true
+       t.rows = 20
+       function t.cfgvalue()
+               return fs.readfile(script)
+       end
+       function t.write(self, section, data) -- format and write new data to script
+               return fs.writefile(script, ut.trim(data:gsub("\r\n", "\n")) .. "\n")
+       end
+
+return m5
index 448348594684f956baa4682ad250928f48b5b281..d29009595717374d533ee760a27f895b47aba704 100644 (file)
@@ -1,7 +1,6 @@
 <%+header%>
 
 <ul class="cbi-tabmenu">
-       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/hotplugscript")%>"><%:Hotplug Script%></a></li>
        <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/mwanconfig")%>"><%:MWAN Config%></a></li>
        <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/networkconfig")%>"><%:Network Config%></a></li>
        <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/wirelessconfig")%>"><%:Wireless Config%></a></li>
diff --git a/applications/luci-app-mwan3/luasrc/view/mwan/advanced_hotplugscript.htm b/applications/luci-app-mwan3/luasrc/view/mwan/advanced_hotplugscript.htm
deleted file mode 100644 (file)
index 10b4f10..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-<ul class="cbi-tabmenu">
-       <li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/hotplugscript")%>"><%:Hotplug Script%></a></li>
-       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/mwanconfig")%>"><%:MWAN Config%></a></li>
-       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/networkconfig")%>"><%:Network Config%></a></li>
-       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/wirelessconfig")%>"><%:Wireless Config%></a></li>
-       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/diagnostics")%>"><%:Diagnostics%></a></li>
-       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/troubleshooting")%>"><%:Troubleshooting%></a></li>
-</ul>
-
-<style type="text/css">
-  .cbi-section {
-       padding: 20px;
-  }
-</style>
index 20ae6036fce69713a87197c412436ffdc1bc9f46..17e2589e74fcf8b84e815030ef84745dfe741bd2 100644 (file)
@@ -1,5 +1,4 @@
 <ul class="cbi-tabmenu">
-       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/hotplugscript")%>"><%:Hotplug Script%></a></li>
        <li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/mwanconfig")%>"><%:MWAN Config%></a></li>
        <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/networkconfig")%>"><%:Network Config%></a></li>
        <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/wirelessconfig")%>"><%:Wireless Config%></a></li>
index bed43107c09fb369f67a33b3edeb4551d79182d1..25c51fd8b32d003b4c8130f132e75e3a75e83540 100644 (file)
@@ -1,5 +1,4 @@
 <ul class="cbi-tabmenu">
-       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/hotplugscript")%>"><%:Hotplug Script%></a></li>
        <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/mwanconfig")%>"><%:MWAN Config%></a></li>
        <li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/networkconfig")%>"><%:Network Config%></a></li>
        <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/wirelessconfig")%>"><%:Wireless Config%></a></li>
index 4174ef4b2151bb6ddf41124136dda98987a6d52f..96a5b62b2994b7a39d45d0b0aa0f3aab84cef55c 100644 (file)
@@ -1,7 +1,6 @@
 <%+header%>
 
 <ul class="cbi-tabmenu">
-       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/hotplugscript")%>"><%:Hotplug Script%></a></li>
        <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/mwanconfig")%>"><%:MWAN Config%></a></li>
        <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/networkconfig")%>"><%:Network Config%></a></li>
        <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/wirelessconfig")%>"><%:Wireless Config%></a></li>
index bb18d53493ca8dd21272ff68ec81673a05efa044..5dcf0ed60b7f14f4682a3432ba86d276b945b711 100644 (file)
@@ -1,5 +1,4 @@
 <ul class="cbi-tabmenu">
-       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/hotplugscript")%>"><%:Hotplug Script%></a></li>
        <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/mwanconfig")%>"><%:MWAN Config%></a></li>
        <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/networkconfig")%>"><%:Network Config%></a></li>
        <li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/wirelessconfig")%>"><%:Wireless Config%></a></li>