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.lua1
-rw-r--r--modules/luci-mod-admin-full/luasrc/controller/admin/status.lua6
-rw-r--r--modules/luci-mod-admin-full/luasrc/controller/admin/system.lua1
-rw-r--r--modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/routes.lua28
-rw-r--r--modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/wifi.lua47
-rw-r--r--modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/wifi_add.lua4
-rw-r--r--modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/admin.lua4
-rw-r--r--modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/fstab/mount.lua10
-rw-r--r--modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/leds.lua15
-rw-r--r--modules/luci-mod-admin-full/luasrc/view/admin_network/iface_overview.htm5
-rw-r--r--modules/luci-mod-admin-full/luasrc/view/admin_network/iface_status.htm5
-rw-r--r--modules/luci-mod-admin-full/luasrc/view/admin_status/index.htm43
-rw-r--r--modules/luci-mod-admin-full/luasrc/view/admin_system/flashops.htm4
13 files changed, 152 insertions, 21 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 3b5f3eb8de..2cb2108b9f 100644
--- a/modules/luci-mod-admin-full/luasrc/controller/admin/network.lua
+++ b/modules/luci-mod-admin-full/luasrc/controller/admin/network.lua
@@ -238,6 +238,7 @@ function iface_status(ifaces)
ipaddrs = net:ipaddrs(),
ip6addrs = net:ip6addrs(),
dnsaddrs = net:dnsaddrs(),
+ ip6prefix = net:ip6prefix(),
name = device:shortname(),
type = device:type(),
ifname = device:name(),
diff --git a/modules/luci-mod-admin-full/luasrc/controller/admin/status.lua b/modules/luci-mod-admin-full/luasrc/controller/admin/status.lua
index 24db1e4ff5..ad575e0d26 100644
--- a/modules/luci-mod-admin-full/luasrc/controller/admin/status.lua
+++ b/modules/luci-mod-admin-full/luasrc/controller/admin/status.lua
@@ -24,8 +24,10 @@ function index()
entry({"admin", "status", "realtime", "bandwidth"}, template("admin_status/bandwidth"), _("Traffic"), 2).leaf = true
entry({"admin", "status", "realtime", "bandwidth_status"}, call("action_bandwidth")).leaf = true
- entry({"admin", "status", "realtime", "wireless"}, template("admin_status/wireless"), _("Wireless"), 3).leaf = true
- entry({"admin", "status", "realtime", "wireless_status"}, call("action_wireless")).leaf = true
+ if nixio.fs.access("/etc/config/wireless") then
+ entry({"admin", "status", "realtime", "wireless"}, template("admin_status/wireless"), _("Wireless"), 3).leaf = true
+ entry({"admin", "status", "realtime", "wireless_status"}, call("action_wireless")).leaf = true
+ end
entry({"admin", "status", "realtime", "connections"}, template("admin_status/connections"), _("Connections"), 4).leaf = true
entry({"admin", "status", "realtime", "connections_status"}, call("action_connections")).leaf = 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 cf8cfb5d2d..5478afa3e6 100644
--- a/modules/luci-mod-admin-full/luasrc/controller/admin/system.lua
+++ b/modules/luci-mod-admin-full/luasrc/controller/admin/system.lua
@@ -52,6 +52,7 @@ function action_clock_status()
luci.sys.call("date -s '%04d-%02d-%02d %02d:%02d:%02d'" %{
date.year, date.month, date.day, date.hour, date.min, date.sec
})
+ luci.sys.call("/etc/init.d/sysfixtime restart")
end
end
diff --git a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/routes.lua b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/routes.lua
index ac02b156e9..1970f36a28 100644
--- a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/routes.lua
+++ b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/routes.lua
@@ -34,13 +34,27 @@ g.rmempty = true
metric = s:option(Value, "metric", translate("Metric"))
metric.placeholder = 0
metric.datatype = "range(0,255)"
+metric.size = 5
metric.rmempty = true
mtu = s:option(Value, "mtu", translate("MTU"))
mtu.placeholder = 1500
mtu.datatype = "range(64,9000)"
+mtu.size = 5
mtu.rmempty = true
+routetype = s:option(Value, "type", translate("Route type"))
+routetype:value("", "unicast")
+routetype:value("local", "local")
+routetype:value("broadcast", "broadcast")
+routetype:value("multicast", "multicast")
+routetype:value("unreachable", "unreachable")
+routetype:value("prohibit", "prohibit")
+routetype:value("blackhole", "blackhole")
+routetype:value("anycast", "anycast")
+routetype.default = ""
+routetype.rmempty = true
+
if fs.access("/proc/net/ipv6_route") then
s = m:section(TypedSection, "route6", translate("Static IPv6 Routes"))
s.addremove = true
@@ -62,12 +76,26 @@ if fs.access("/proc/net/ipv6_route") then
metric = s:option(Value, "metric", translate("Metric"))
metric.placeholder = 0
metric.datatype = "range(0,65535)" -- XXX: not sure
+ metric.size = 5
metric.rmempty = true
mtu = s:option(Value, "mtu", translate("MTU"))
mtu.placeholder = 1500
mtu.datatype = "range(64,9000)"
+ mtu.size = 5
mtu.rmempty = true
+
+ routetype = s:option(Value, "type", translate("Route type"))
+ routetype:value("", "unicast")
+ routetype:value("local", "local")
+ routetype:value("broadcast", "broadcast")
+ routetype:value("multicast", "multicast")
+ routetype:value("unreachable", "unreachable")
+ routetype:value("prohibit", "prohibit")
+ routetype:value("blackhole", "blackhole")
+ routetype:value("anycast", "anycast")
+ routetype.default = ""
+ routetype.rmempty = true
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 09763e8f14..afe0d662b7 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
@@ -42,6 +42,9 @@ end
-- wireless toggle was requested, commit and reload page
function m.parse(map)
+ local new_cc = m:formvalue("cbid.wireless.%s.country" % wdev:name())
+ local old_cc = m:get(wdev:name(), "country")
+
if m:formvalue("cbid.wireless.%s.__toggle" % wdev:name()) then
if wdev:get("disabled") == "1" or wnet:get("disabled") == "1" then
wnet:set("disabled", nil)
@@ -56,7 +59,14 @@ function m.parse(map)
luci.http.redirect(luci.dispatcher.build_url("admin/network/wireless", arg[1]))
return
end
+
Map.parse(map)
+
+ if m:get(wdev:name(), "type") == "mac80211" and new_cc and new_cc ~= old_cc then
+ luci.sys.call("iw reg set %q" % new_cc)
+ luci.http.redirect(luci.dispatcher.build_url("admin/network/wireless", arg[1]))
+ return
+ end
end
m.title = luci.util.pcdata(wnet:get_i18n())
@@ -94,7 +104,7 @@ local function txpower_current(pwr, list)
end
end
end
- return (list[#list] and list[#list].driver_dbm) or pwr or 0
+ return pwr or ""
end
local iw = luci.sys.wifi.getiwinfo(arg[1])
@@ -191,7 +201,7 @@ end
------------------- MAC80211 Device ------------------
if hwtype == "mac80211" then
- if #tx_power_list > 1 then
+ if #tx_power_list > 0 then
tp = s:taboption("general", ListValue,
"txpower", translate("Transmit Power"), "dBm")
tp.rmempty = true
@@ -200,6 +210,7 @@ if hwtype == "mac80211" then
return txpower_current(Value.cfgvalue(...), tx_power_list)
end
+ tp:value("", translate("auto"))
for _, p in ipairs(tx_power_list) do
tp:value(p.driver_dbm, "%i dBm (%i mW)"
%{ p.display_dbm, p.display_mw })
@@ -251,6 +262,7 @@ if hwtype == "atheros" then
return txpower_current(Value.cfgvalue(...), tx_power_list)
end
+ tp:value("", translate("auto"))
for _, p in ipairs(tx_power_list) do
tp:value(p.driver_dbm, "%i dBm (%i mW)"
%{ p.display_dbm, p.display_mw })
@@ -308,11 +320,42 @@ if hwtype == "broadcom" then
return txpower_current(Value.cfgvalue(...), tx_power_list)
end
+ tp:value("", translate("auto"))
for _, p in ipairs(tx_power_list) do
tp:value(p.driver_dbm, "%i dBm (%i mW)"
%{ 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", "")
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 05b27a9f0c..8277deb2f6 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("Joining Network: %q", http.formvalue("join")))
+m = SimpleForm("network", translatef("Joining Network: %q", http.formvalue("join")))
m.cancel = translate("Back to scan results")
m.reset = false
@@ -44,7 +44,7 @@ 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 checked."))
+ translate("Check this option to delete the existing networks from this radio."))
function replace.cfgvalue() return "0" end
else
diff --git a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/admin.lua b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/admin.lua
index 1e475640be..493a735bde 100644
--- a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/admin.lua
+++ b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/admin.lua
@@ -21,7 +21,7 @@ function s.cfgsections()
return { "_pass" }
end
-function m.on_commit(map)
+function m.parse(map)
local v1 = pw1:formvalue("_pass")
local v2 = pw2:formvalue("_pass")
@@ -36,6 +36,8 @@ function m.on_commit(map)
m.message = translate("Given password confirmation did not match, password not changed!")
end
end
+
+ Map.parse(map)
end
diff --git a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/fstab/mount.lua b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/fstab/mount.lua
index f5751673fd..a85872afad 100644
--- a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/fstab/mount.lua
+++ b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/fstab/mount.lua
@@ -56,6 +56,8 @@ mount:taboption("general", Flag, "enabled", translate("Enable this mount")).rmem
o = mount:taboption("general", Value, "uuid", translate("UUID"),
translate("If specified, mount the device by its UUID instead of a fixed device node"))
+o:value("", translate("-- match by uuid --"))
+
for i, d in ipairs(devices) do
if d.uuid and d.size then
o:value(d.uuid, "%s (%s, %d MB)" %{ d.uuid, d.dev, d.size })
@@ -64,12 +66,12 @@ for i, d in ipairs(devices) do
end
end
-o:value("", translate("-- match by label --"))
-
o = mount:taboption("general", Value, "label", translate("Label"),
translate("If specified, mount the device by the partition label instead of a fixed device node"))
+o:value("", translate("-- match by label --"))
+
o:depends("uuid", "")
for i, d in ipairs(devices) do
@@ -80,12 +82,12 @@ for i, d in ipairs(devices) do
end
end
-o:value("", translate("-- match by device --"))
-
o = mount:taboption("general", Value, "device", translate("Device"),
translate("The device file of the memory or partition (<abbr title=\"for example\">e.g.</abbr> <code>/dev/sda1</code>)"))
+o:value("", translate("-- match by device --"))
+
o:depends({ uuid = "", label = "" })
for i, d in ipairs(devices) do
diff --git a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/leds.lua b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/leds.lua
index 8d9bcb1371..4b6f397e6a 100644
--- a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/leds.lua
+++ b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/leds.lua
@@ -109,6 +109,13 @@ function usbdev.remove(self, section)
end
end
+
+usbport = s:option(MultiValue, "ports", translate("USB Ports"))
+usbport:depends("trigger", "usbport")
+usbport.rmempty = true
+usbport.widget = "checkbox"
+usbport.size = 1
+
for p in nixio.fs.glob("/sys/bus/usb/devices/[0-9]*/manufacturer") do
local id = p:match("%d+-%d+")
local mf = nixio.fs.readfile("/sys/bus/usb/devices/" .. id .. "/manufacturer") or "?"
@@ -116,4 +123,12 @@ for p in nixio.fs.glob("/sys/bus/usb/devices/[0-9]*/manufacturer") do
usbdev:value(id, "%s (%s - %s)" %{ id, mf, pr })
end
+for p in nixio.fs.glob("/sys/bus/usb/devices/[0-9]*") do
+ local bus, port = p:match("(%d+)-(%d+)")
+ if bus and port then
+ usbport:value("usb%u-port%u" %{ tonumber(bus), tonumber(port) },
+ "Hub %u, Port %u" %{ tonumber(bus), tonumber(port) })
+ end
+end
+
return m
diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_overview.htm b/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_overview.htm
index 646d931f37..2512a35b3c 100644
--- a/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_overview.htm
+++ b/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_overview.htm
@@ -164,6 +164,11 @@
ifc.ip6addrs[i]
);
}
+
+ if (ifc.ip6prefix)
+ {
+ html += String.format('<strong><%:IPv6-PD%>:</strong> %s<br />', ifc.ip6prefix);
+ }
d.innerHTML = html;
}
diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_status.htm b/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_status.htm
index 8c3b1abcc7..b15dd13f39 100644
--- a/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_status.htm
+++ b/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_status.htm
@@ -54,6 +54,11 @@
ifc.ip6addrs[i]
);
}
+
+ if (ifc.ip6prefix)
+ {
+ html += String.format('<strong><%:IPv6-PD%>:</strong> %s<br />', ifc.ip6prefix);
+ }
d.innerHTML = html;
}
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 8976e30cba..206f9ef82a 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
@@ -76,12 +76,14 @@
if wan6 then
rv.wan6 = {
- ip6addr = wan6:ip6addr(),
- gw6addr = wan6:gw6addr(),
- dns = wan6:dns6addrs(),
- uptime = wan6:uptime(),
- ifname = wan6:ifname(),
- link = wan6:adminlink()
+ ip6addr = wan6:ip6addr(),
+ gw6addr = wan6:gw6addr(),
+ dns = wan6:dns6addrs(),
+ ip6prefix = wan6:ip6prefix(),
+ uptime = wan6:uptime(),
+ proto = wan6:proto(),
+ ifname = wan6:ifname(),
+ link = wan6:adminlink()
}
end
@@ -233,9 +235,34 @@
if (ifc6 && ifc6.ifname && ifc6.proto != 'none')
{
var s = String.format(
- '<strong><%:Address%>: </strong>%s<br />' +
+ '<strong><%:Type%>: </strong>%s%s<br />',
+ ifc6.proto, (ifc6.ip6prefix) ? '-pd' : ''
+ );
+
+ if (!ifc6.ip6prefix)
+ {
+ s += String.format(
+ '<strong><%:Address%>: </strong>%s<br />',
+ (ifc6.ip6addr) ? ifc6.ip6addr : '::'
+ );
+ }
+ else
+ {
+ s += String.format(
+ '<strong><%:Prefix Delegated%>: </strong>%s<br />',
+ ifc6.ip6prefix
+ );
+ if (ifc6.ip6addr)
+ {
+ s += String.format(
+ '<strong><%:Address%>: </strong>%s<br />',
+ ifc6.ip6addr
+ );
+ }
+ }
+
+ s += String.format(
'<strong><%:Gateway%>: </strong>%s<br />',
- (ifc6.ip6addr) ? ifc6.ip6addr : '::',
(ifc6.gw6addr) ? ifc6.gw6addr : '::'
);
diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_system/flashops.htm b/modules/luci-mod-admin-full/luasrc/view/admin_system/flashops.htm
index 82a1fdbc9c..3e3f65d919 100644
--- a/modules/luci-mod-admin-full/luasrc/view/admin_system/flashops.htm
+++ b/modules/luci-mod-admin-full/luasrc/view/admin_system/flashops.htm
@@ -63,7 +63,7 @@
<% if upgrade_avail then %>
<form method="post" action="<%=url('admin/system/flashops/sysupgrade')%>" enctype="multipart/form-data">
<input type="hidden" name="token" value="<%=token%>" />
- <div class="cbi-section-descr"><%:Upload a sysupgrade-compatible image here to replace the running firmware. Check "Keep settings" to retain the current configuration (requires an OpenWrt compatible firmware image).%></div>
+ <div class="cbi-section-descr"><%:Upload a sysupgrade-compatible image here to replace the running firmware. Check "Keep settings" to retain the current configuration (requires a compatible firmware image).%></div>
<div class="cbi-section-node">
<div class="cbi-value">
<label class="cbi-value-title" for="keep"><%:Keep settings%>:</label>
@@ -84,7 +84,7 @@
<% end %>
</form>
<% else %>
- <div class="cbi-section-descr"><%:Sorry, there is no sysupgrade support present; a new firmware image must be flashed manually. Please refer to the OpenWrt wiki for device specific install instructions.%></div>
+ <div class="cbi-section-descr"><%:Sorry, there is no sysupgrade support present; a new firmware image must be flashed manually. Please refer to the wiki for device specific install instructions.%></div>
<% end %>
</fieldset>