luci-app-mwan3: remove some config parameter from interface overview table
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
This commit is contained in:
parent
0ac4d725c5
commit
03dc912ebd
1 changed files with 9 additions and 44 deletions
|
@ -105,7 +105,6 @@ end
|
||||||
|
|
||||||
m5 = Map("mwan3", translate("MWAN - Interfaces"),
|
m5 = Map("mwan3", translate("MWAN - Interfaces"),
|
||||||
interfaceWarnings(configCheck()))
|
interfaceWarnings(configCheck()))
|
||||||
m5:append(Template("mwan/config_css"))
|
|
||||||
|
|
||||||
|
|
||||||
mwan_interface = m5:section(TypedSection, "interface", nil,
|
mwan_interface = m5:section(TypedSection, "interface", nil,
|
||||||
|
@ -137,24 +136,10 @@ enabled = mwan_interface:option(DummyValue, "enabled", translate("Enabled"))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
track_ip = mwan_interface:option(DummyValue, "track_ip", translate("Tracking IP"))
|
|
||||||
track_ip.rawhtml = true
|
|
||||||
function track_ip.cfgvalue(self, s)
|
|
||||||
tracked = self.map:get(s, "track_ip")
|
|
||||||
if tracked then
|
|
||||||
local ipList = ""
|
|
||||||
for k,v in pairs(tracked) do
|
|
||||||
ipList = ipList .. v .. "<br />"
|
|
||||||
end
|
|
||||||
return ipList
|
|
||||||
else
|
|
||||||
return "—"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
track_method = mwan_interface:option(DummyValue, "track_method", translate("Tracking method"))
|
track_method = mwan_interface:option(DummyValue, "track_method", translate("Tracking method"))
|
||||||
track_method.rawhtml = true
|
track_method.rawhtml = true
|
||||||
function track_method.cfgvalue(self, s)
|
function track_method.cfgvalue(self, s)
|
||||||
|
local tracked = self.map:get(s, "track_ip")
|
||||||
if tracked then
|
if tracked then
|
||||||
return self.map:get(s, "track_method") or "—"
|
return self.map:get(s, "track_method") or "—"
|
||||||
else
|
else
|
||||||
|
@ -165,6 +150,7 @@ track_method = mwan_interface:option(DummyValue, "track_method", translate("Trac
|
||||||
reliability = mwan_interface:option(DummyValue, "reliability", translate("Tracking reliability"))
|
reliability = mwan_interface:option(DummyValue, "reliability", translate("Tracking reliability"))
|
||||||
reliability.rawhtml = true
|
reliability.rawhtml = true
|
||||||
function reliability.cfgvalue(self, s)
|
function reliability.cfgvalue(self, s)
|
||||||
|
local tracked = self.map:get(s, "track_ip")
|
||||||
if tracked then
|
if tracked then
|
||||||
return self.map:get(s, "reliability") or "—"
|
return self.map:get(s, "reliability") or "—"
|
||||||
else
|
else
|
||||||
|
@ -172,34 +158,10 @@ reliability = mwan_interface:option(DummyValue, "reliability", translate("Tracki
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
count = mwan_interface:option(DummyValue, "count", translate("Ping count"))
|
|
||||||
count.rawhtml = true
|
|
||||||
function count.cfgvalue(self, s)
|
|
||||||
if tracked then
|
|
||||||
return self.map:get(s, "count") or "—"
|
|
||||||
else
|
|
||||||
return "—"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
timeout = mwan_interface:option(DummyValue, "timeout", translate("Ping timeout"))
|
|
||||||
timeout.rawhtml = true
|
|
||||||
function timeout.cfgvalue(self, s)
|
|
||||||
if tracked then
|
|
||||||
local timeoutValue = self.map:get(s, "timeout")
|
|
||||||
if timeoutValue then
|
|
||||||
return timeoutValue .. "s"
|
|
||||||
else
|
|
||||||
return "—"
|
|
||||||
end
|
|
||||||
else
|
|
||||||
return "—"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
interval = mwan_interface:option(DummyValue, "interval", translate("Ping interval"))
|
interval = mwan_interface:option(DummyValue, "interval", translate("Ping interval"))
|
||||||
interval.rawhtml = true
|
interval.rawhtml = true
|
||||||
function interval.cfgvalue(self, s)
|
function interval.cfgvalue(self, s)
|
||||||
|
local tracked = self.map:get(s, "track_ip")
|
||||||
if tracked then
|
if tracked then
|
||||||
local intervalValue = self.map:get(s, "interval")
|
local intervalValue = self.map:get(s, "interval")
|
||||||
if intervalValue then
|
if intervalValue then
|
||||||
|
@ -215,6 +177,7 @@ interval = mwan_interface:option(DummyValue, "interval", translate("Ping interva
|
||||||
down = mwan_interface:option(DummyValue, "down", translate("Interface down"))
|
down = mwan_interface:option(DummyValue, "down", translate("Interface down"))
|
||||||
down.rawhtml = true
|
down.rawhtml = true
|
||||||
function down.cfgvalue(self, s)
|
function down.cfgvalue(self, s)
|
||||||
|
local tracked = self.map:get(s, "track_ip")
|
||||||
if tracked then
|
if tracked then
|
||||||
return self.map:get(s, "down") or "—"
|
return self.map:get(s, "down") or "—"
|
||||||
else
|
else
|
||||||
|
@ -225,6 +188,7 @@ down = mwan_interface:option(DummyValue, "down", translate("Interface down"))
|
||||||
up = mwan_interface:option(DummyValue, "up", translate("Interface up"))
|
up = mwan_interface:option(DummyValue, "up", translate("Interface up"))
|
||||||
up.rawhtml = true
|
up.rawhtml = true
|
||||||
function up.cfgvalue(self, s)
|
function up.cfgvalue(self, s)
|
||||||
|
local tracked = self.map:get(s, "track_ip")
|
||||||
if tracked then
|
if tracked then
|
||||||
return self.map:get(s, "up") or "—"
|
return self.map:get(s, "up") or "—"
|
||||||
else
|
else
|
||||||
|
@ -235,9 +199,10 @@ up = mwan_interface:option(DummyValue, "up", translate("Interface up"))
|
||||||
metric = mwan_interface:option(DummyValue, "metric", translate("Metric"))
|
metric = mwan_interface:option(DummyValue, "metric", translate("Metric"))
|
||||||
metric.rawhtml = true
|
metric.rawhtml = true
|
||||||
function metric.cfgvalue(self, s)
|
function metric.cfgvalue(self, s)
|
||||||
local metricValue = sys.exec("uci -p /var/state get network." .. s .. ".metric")
|
local uci = uci.cursor(nil, "/var/state")
|
||||||
if metricValue ~= "" then
|
local metric = uci:get("network", s, "metric")
|
||||||
return metricValue
|
if metric then
|
||||||
|
return metric
|
||||||
else
|
else
|
||||||
return "—"
|
return "—"
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue