Merge pull request #1704 from TDT-AG/pr/20180328-luci-app-mwan3-fixes
luci-app-mwan3: fix syntax error and update notify page
This commit is contained in:
commit
eea92af676
4 changed files with 13 additions and 9 deletions
|
@ -8,37 +8,37 @@ dsp = require "luci.dispatcher"
|
||||||
function interfaceWarnings(overview, count)
|
function interfaceWarnings(overview, count)
|
||||||
local warnings = ""
|
local warnings = ""
|
||||||
if count <= 250 then
|
if count <= 250 then
|
||||||
warnings = string.format("<strong>%s</strong></br>",
|
warnings = string.format("<strong>%s</strong><br />",
|
||||||
translatef("There are currently %d of 250 supported interfaces configured", count)
|
translatef("There are currently %d of 250 supported interfaces configured", count)
|
||||||
)
|
)
|
||||||
else
|
else
|
||||||
warnings = string.format("<strong>%s</strong></br>",
|
warnings = string.format("<strong>%s</strong><br />",
|
||||||
translatef("WARNING: %d interfaces are configured exceeding the maximum of 250!", count)
|
translatef("WARNING: %d interfaces are configured exceeding the maximum of 250!", count)
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
for i, k in pairs(overview) do
|
for i, k in pairs(overview) do
|
||||||
if overview[i]["network"] == false then
|
if overview[i]["network"] == false then
|
||||||
warnings = warnings .. string.format("<strong>%s</strong></br>",
|
warnings = warnings .. string.format("<strong>%s</strong><br />",
|
||||||
translatef("WARNING: Interface %s are not found in /etc/config/network", i)
|
translatef("WARNING: Interface %s are not found in /etc/config/network", i)
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
if overview[i]["default_route"] == false then
|
if overview[i]["default_route"] == false then
|
||||||
warnings = warnings .. string.format("<strong>%s</strong></br>",
|
warnings = warnings .. string.format("<strong>%s</strong><br />",
|
||||||
translatef("WARNING: Interface %s has no default route in the main routing table", i)
|
translatef("WARNING: Interface %s has no default route in the main routing table", i)
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
if overview[i]["reliability"] == false then
|
if overview[i]["reliability"] == false then
|
||||||
warnings = warnings .. string.format("<strong>%s</strong></br>",
|
warnings = warnings .. string.format("<strong>%s</strong><br />",
|
||||||
translatef("WARNING: Interface %s has a higher reliability " ..
|
translatef("WARNING: Interface %s has a higher reliability " ..
|
||||||
"requirement than tracking hosts (%d)", i, overview[i]["tracking"])
|
"requirement than tracking hosts (%d)", i, overview[i]["tracking"])
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
if overview[i]["duplicate_metric"] == true then
|
if overview[i]["duplicate_metric"] == true then
|
||||||
warnings = warnings .. string.format("<strong>%s</strong></br>",
|
warnings = warnings .. string.format("<strong>%s</strong><br />",
|
||||||
translatef("WARNING: Interface %s has a duplicate metric %s configured", i, overview[i]["metric"])
|
translatef("WARNING: Interface %s has a duplicate metric %s configured", i, overview[i]["metric"])
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
|
@ -23,7 +23,11 @@ f = m5:section(SimpleSection, nil,
|
||||||
"<br />" ..
|
"<br />" ..
|
||||||
"There are three main environment variables that are passed to this script.<br />" ..
|
"There are three main environment variables that are passed to this script.<br />" ..
|
||||||
"<br />" ..
|
"<br />" ..
|
||||||
"$ACTION Either \"ifup\" or \"ifdown\"<br />" ..
|
"$ACTION <br />" ..
|
||||||
|
"* \"ifup\" Is called by netifd and mwan3track <br />" ..
|
||||||
|
"* \"ifdown\" Is called by netifd and mwan3track <br />" ..
|
||||||
|
"* \"connected\" Is only called by mwan3track if tracking was successful <br />" ..
|
||||||
|
"* \"disconnected\" Is only called by mwan3track if tracking has failed <br />" ..
|
||||||
"$INTERFACE Name of the interface which went up or down (e.g. \"wan\" or \"wwan\")<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 />" ..
|
"$DEVICE Physical device name which interface went up or down (e.g. \"eth0\" or \"wwan0\")<br />" ..
|
||||||
"<br />"))
|
"<br />"))
|
||||||
|
|
|
@ -24,7 +24,7 @@ function policyError(policy_error)
|
||||||
local warnings = ""
|
local warnings = ""
|
||||||
for i, k in pairs(policy_error) do
|
for i, k in pairs(policy_error) do
|
||||||
if policy_error[i] == true then
|
if policy_error[i] == true then
|
||||||
warnings = warnings .. string.format("<strong>%s</strong></br>",
|
warnings = warnings .. string.format("<strong>%s</strong><br />",
|
||||||
translatef("WARNING: Policie %s has exceeding the maximum name of 15 characters", i)
|
translatef("WARNING: Policie %s has exceeding the maximum name of 15 characters", i)
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
|
@ -28,7 +28,7 @@ function ruleWarn(rule_error)
|
||||||
local warnings = ""
|
local warnings = ""
|
||||||
for i, k in pairs(rule_error) do
|
for i, k in pairs(rule_error) do
|
||||||
if rule_error[i] == true then
|
if rule_error[i] == true then
|
||||||
warnings = warnings .. string.format("<strong>%s</strong></br>",
|
warnings = warnings .. string.format("<strong>%s</strong><br />",
|
||||||
translatef("WARNING: Rule %s have a port configured with no or improper protocol specified!", i)
|
translatef("WARNING: Rule %s have a port configured with no or improper protocol specified!", i)
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue