diff options
author | Florian Eckert <fe@dev.tdt.de> | 2018-01-18 07:26:27 +0100 |
---|---|---|
committer | Florian Eckert <fe@dev.tdt.de> | 2018-01-18 15:09:52 +0100 |
commit | 831bd71eb387973a25277e3fa7391c6a4af83597 (patch) | |
tree | dea9adaecd5e0ea3567f4cd6780c5f6622b68d97 | |
parent | d369c80beccedf883b4cd47b4e3c1debc9f37e9a (diff) |
luci-app-mwan3: remove/unify lua require order
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
9 files changed, 15 insertions, 18 deletions
diff --git a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/globalsconfig.lua b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/globalsconfig.lua index 3e1a28325..b53d288d0 100644 --- a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/globalsconfig.lua +++ b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/globalsconfig.lua @@ -14,12 +14,14 @@ $Id$ local net = require "luci.model.network".init() + m = Map("mwan3", translate("MWAN - Globals")) s = m:section(NamedSection, "globals", "globals", nil) n = s:option(ListValue, "local_source", translate("Local source interface"), - translate("Use the IP address of this interface as source IP address for traffic initiated by the router itself")) + translate("Use the IP address of this interface as source IP " .. + "address for traffic initiated by the router itself")) n:value("none") n.default = "none" for _, net in ipairs(net:get_networks()) do diff --git a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/interface.lua b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/interface.lua index 01f18dae4..f80319327 100644 --- a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/interface.lua +++ b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/interface.lua @@ -1,6 +1,5 @@ dsp = require "luci.dispatcher" -sys = require "luci.sys" -ut = require "luci.util" + function interfaceWarnings(overview, count) local warnings = "" diff --git a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/interfaceconfig.lua b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/interfaceconfig.lua index 07ccd2d59..01b96da41 100644 --- a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/interfaceconfig.lua +++ b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/interfaceconfig.lua @@ -1,6 +1,4 @@ dsp = require "luci.dispatcher" -sys = require "luci.sys" -ut = require "luci.util" arg[1] = arg[1] or "" diff --git a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/member.lua b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/member.lua index 0865fccaf..63e511e53 100644 --- a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/member.lua +++ b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/member.lua @@ -1,4 +1,4 @@ -ds = require "luci.dispatcher" +dsp = require "luci.dispatcher" m5 = Map("mwan3", translate("MWAN - Members")) @@ -12,11 +12,11 @@ mwan_member = m5:section(TypedSection, "member", nil, mwan_member.sectionhead = translate("Member") mwan_member.sortable = true mwan_member.template = "cbi/tblsection" - mwan_member.extedit = ds.build_url("admin", "network", "mwan", "member", "%s") + mwan_member.extedit = dsp.build_url("admin", "network", "mwan", "member", "%s") function mwan_member.create(self, section) TypedSection.create(self, section) m5.uci:save("mwan3") - luci.http.redirect(ds.build_url("admin", "network", "mwan", "member", section)) + luci.http.redirect(dsp.build_url("admin", "network", "mwan", "member", section)) end interface = mwan_member:option(DummyValue, "interface", translate("Interface")) diff --git a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/notify.lua b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/notify.lua index 14237e60f..1019302ac 100644 --- a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/notify.lua +++ b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/notify.lua @@ -1,9 +1,8 @@ --- ------ hotplug script configuration ------ -- - local fs = require "nixio.fs" local ut = require "luci.util" script = "/etc/mwan3.user" + m5 = SimpleForm("luci", translate("MWAN - Notification")) f = m5:section(SimpleSection, nil, diff --git a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/policy.lua b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/policy.lua index 44585d75e..6340359fa 100644 --- a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/policy.lua +++ b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/policy.lua @@ -1,5 +1,5 @@ -ds = require "luci.dispatcher" -sys = require "luci.sys" +dsp = require "luci.dispatcher" + function policyCheck() local policy_error = {} @@ -44,11 +44,11 @@ mwan_policy = m5:section(TypedSection, "policy", nil, mwan_policy.sectionhead = translate("Policy") mwan_policy.sortable = true mwan_policy.template = "cbi/tblsection" - mwan_policy.extedit = ds.build_url("admin", "network", "mwan", "policy", "%s") + mwan_policy.extedit = dsp.build_url("admin", "network", "mwan", "policy", "%s") function mwan_policy.create(self, section) TypedSection.create(self, section) m5.uci:save("mwan3") - luci.http.redirect(ds.build_url("admin", "network", "mwan", "policy", section)) + luci.http.redirect(dsp.build_url("admin", "network", "mwan", "policy", section)) end diff --git a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/policyconfig.lua b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/policyconfig.lua index f29a06093..29bb3dcd8 100644 --- a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/policyconfig.lua +++ b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/policyconfig.lua @@ -1,6 +1,7 @@ dsp = require "luci.dispatcher" arg[1] = arg[1] or "" + m5 = Map("mwan3", translatef("MWAN Policy Configuration - %s", arg[1])) m5.redirect = dsp.build_url("admin", "network", "mwan", "policy") diff --git a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/rule.lua b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/rule.lua index d71cb2bc1..5c6329e33 100644 --- a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/rule.lua +++ b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/rule.lua @@ -1,6 +1,5 @@ dsp = require "luci.dispatcher" -sys = require "luci.sys" -ut = require "luci.util" + function ruleCheck() local rule_error = {} diff --git a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/ruleconfig.lua b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/ruleconfig.lua index 756e08940..e12639e33 100644 --- a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/ruleconfig.lua +++ b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/ruleconfig.lua @@ -1,8 +1,7 @@ dsp = require "luci.dispatcher" -sys = require "luci.sys" -ut = require "luci.util" arg[1] = arg[1] or "" + m5 = Map("mwan3", translatef("MWAN Rule Configuration - %s", arg[1])) m5.redirect = dsp.build_url("admin", "network", "mwan", "rule") |