summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-mod-admin-full/luasrc
diff options
context:
space:
mode:
Diffstat (limited to 'modules/luci-mod-admin-full/luasrc')
-rw-r--r--modules/luci-mod-admin-full/luasrc/controller/admin/network.lua2
-rw-r--r--modules/luci-mod-admin-full/luasrc/controller/admin/system.lua13
-rw-r--r--modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/dhcp.lua48
-rw-r--r--modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/ifaces.lua5
-rw-r--r--modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/network.lua43
-rw-r--r--modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/vlan.lua67
-rw-r--r--modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/wifi.lua51
-rw-r--r--modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/wifi_add.lua6
-rw-r--r--modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/crontab.lua2
-rw-r--r--modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/system.lua8
-rw-r--r--modules/luci-mod-admin-full/luasrc/view/admin_network/diagnostics.htm10
-rw-r--r--modules/luci-mod-admin-full/luasrc/view/admin_network/lease_status.htm16
-rw-r--r--modules/luci-mod-admin-full/luasrc/view/admin_network/switch_status.htm5
-rw-r--r--modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_overview.htm2
-rw-r--r--modules/luci-mod-admin-full/luasrc/view/admin_status/index.htm62
-rw-r--r--modules/luci-mod-admin-full/luasrc/view/admin_status/iptables.htm10
-rw-r--r--modules/luci-mod-admin-full/luasrc/view/admin_system/upgrade.htm4
17 files changed, 287 insertions, 67 deletions
diff --git a/modules/luci-mod-admin-full/luasrc/controller/admin/network.lua b/modules/luci-mod-admin-full/luasrc/controller/admin/network.lua
index aa533cb70b..3b5f3eb8de 100644
--- a/modules/luci-mod-admin-full/luasrc/controller/admin/network.lua
+++ b/modules/luci-mod-admin-full/luasrc/controller/admin/network.lua
@@ -61,7 +61,7 @@ function index()
page = entry({"admin", "network", "wireless_shutdown"}, post("wifi_shutdown"), nil)
page.leaf = true
- page = entry({"admin", "network", "wireless"}, arcombine(template("admin_network/wifi_overview"), cbi("admin_network/wifi")), _("Wifi"), 15)
+ page = entry({"admin", "network", "wireless"}, arcombine(template("admin_network/wifi_overview"), cbi("admin_network/wifi")), _("Wireless"), 15)
page.leaf = true
page.subindex = true
diff --git a/modules/luci-mod-admin-full/luasrc/controller/admin/system.lua b/modules/luci-mod-admin-full/luasrc/controller/admin/system.lua
index cbba48cc25..cf8cfb5d2d 100644
--- a/modules/luci-mod-admin-full/luasrc/controller/admin/system.lua
+++ b/modules/luci-mod-admin-full/luasrc/controller/admin/system.lua
@@ -21,7 +21,7 @@ function index()
entry({"admin", "system", "startup"}, form("admin_system/startup"), _("Startup"), 45)
entry({"admin", "system", "crontab"}, form("admin_system/crontab"), _("Scheduled Tasks"), 46)
- if fs.access("/sbin/block") then
+ if fs.access("/sbin/block") and fs.access("/etc/config/fstab") then
entry({"admin", "system", "fstab"}, cbi("admin_system/fstab"), _("Mount Points"), 50)
entry({"admin", "system", "fstab", "mount"}, cbi("admin_system/fstab/mount"), nil).leaf = true
entry({"admin", "system", "fstab", "swap"}, cbi("admin_system/fstab/swap"), nil).leaf = true
@@ -185,12 +185,16 @@ local function image_checksum(image)
return (luci.sys.exec("md5sum %q" % image):match("^([^%s]+)"))
end
+local function image_sha256_checksum(image)
+ return (luci.sys.exec("sha256sum %q" % image):match("^([^%s]+)"))
+end
+
local function supports_sysupgrade()
return nixio.fs.access("/lib/upgrade/platform.sh")
end
local function supports_reset()
- return (os.execute([[grep -sq '"rootfs_data"' /proc/mtd]]) == 0)
+ return (os.execute([[grep -sqE '"rootfs_data"|"ubi"' /proc/mtd]]) == 0)
end
local function storage_size()
@@ -268,6 +272,7 @@ function action_sysupgrade()
if image_supported(image_tmp) then
luci.template.render("admin_system/upgrade", {
checksum = image_checksum(image_tmp),
+ sha256ch = image_sha256_checksum(image_tmp),
storage = storage_size(),
size = (fs.stat(image_tmp, "size") or 0),
keep = (not not http.formvalue("keep"))
@@ -290,7 +295,7 @@ function action_sysupgrade()
msg = luci.i18n.translate("The system is flashing now.<br /> DO NOT POWER OFF THE DEVICE!<br /> Wait a few minutes before you try to reconnect. It might be necessary to renew the address of your computer to reach the device again, depending on your settings."),
addr = (#keep > 0) and "192.168.1.1" or nil
})
- fork_exec("killall dropbear uhttpd; sleep 1; /sbin/sysupgrade %s %q" %{ keep, image_tmp })
+ fork_exec("sleep 1; killall dropbear uhttpd; sleep 1; /sbin/sysupgrade %s %q" %{ keep, image_tmp })
end
end
@@ -351,7 +356,7 @@ function action_reset()
addr = "192.168.1.1"
})
- fork_exec("killall dropbear uhttpd; sleep 1; mtd -r erase rootfs_data")
+ fork_exec("sleep 1; killall dropbear uhttpd; sleep 1; jffs2reset -y && reboot")
return
end
diff --git a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/dhcp.lua b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/dhcp.lua
index ff9438ae71..10636a491a 100644
--- a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/dhcp.lua
+++ b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/dhcp.lua
@@ -2,6 +2,8 @@
-- Licensed to the public under the Apache License 2.0.
local ipc = require "luci.ip"
+local o
+require "luci.util"
m = Map("dhcp", translate("DHCP and DNS"),
translate("Dnsmasq is a combined <abbr title=\"Dynamic Host Configuration Protocol" ..
@@ -56,6 +58,15 @@ s:taboption("files", Flag, "nohosts",
s:taboption("files", DynamicList, "addnhosts",
translate("Additional Hosts files")).optional = true
+qu = s:taboption("advanced", Flag, "quietdhcp",
+ translate("Suppress logging"),
+ translate("Suppress logging of the routine operation of these protocols"))
+qu.optional = true
+
+se = s:taboption("advanced", Flag, "sequential_ip",
+ translate("Allocate IP sequentially"),
+ translate("Allocate IP addresses sequentially, starting from the lowest available address"))
+se.optional = true
s:taboption("advanced", Flag, "boguspriv",
translate("Filter private"),
@@ -70,6 +81,19 @@ s:taboption("advanced", Flag, "localise_queries",
translate("Localise queries"),
translate("Localise hostname depending on the requesting subnet if multiple IPs are available"))
+local have_dnssec_support = luci.util.checklib("/usr/sbin/dnsmasq", "libhogweed.so")
+
+if have_dnssec_support then
+ o = s:taboption("advanced", Flag, "dnssec",
+ translate("DNSSEC"))
+ o.optional = true
+
+ o = s:taboption("advanced", Flag, "dnsseccheckunsigned",
+ translate("DNSSEC check unsigned"),
+ translate("Requires upstream supports DNSSEC; verify unsigned domain responses really come from unsigned domains"))
+ o.optional = true
+end
+
s:taboption("general", Value, "local",
translate("Local server"),
translate("Local domain specification. Names matching this domain are never forwarded and are resolved from DHCP or hosts files only"))
@@ -133,6 +157,7 @@ rl:depends("rebind_protection", "1")
rd = s:taboption("general", DynamicList, "rebind_domain",
translate("Domain whitelist"),
translate("List of domains to allow RFC1918 responses for"))
+rd.optional = true
rd:depends("rebind_protection", "1")
rd.datatype = "host(1)"
@@ -206,6 +231,29 @@ db.optional = true
db:depends("enable_tftp", "1")
db.placeholder = "pxelinux.0"
+o = s:taboption("general", Flag, "localservice",
+ translate("Local Service Only"),
+ translate("Limit DNS service to subnets interfaces on which we are serving DNS."))
+o.optional = false
+o.rmempty = false
+
+o = s:taboption("general", Flag, "nonwildcard",
+ translate("Non-wildcard"),
+ translate("Bind only to specific interfaces rather than wildcard address."))
+o.optional = false
+o.rmempty = false
+
+o = s:taboption("general", DynamicList, "interface",
+ translate("Listen Interfaces"),
+ translate("Limit listening to these interfaces, and loopback."))
+o.optional = true
+o:depends("nonwildcard", true)
+
+o = s:taboption("general", DynamicList, "notinterface",
+ translate("Exclude interfaces"),
+ translate("Prevent listening on these interfaces."))
+o.optional = true
+o:depends("nonwildcard", true)
m:section(SimpleSection).template = "admin_network/lease_status"
diff --git a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/ifaces.lua b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/ifaces.lua
index 2b6ed50569..16a104494a 100644
--- a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/ifaces.lua
+++ b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/ifaces.lua
@@ -492,8 +492,9 @@ if has_dnsmasq and net:proto() == "static" then
o:value("relay", translate("relay mode"))
o:value("hybrid", translate("hybrid mode"))
- o = s:taboption("ipv6", ListValue, "ra_management", translate("DHCPv6-Mode"))
- o:value("", translate("stateless"))
+ o = s:taboption("ipv6", ListValue, "ra_management", translate("DHCPv6-Mode"),
+ translate("Default is stateless + stateful"))
+ o:value("0", translate("stateless"))
o:value("1", translate("stateless + stateful"))
o:value("2", translate("stateful-only"))
o:depends("dhcpv6", "server")
diff --git a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/network.lua b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/network.lua
index 2be88fcf80..385e1141ec 100644
--- a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/network.lua
+++ b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/network.lua
@@ -8,6 +8,49 @@ m = Map("network", translate("Interfaces"))
m.pageaction = false
m:section(SimpleSection).template = "admin_network/iface_overview"
+if fs.access("/etc/init.d/dsl_control") then
+ dsl = m:section(TypedSection, "dsl", translate("DSL"))
+
+ dsl.anonymous = true
+
+ annex = dsl:option(ListValue, "annex", translate("Annex"))
+ annex:value("a", translate("Annex A + L + M (all)"))
+ annex:value("b", translate("Annex B (all)"))
+ annex:value("j", translate("Annex J (all)"))
+ annex:value("m", translate("Annex M (all)"))
+ annex:value("bdmt", translate("Annex B G.992.1"))
+ annex:value("b2", translate("Annex B G.992.3"))
+ annex:value("b2p", translate("Annex B G.992.5"))
+ annex:value("at1", translate("ANSI T1.413"))
+ annex:value("admt", translate("Annex A G.992.1"))
+ annex:value("alite", translate("Annex A G.992.2"))
+ annex:value("a2", translate("Annex A G.992.3"))
+ annex:value("a2p", translate("Annex A G.992.5"))
+ annex:value("l", translate("Annex L G.992.3 POTS 1"))
+ annex:value("m2", translate("Annex M G.992.3"))
+ annex:value("m2p", translate("Annex M G.992.5"))
+
+ tone = dsl:option(ListValue, "tone", translate("Tone"))
+ tone:value("", translate("auto"))
+ tone:value("a", translate("A43C + J43 + A43"))
+ tone:value("av", translate("A43C + J43 + A43 + V43"))
+ tone:value("b", translate("B43 + B43C"))
+ tone:value("bv", translate("B43 + B43C + V43"))
+
+ xfer_mode = dsl:option(ListValue, "xfer_mode", translate("Encapsulation mode"))
+ xfer_mode:value("atm", translate("ATM (Asynchronous Transfer Mode)"))
+ xfer_mode:value("ptm", translate("PTM/EFM (Packet Transfer Mode)"))
+
+ line_mode = dsl:option(ListValue, "line_mode", translate("DSL line mode"))
+ line_mode:value("", translate("auto"))
+ line_mode:value("adsl", translate("ADSL"))
+ line_mode:value("vdsl", translate("VDSL"))
+
+ firmware = dsl:option(Value, "firmware", translate("Firmware File"))
+
+ m.pageaction = true
+end
+
-- Show ATM bridge section if we have the capabilities
if fs.access("/usr/sbin/br2684ctl") then
atm = m:section(TypedSection, "atm-bridge", translate("ATM Bridges"),
diff --git a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/vlan.lua b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/vlan.lua
index ce3c3ef325..902767c903 100644
--- a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/vlan.lua
+++ b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/vlan.lua
@@ -5,8 +5,13 @@
m = Map("network", translate("Switch"), translate("The network ports on this device can be combined to several <abbr title=\"Virtual Local Area Network\">VLAN</abbr>s in which computers can communicate directly with each other. <abbr title=\"Virtual Local Area Network\">VLAN</abbr>s are often used to separate different network segments. Often there is by default one Uplink port for a connection to the next greater network like the internet and other ports for a local network."))
local fs = require "nixio.fs"
+local nw = require "luci.model.network"
local switches = { }
+nw.init(m.uci)
+
+local topologies = nw:get_switch_topologies() or {}
+
m.uci:foreach("network", "switch",
function(x)
local sid = x['.name']
@@ -19,12 +24,26 @@ m.uci:foreach("network", "switch",
local min_vid = 0
local max_vid = 16
local num_vlans = 16
- local cpu_port = tonumber(fs.readfile("/proc/switch/eth0/cpuport") or 5)
- local num_ports = cpu_port + 1
local switch_title
local enable_vlan4k = false
+ local topo = topologies[switch_name]
+
+ if not topo then
+ m.message = translatef("Switch %q has an unknown topology - the VLAN settings might not be accurate.", switch_name)
+ topo = {
+ ports = {
+ { num = 0, label = "Port 1" },
+ { num = 1, label = "Port 2" },
+ { num = 2, label = "Port 3" },
+ { num = 3, label = "Port 4" },
+ { num = 4, label = "Port 5" },
+ { num = 5, label = "CPU (eth0)", tagged = false }
+ }
+ }
+ end
+
-- Parse some common switch properties from swconfig help output.
local swc = io.popen("swconfig dev %q help 2>/dev/null" % switch_name)
if swc then
@@ -45,12 +64,7 @@ m.uci:foreach("network", "switch",
elseif line:match("cpu @") then
switch_title = line:match("^switch%d: %w+%((.-)%)")
- num_ports, cpu_port, num_vlans =
- line:match("ports: (%d+) %(cpu @ (%d+)%), vlans: (%d+)")
-
- num_ports = tonumber(num_ports) or 6
- num_vlans = tonumber(num_vlans) or 16
- cpu_port = tonumber(cpu_port) or 5
+ num_vlans = tonumber(line:match("vlans: (%d+)")) or 16
min_vid = 1
elseif line:match(": pvid") or line:match(": tag") or line:match(": vid") then
@@ -113,14 +127,10 @@ m.uci:foreach("network", "switch",
mp:depends("enable_mirror_tx", "1")
mp:depends("enable_mirror_rx", "1")
- local pt
- for pt = 0, num_ports - 1 do
- local name
-
- name = (pt == cpu_port) and translate("CPU") or translatef("Port %d", pt)
-
- sp:value(pt, name)
- mp:value(pt, name)
+ local _, pt
+ for _, pt in ipairs(topo.ports) do
+ sp:value(pt.num, pt.label)
+ mp:value(pt.num, pt.label)
end
end
@@ -211,9 +221,9 @@ m.uci:foreach("network", "switch",
if value == "u" then
if not untagged[self.option] then
untagged[self.option] = true
- elseif min_vid > 0 or tonumber(self.option) ~= cpu_port then -- enable multiple untagged cpu ports due to weird broadcom default setup
+ else
return nil,
- translatef("Port %d is untagged in multiple VLANs!", tonumber(self.option) + 1)
+ translatef("%s is untagged in multiple VLANs!", self.title)
end
end
return value
@@ -276,20 +286,16 @@ m.uci:foreach("network", "switch",
or m:get(section, "vlan")
end
- -- Build per-port off/untagged/tagged choice lists.
- local pt
- for pt = 0, num_ports - 1 do
- local title
- if pt == cpu_port then
- title = translate("CPU")
- else
- title = translatef("Port %d", pt)
- end
-
- local po = s:option(ListValue, tostring(pt), title)
+ local _, pt
+ for _, pt in ipairs(topo.ports) do
+ local po = s:option(ListValue, tostring(pt.num), pt.label, '<div id="portstatus-%s-%d"></div>' %{ switch_name, pt.num })
po:value("", translate("off"))
- po:value("u", translate("untagged"))
+
+ if not pt.tagged then
+ po:value("u", translate("untagged"))
+ end
+
po:value("t", translate("tagged"))
po.cfgvalue = portvalue
@@ -299,6 +305,7 @@ m.uci:foreach("network", "switch",
port_opts[#port_opts+1] = po
end
+ table.sort(port_opts, function(a, b) return a.option < b.option end)
switches[#switches+1] = switch_name
end
)
diff --git a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/wifi.lua b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/wifi.lua
index 9db42e3c4e..2dff4ddc81 100644
--- a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/wifi.lua
+++ b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/wifi.lua
@@ -313,6 +313,36 @@ if hwtype == "broadcom" then
%{ p.display_dbm, p.display_mw })
end
+ mode = s:taboption("advanced", ListValue, "hwmode", translate("Band"))
+ if hw_modes.b then
+ mode:value("11b", "2.4GHz (802.11b)")
+ if hw_modes.g then
+ mode:value("11bg", "2.4GHz (802.11b+g)")
+ end
+ end
+ if hw_modes.g then
+ mode:value("11g", "2.4GHz (802.11g)")
+ mode:value("11gst", "2.4GHz (802.11g + Turbo)")
+ mode:value("11lrs", "2.4GHz (802.11g Limited Rate Support)")
+ end
+ if hw_modes.a then mode:value("11a", "5GHz (802.11a)") end
+ if hw_modes.n then
+ if hw_modes.g then
+ mode:value("11ng", "2.4GHz (802.11g+n)")
+ mode:value("11n", "2.4GHz (802.11n)")
+ end
+ if hw_modes.a then
+ mode:value("11na", "5GHz (802.11a+n)")
+ mode:value("11n", "5GHz (802.11n)")
+ end
+ htmode = s:taboption("advanced", ListValue, "htmode", translate("HT mode (802.11n)"))
+ htmode:depends("hwmode", "11ng")
+ htmode:depends("hwmode", "11na")
+ htmode:depends("hwmode", "11n")
+ htmode:value("HT20", "20MHz")
+ htmode:value("HT40", "40MHz")
+ end
+
ant1 = s:taboption("advanced", ListValue, "txantenna", translate("Transmitter Antenna"))
ant1.widget = "radio"
ant1:depends("diversity", "")
@@ -475,6 +505,9 @@ if hwtype == "mac80211" then
wmm:depends({mode="ap"})
wmm:depends({mode="ap-wds"})
wmm.default = wmm.enabled
+
+ ifname = s:taboption("advanced", Value, "ifname", translate("Interface name"), translate("Override default interface name"))
+ ifname.optional = true
end
@@ -964,6 +997,24 @@ if hwtype == "atheros" or hwtype == "mac80211" or hwtype == "prism2" then
identity:depends({mode="sta-wds", eap_type="tls", encryption="wpa2"})
identity:depends({mode="sta-wds", eap_type="tls", encryption="wpa"})
+ anonymous_identity = s:taboption("encryption", Value, "anonymous_identity", translate("Anonymous Identity"))
+ anonymous_identity:depends({mode="sta", eap_type="fast", encryption="wpa2"})
+ anonymous_identity:depends({mode="sta", eap_type="fast", encryption="wpa"})
+ anonymous_identity:depends({mode="sta", eap_type="peap", encryption="wpa2"})
+ anonymous_identity:depends({mode="sta", eap_type="peap", encryption="wpa"})
+ anonymous_identity:depends({mode="sta", eap_type="ttls", encryption="wpa2"})
+ anonymous_identity:depends({mode="sta", eap_type="ttls", encryption="wpa"})
+ anonymous_identity:depends({mode="sta-wds", eap_type="fast", encryption="wpa2"})
+ anonymous_identity:depends({mode="sta-wds", eap_type="fast", encryption="wpa"})
+ anonymous_identity:depends({mode="sta-wds", eap_type="peap", encryption="wpa2"})
+ anonymous_identity:depends({mode="sta-wds", eap_type="peap", encryption="wpa"})
+ anonymous_identity:depends({mode="sta-wds", eap_type="ttls", encryption="wpa2"})
+ anonymous_identity:depends({mode="sta-wds", eap_type="ttls", encryption="wpa"})
+ anonymous_identity:depends({mode="sta", eap_type="tls", encryption="wpa2"})
+ anonymous_identity:depends({mode="sta", eap_type="tls", encryption="wpa"})
+ anonymous_identity:depends({mode="sta-wds", eap_type="tls", encryption="wpa2"})
+ anonymous_identity:depends({mode="sta-wds", eap_type="tls", encryption="wpa"})
+
password = s:taboption("encryption", Value, "password", translate("Password"))
password:depends({mode="sta", eap_type="fast", encryption="wpa2"})
password:depends({mode="sta", eap_type="fast", encryption="wpa"})
diff --git a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/wifi_add.lua b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/wifi_add.lua
index 96b8b4d740..05b27a9f0c 100644
--- a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/wifi_add.lua
+++ b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/wifi_add.lua
@@ -16,7 +16,7 @@ if not iw then
return
end
-m = SimpleForm("network", translate("Join Network: Settings"))
+m = SimpleForm("network", translate("Joining Network: %q", http.formvalue("join")))
m.cancel = translate("Back to scan results")
m.reset = false
@@ -44,9 +44,9 @@ m.hidden = {
if iw and iw.mbssid_support then
replace = m:field(Flag, "replace", translate("Replace wireless configuration"),
- translate("An additional network will be created if you leave this unchecked."))
+ translate("An additional network will be created if you leave this checked."))
- function replace.cfgvalue() return "1" end
+ function replace.cfgvalue() return "0" end
else
replace = m:field(DummyValue, "replace", translate("Replace wireless configuration"))
replace.default = translate("The hardware is not multi-SSID capable and the existing " ..
diff --git a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/crontab.lua b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/crontab.lua
index bef9651ea1..ea92eb98de 100644
--- a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/crontab.lua
+++ b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/crontab.lua
@@ -19,6 +19,8 @@ function f.handle(self, state, data)
if data.crons then
fs.writefile(cronfile, data.crons:gsub("\r\n", "\n"))
luci.sys.call("/usr/bin/crontab %q" % cronfile)
+ else
+ fs.writefile(cronfile, "")
end
end
return true
diff --git a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/system.lua b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/system.lua
index 2874b5607e..c7fdfcddba 100644
--- a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/system.lua
+++ b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/system.lua
@@ -80,6 +80,14 @@ o.optional = true
o.placeholder = 514
o.datatype = "port"
+o = s:taboption("logging", ListValue, "log_proto", translate("External system log server protocol"))
+o:value("udp", "UDP")
+o:value("tcp", "TCP")
+
+o = s:taboption("logging", Value, "log_file", translate("Write system log to file"))
+o.optional = true
+o.placeholder = "/tmp/system.log"
+
o = s:taboption("logging", ListValue, "conloglevel", translate("Log output level"))
o:value(8, translate("Debug"))
o:value(7, translate("Info"))
diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_network/diagnostics.htm b/modules/luci-mod-admin-full/luasrc/view/admin_network/diagnostics.htm
index 685082a335..f4adb26069 100644
--- a/modules/luci-mod-admin-full/luasrc/view/admin_network/diagnostics.htm
+++ b/modules/luci-mod-admin-full/luasrc/view/admin_network/diagnostics.htm
@@ -9,6 +9,10 @@
local fs = require "nixio.fs"
local has_ping6 = fs.access("/bin/ping6") or fs.access("/usr/bin/ping6")
local has_traceroute6 = fs.access("/usr/bin/traceroute6")
+
+local dns_host = luci.config.diag and luci.config.diag.dns or "dev.openwrt.org"
+local ping_host = luci.config.diag and luci.config.diag.ping or "dev.openwrt.org"
+local route_host = luci.config.diag and luci.config.diag.route or "dev.openwrt.org"
%>
<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
@@ -63,7 +67,7 @@ local has_traceroute6 = fs.access("/usr/bin/traceroute6")
<br />
<div style="width:30%; float:left">
- <input style="margin: 5px 0" type="text" value="dev.openwrt.org" name="ping" /><br />
+ <input style="margin: 5px 0" type="text" value="<%=ping_host%>" name="ping" /><br />
<% if has_ping6 then %>
<select name="ping_proto" style="width:auto">
<option value="" selected="selected"><%:IPv4%></option>
@@ -76,7 +80,7 @@ local has_traceroute6 = fs.access("/usr/bin/traceroute6")
</div>
<div style="width:33%; float:left">
- <input style="margin: 5px 0" type="text" value="dev.openwrt.org" name="traceroute" /><br />
+ <input style="margin: 5px 0" type="text" value="<%=route_host%>" name="traceroute" /><br />
<% if has_traceroute6 then %>
<select name="traceroute_proto" style="width:auto">
<option value="" selected="selected"><%:IPv4%></option>
@@ -93,7 +97,7 @@ local has_traceroute6 = fs.access("/usr/bin/traceroute6")
</div>
<div style="width:33%; float:left;">
- <input style="margin: 5px 0" type="text" value="dev.openwrt.org" name="nslookup" /><br />
+ <input style="margin: 5px 0" type="text" value="<%=dns_host%>" name="nslookup" /><br />
<input type="button" value="<%:Nslookup%>" class="cbi-button cbi-button-apply" onclick="update_status(this.form.nslookup)" />
</div>
diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_network/lease_status.htm b/modules/luci-mod-admin-full/luasrc/view/admin_network/lease_status.htm
index f7787dd1ea..b4baedff28 100644
--- a/modules/luci-mod-admin-full/luasrc/view/admin_network/lease_status.htm
+++ b/modules/luci-mod-admin-full/luasrc/view/admin_network/lease_status.htm
@@ -27,14 +27,12 @@
{
var timestr;
- if (st[0][i].expires <= 0)
- {
+ if (st[0][i].expires === false)
+ timestr = '<em><%:unlimited%></em>';
+ else if (st[0][i].expires <= 0)
timestr = '<em><%:expired%></em>';
- }
else
- {
timestr = String.format('%t', st[0][i].expires);
- }
var tr = tb.insertRow(-1);
tr.className = 'cbi-section-table-row cbi-rowstyle-' + ((i % 2) + 1);
@@ -69,14 +67,12 @@
{
var timestr;
- if (st[1][i].expires <= 0)
- {
+ if (st[1][i].expires === false)
+ timestr = '<em><%:unlimited%></em>';
+ else if (st[1][i].expires <= 0)
timestr = '<em><%:expired%></em>';
- }
else
- {
timestr = String.format('%t', st[1][i].expires);
- }
var tr = tb6.insertRow(-1);
tr.className = 'cbi-section-table-row cbi-rowstyle-' + ((i % 2) + 1);
diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_network/switch_status.htm b/modules/luci-mod-admin-full/luasrc/view/admin_network/switch_status.htm
index 53c35ae59c..96fbffdb02 100644
--- a/modules/luci-mod-admin-full/luasrc/view/admin_network/switch_status.htm
+++ b/modules/luci-mod-admin-full/luasrc/view/admin_network/switch_status.htm
@@ -15,7 +15,10 @@
for (var j = 0; j < ports.length; j++)
{
- var th = th0.parentNode.parentNode.childNodes[j+1];
+ var th = document.getElementById('portstatus-' + switches[i] + '-' + j);
+
+ if (!th)
+ continue;
if (ports[j].link)
{
diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_overview.htm b/modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_overview.htm
index 1df6b28846..9c351d3933 100644
--- a/modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_overview.htm
+++ b/modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_overview.htm
@@ -427,7 +427,7 @@
<td class="cbi-value-field" style="width:310px;text-align:right">
<input id="<%=net:id()%>-iw-toggle" type="button" class="cbi-button cbi-button-reload" style="width:100px" onclick="wifi_shutdown('<%=net:id()%>', this)" title="<%:Delete this network%>" value="<%:Enable%>" />
<input type="button" class="cbi-button cbi-button-edit" style="width:100px" onclick="location.href='<%=net:adminlink()%>'" title="<%:Edit this network%>" value="<%:Edit%>" />
- <input type="button" class="cbi-button cbi-button-remove" style="width:100px" onclick="wifi_delete('<%=net:ifname()%>')" title="<%:Delete this network%>" value="<%:Remove%>" />
+ <input type="button" class="cbi-button cbi-button-remove" style="width:100px" onclick="wifi_delete('<%=net:id()%>')" title="<%:Delete this network%>" value="<%:Remove%>" />
</td>
</tr>
<% end %>
diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_status/index.htm b/modules/luci-mod-admin-full/luasrc/view/admin_status/index.htm
index 8bfc61b99b..8976e30cba 100644
--- a/modules/luci-mod-admin-full/luasrc/view/admin_status/index.htm
+++ b/modules/luci-mod-admin-full/luasrc/view/admin_status/index.htm
@@ -276,20 +276,56 @@
var s = String.format(
'<strong><%:Status%>: </strong>%s<br />' +
'<strong><%:Line State%>: </strong>%s [0x%x]<br />' +
- '<strong><%:Line Speed%>: </strong>%s/s / %s/s<br />' +
- '<strong><%:Line Attenuation%>: </strong>%s dB / %s dB<br />' +
- '<strong><%:Noise Margin%>: </strong>%s dB / %s dB<br />',
+ '<strong><%:Line Mode%>: </strong>%s<br />' +
+ '<strong><%:Annex%>: </strong>%s<br />' +
+ '<strong><%:Profile%>: </strong>%s<br />' +
+ '<strong><%:Data Rate%>: </strong>%s/s / %s/s<br />' +
+ '<strong><%:Max. Attainable Data Rate (ATTNDR)%>: </strong>%s/s / %s/s<br />' +
+ '<strong><%:Latency%>: </strong>%s / %s<br />' +
+ '<strong><%:Line Attenuation (LATN)%>: </strong>%s dB / %s dB<br />' +
+ '<strong><%:Signal Attenuation (SATN)%>: </strong>%s dB / %s dB<br />' +
+ '<strong><%:Noise Margin (SNR)%>: </strong>%s dB / %s dB<br />' +
+ '<strong><%:Aggregate Transmit Power(ACTATP)%>: </strong>%s dB / %s dB<br />' +
+ '<strong><%:Forward Error Correction Seconds (FECS)%>: </strong>%s / %s<br />' +
+ '<strong><%:Errored seconds (ES)%>: </strong>%s / %s<br />' +
+ '<strong><%:Severely Errored Seconds (SES)%>: </strong>%s / %s<br />' +
+ '<strong><%:Loss of Signal Seconds (LOSS)%>: </strong>%s / %s<br />' +
+ '<strong><%:Unavailable Seconds (UAS)%>: </strong>%s / %s<br />' +
+ '<strong><%:Header Error Code Errors (HEC)%>: </strong>%s / %s<br />' +
+ '<strong><%:Non Pre-emtive CRC errors (CRC_P)%>: </strong>%s / %s<br />' +
+ '<strong><%:Pre-emtive CRC errors (CRCP_P)%>: </strong>%s / %s<br />' +
+ '<strong><%:Line Uptime%>: </strong>%s<br />' +
+ '<strong><%:ATU-C System Vendor ID%>: </strong>%s<br />' +
+ '<strong><%:Power Management Mode%>: </strong>%s<br />',
info.dsl.line_state, info.dsl.line_state_detail,
info.dsl.line_state_num,
+ info.dsl.line_mode_s,
+ info.dsl.annex_s,
+ info.dsl.profile_s,
info.dsl.data_rate_down_s, info.dsl.data_rate_up_s,
+ info.dsl.max_data_rate_down_s, info.dsl.max_data_rate_up_s,
+ info.dsl.latency_num_down, info.dsl.latency_num_up,
info.dsl.line_attenuation_down, info.dsl.line_attenuation_up,
- info.dsl.noise_margin_down, info.dsl.noise_margin_up
+ info.dsl.signal_attenuation_down, info.dsl.signal_attenuation_up,
+ info.dsl.noise_margin_down, info.dsl.noise_margin_up,
+ info.dsl.actatp_down, info.dsl.actatp_up,
+ info.dsl.errors_fec_near, info.dsl.errors_fec_far,
+ info.dsl.errors_es_near, info.dsl.errors_es_far,
+ info.dsl.errors_ses_near, info.dsl.errors_ses_far,
+ info.dsl.errors_loss_near, info.dsl.errors_loss_far,
+ info.dsl.errors_uas_near, info.dsl.errors_uas_far,
+ info.dsl.errors_hec_near, info.dsl.errors_hec_far,
+ info.dsl.errors_crc_p_near, info.dsl.errors_crc_p_far,
+ info.dsl.errors_crcp_p_near, info.dsl.errors_crcp_p_far,
+ info.dsl.line_uptime_s,
+ info.dsl.atuc_vendor_id,
+ info.dsl.power_mode_s
);
dsl_s.innerHTML = String.format('<small>%s</small>', s);
dsl_i.innerHTML = String.format(
'<img src="<%=resource%>/icons/ethernet.png" />' +
- '<br /><small>ADSL</small>'
+ '<br /><small>DSL</small>'
);
<% end %>
@@ -305,7 +341,9 @@
{
var timestr;
- if (info.leases[i].expires <= 0)
+ if (info.leases[i].expires === false)
+ timestr = '<em><%:unlimited%></em>';
+ else if (info.leases[i].expires <= 0)
timestr = '<em><%:expired%></em>';
else
timestr = String.format('%t', info.leases[i].expires);
@@ -343,7 +381,9 @@
{
var timestr;
- if (info.leases6[i].expires <= 0)
+ if (info.leases6[i].expires === false)
+ timestr = '<em><%:unlimited%></em>';
+ else if (info.leases6[i].expires <= 0)
timestr = '<em><%:expired%></em>';
else
timestr = String.format('%t', info.leases6[i].expires);
@@ -435,7 +475,7 @@
'<strong><%:Bitrate%>:</strong> %s <%:Mbit/s%><br />',
icon, net.signal, net.noise,
net.quality,
- net.link, net.ssid,
+ net.link, net.ssid || '?',
net.mode,
net.channel, net.frequency,
net.bitrate || '?'
@@ -446,7 +486,7 @@
s += String.format(
'<strong><%:BSSID%>:</strong> %s<br />' +
'<strong><%:Encryption%>:</strong> %s',
- net.bssid,
+ net.bssid || '?',
net.encryption
);
}
@@ -707,9 +747,9 @@
<% if has_dsl then %>
<fieldset class="cbi-section">
- <legend><%:ADSL%></legend>
+ <legend><%:DSL%></legend>
<table width="100%" cellspacing="10">
- <tr><td width="33%" style="vertical-align:top"><%:ADSL Status%></td><td>
+ <tr><td width="33%" style="vertical-align:top"><%:DSL Status%></td><td>
<table><tr>
<td id="dsl_i" style="width:16px; text-align:center; padding:3px"><img src="<%=resource%>/icons/ethernet_disabled.png" /><br /><small>?</small></td>
<td id="dsl_s" style="vertical-align:middle; padding: 3px"><em><%:Collecting data...%></em></td>
diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_status/iptables.htm b/modules/luci-mod-admin-full/luasrc/view/admin_status/iptables.htm
index f49469a599..3f4b83b80b 100644
--- a/modules/luci-mod-admin-full/luasrc/view/admin_status/iptables.htm
+++ b/modules/luci-mod-admin-full/luasrc/view/admin_status/iptables.htm
@@ -9,6 +9,7 @@
require "luci.sys.iptparser"
local wba = require "luci.tools.webadmin"
local fs = require "nixio.fs"
+ local io = require "io"
local has_ip6tables = fs.access("/usr/sbin/ip6tables")
local mode = 4
@@ -47,6 +48,15 @@
local tables = { "Filter", "NAT", "Mangle", "Raw" }
if mode == 6 then
tables = { "Filter", "Mangle", "Raw" }
+ local ok, lines = pcall(io.lines, "/proc/net/ip6_tables_names")
+ if ok and lines then
+ local line
+ for line in lines do
+ if line == "nat" then
+ tables = { "Filter", "NAT", "Mangle", "Raw" }
+ end
+ end
+ end
end
-%>
diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_system/upgrade.htm b/modules/luci-mod-admin-full/luasrc/view/admin_system/upgrade.htm
index 5ca0398e13..7175248dbb 100644
--- a/modules/luci-mod-admin-full/luasrc/view/admin_system/upgrade.htm
+++ b/modules/luci-mod-admin-full/luasrc/view/admin_system/upgrade.htm
@@ -24,7 +24,9 @@
<fieldset class="cbi-section">
<ul>
- <li><%:Checksum%>: <code><%=checksum%></code></li>
+ <li><%:Checksum%><br />
+ <%:MD5%>: <code><%=checksum%></code><br />
+ <%:SHA256%>: <code><%=sha256ch%></code></li>
<li><%:Size%>: <%
local w = require "luci.tools.webadmin"
write(w.byte_format(size))