summaryrefslogtreecommitdiffhomepage
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/cbi.js184
-rw-r--r--modules/luci-base/luasrc/model/ipkg.lua247
-rw-r--r--modules/luci-base/luasrc/model/ipkg.luadoc125
-rw-r--r--modules/luci-base/luasrc/sys.lua94
-rw-r--r--modules/luci-base/luasrc/sys.luadoc36
-rw-r--r--modules/luci-base/luasrc/view/cbi/apply_widget.htm96
-rw-r--r--modules/luci-base/luasrc/view/cbi/dynlist.htm18
-rw-r--r--modules/luci-base/luasrc/view/cbi/value.htm2
-rw-r--r--modules/luci-base/po/de/base.po192
-rw-r--r--modules/luci-base/po/zh-cn/base.po160
-rw-r--r--modules/luci-mod-freifunk/Makefile2
-rw-r--r--modules/luci-mod-status/luasrc/view/admin_status/index.htm80
-rw-r--r--modules/luci-mod-system/luasrc/controller/admin/system.lua212
-rw-r--r--modules/luci-mod-system/luasrc/model/cbi/admin_system/ipkg.lua64
-rw-r--r--modules/luci-mod-system/luasrc/view/admin_system/ipkg.htm10
-rw-r--r--modules/luci-mod-system/luasrc/view/admin_system/packages.htm213
16 files changed, 518 insertions, 1217 deletions
diff --git a/modules/luci-base/htdocs/luci-static/resources/cbi.js b/modules/luci-base/htdocs/luci-static/resources/cbi.js
index 0230ae9fa0..294b2d7486 100644
--- a/modules/luci-base/htdocs/luci-static/resources/cbi.js
+++ b/modules/luci-base/htdocs/luci-static/resources/cbi.js
@@ -228,7 +228,7 @@ var CBIValidatorPrototype = {
validate: function() {
/* element is detached */
- if (!this.field.form)
+ if (!findParent(this.field, 'form'))
return true;
this.field.classList.remove('cbi-input-invalid');
@@ -569,7 +569,7 @@ var CBIValidatorPrototype = {
return;
var input = sibling.querySelector('[data-type]'),
- values = input.getAttribute('data-is-list') ? input.value.match(/[^ \t]+/g) : [ input.value ];
+ values = input ? (input.getAttribute('data-is-list') ? input.value.match(/[^ \t]+/g) : [ input.value ]) : null;
if (values !== null && values.indexOf(ctx.value) !== -1)
unique = false;
@@ -806,7 +806,9 @@ function cbi_combobox_init(id, values, def, man) {
'class': 'cbi-dropdown',
'display-items': 5,
'optional': obj.getAttribute('data-optional'),
- 'placeholder': _('-- Please choose --')
+ 'placeholder': _('-- Please choose --'),
+ 'data-type': obj.getAttribute('data-type'),
+ 'data-optional': obj.getAttribute('data-optional')
}, [ E('ul') ]);
if (!(obj.value in values) && obj.value.length) {
@@ -833,6 +835,7 @@ function cbi_combobox_init(id, values, def, man) {
})
]));
+ sb.value = obj.value;
obj.parentNode.replaceChild(sb, obj);
}
@@ -1114,38 +1117,30 @@ function cbi_validate_field(cbid, optional, type)
try {
var cbiValidator = new CBIValidator(field, type, optional);
-
- validatorFn = function() {
- return cbiValidator.validate();
- };
+ validatorFn = cbiValidator.validate.bind(cbiValidator);
}
catch(e) {
validatorFn = null;
};
if (validatorFn !== null) {
- if (!field.form.cbi_validators)
- field.form.cbi_validators = [ ];
+ var form = findParent(field, 'form');
- field.form.cbi_validators.push(validatorFn);
+ if (!form.cbi_validators)
+ form.cbi_validators = [ ];
+
+ form.cbi_validators.push(validatorFn);
field.addEventListener("blur", validatorFn);
field.addEventListener("keyup", validatorFn);
+ field.addEventListener("cbi-dropdown-change", validatorFn);
if (matchesElem(field, 'select')) {
field.addEventListener("change", validatorFn);
field.addEventListener("click", validatorFn);
}
- field.setAttribute("cbi_validate", validatorFn);
- field.setAttribute("cbi_datatype", type);
- field.setAttribute("cbi_optional", (!!optional).toString());
-
validatorFn();
-
- var fcbox = document.getElementById('cbi.combobox.' + field.id);
- if (fcbox)
- cbi_validate_field(fcbox, optional, type);
}
}
@@ -1441,6 +1436,14 @@ if (window.NodeList && !NodeList.prototype.forEach) {
};
}
+if (!window.requestAnimationFrame) {
+ window.requestAnimationFrame = function(f) {
+ window.setTimeout(function() {
+ f(new Date().getTime())
+ }, 1000/30);
+ };
+}
+
var dummyElem, domParser;
@@ -1561,11 +1564,10 @@ CBIDropdown = {
var st = window.getComputedStyle(sb, null),
ul = sb.querySelector('ul'),
li = ul.querySelectorAll('li'),
+ fl = findParent(sb, '.cbi-value-field'),
sel = ul.querySelector('[selected]'),
rect = sb.getBoundingClientRect(),
- h = sb.clientHeight - parseFloat(st.paddingTop) - parseFloat(st.paddingBottom),
- mh = this.dropdown_items * h,
- eh = Math.min(mh, li.length * h);
+ items = Math.min(this.dropdown_items, li.length);
document.querySelectorAll('.cbi-dropdown[open]').forEach(function(s) {
s.dispatchEvent(new CustomEvent('cbi-dropdown-close', {}));
@@ -1573,22 +1575,54 @@ CBIDropdown = {
sb.setAttribute('open', '');
+ var pv = ul.cloneNode(true);
+ pv.classList.add('preview');
+
+ if (fl)
+ fl.classList.add('cbi-dropdown-open');
+
if ('ontouchstart' in window) {
- var scroll = document.documentElement.scrollTop,
- vpWidth = Math.max(document.documentElement.clientWidth, window.innerWidth || 0),
- vpHeight = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
+ var vpWidth = Math.max(document.documentElement.clientWidth, window.innerWidth || 0),
+ vpHeight = Math.max(document.documentElement.clientHeight, window.innerHeight || 0),
+ scrollFrom = window.pageYOffset,
+ scrollTo = scrollFrom + rect.top - vpHeight * 0.5,
+ start = null;
- ul.style.top = h + 'px';
+ ul.style.top = sb.offsetHeight + 'px';
ul.style.left = -rect.left + 'px';
ul.style.right = (rect.right - vpWidth) + 'px';
+ ul.style.maxHeight = (vpHeight * 0.5) + 'px';
+ ul.style.WebkitOverflowScrolling = 'touch';
+
+ var scrollStep = function(timestamp) {
+ if (!start) {
+ start = timestamp;
+ ul.scrollTop = sel ? Math.max(sel.offsetTop - sel.offsetHeight, 0) : 0;
+ }
- window.scrollTo(0, (scroll + rect.top - vpHeight * 0.6));
+ var duration = Math.max(timestamp - start, 1);
+ if (duration < 100) {
+ document.body.scrollTop = scrollFrom + (scrollTo - scrollFrom) * (duration / 100);
+ window.requestAnimationFrame(scrollStep);
+ }
+ else {
+ document.body.scrollTop = scrollTo;
+ }
+ };
+
+ window.requestAnimationFrame(scrollStep);
}
else {
- ul.style.maxHeight = mh + 'px';
- ul.scrollTop = sel ? Math.max(sel.offsetTop - sel.offsetHeight, 0) : 0;
+ ul.style.maxHeight = '1px';
ul.style.top = ul.style.bottom = '';
- ul.style[((rect.top + rect.height + eh) > window.innerHeight) ? 'bottom' : 'top'] = rect.height + 'px';
+
+ window.requestAnimationFrame(function() {
+ var height = items * li[Math.max(0, li.length - 2)].offsetHeight;
+
+ ul.scrollTop = sel ? Math.max(sel.offsetTop - sel.offsetHeight, 0) : 0;
+ ul.style[((rect.top + rect.height + height) > window.innerHeight) ? 'bottom' : 'top'] = rect.height + 'px';
+ ul.style.maxHeight = height + 'px';
+ });
}
ul.querySelectorAll('[selected] input[type="checkbox"]').forEach(function(c) {
@@ -1597,10 +1631,6 @@ CBIDropdown = {
ul.classList.add('dropdown');
- var pv = ul.cloneNode(true);
- pv.classList.remove('dropdown');
- pv.classList.add('preview');
-
sb.insertBefore(pv, ul.nextElementSibling);
li.forEach(function(l) {
@@ -1618,7 +1648,8 @@ CBIDropdown = {
var pv = sb.querySelector('ul.preview'),
ul = sb.querySelector('ul.dropdown'),
- li = ul.querySelectorAll('li');
+ li = ul.querySelectorAll('li'),
+ fl = findParent(sb, '.cbi-value-field');
li.forEach(function(l) { l.removeAttribute('tabindex'); });
sb.lastElementChild.removeAttribute('tabindex');
@@ -1628,6 +1659,10 @@ CBIDropdown = {
sb.style.width = sb.style.height = '';
ul.classList.remove('dropdown');
+ ul.style.top = ul.style.bottom = ul.style.maxHeight = '';
+
+ if (fl)
+ fl.classList.remove('cbi-dropdown-open');
if (!no_focus)
this.setFocus(sb, sb);
@@ -1727,6 +1762,7 @@ CBIDropdown = {
saveValues: function(sb, ul) {
var sel = ul.querySelectorAll('li[selected]'),
div = sb.lastElementChild,
+ strval = '',
values = [];
while (div.lastElementChild)
@@ -1736,17 +1772,21 @@ CBIDropdown = {
if (s.hasAttribute('placeholder'))
return;
+ var v = {
+ text: s.innerText,
+ value: s.hasAttribute('data-value') ? s.getAttribute('data-value') : s.innerText,
+ element: s
+ };
+
div.appendChild(E('input', {
type: 'hidden',
name: s.hasAttribute('name') ? s.getAttribute('name') : (sb.getAttribute('name') || ''),
- value: s.hasAttribute('data-value') ? s.getAttribute('data-value') : s.innerText
+ value: v.value
}));
- values.push({
- text: s.innerText,
- value: s.hasAttribute('data-value') ? s.getAttribute('data-value') : s.innerText,
- element: s
- });
+ values.push(v);
+
+ strval += strval.length ? ' ' + v.value : v.value;
});
var detail = {
@@ -1754,11 +1794,13 @@ CBIDropdown = {
element: sb
};
- if (this.mult)
+ if (this.multi)
detail.values = values;
else
detail.value = values.length ? values[0] : null;
+ sb.value = strval;
+
sb.dispatchEvent(new CustomEvent('cbi-dropdown-change', {
bubbles: true,
detail: detail
@@ -1815,14 +1857,13 @@ CBIDropdown = {
createItems: function(sb, value) {
var sbox = this,
- val = (value || '').trim().split(/\s+/),
+ val = (value || '').trim(),
ul = sb.querySelector('ul');
if (!sbox.multi)
- val.length = Math.min(val.length, 1);
-
- if (val.length === 1 && val[0].length === 0)
- val.length = 0;
+ val = val.length ? [ val ] : [];
+ else
+ val = val.length ? val.split(/\s+/) : [];
val.forEach(function(item) {
var new_item = null;
@@ -1879,6 +1920,8 @@ CBIDropdown = {
var li = findParent(ev.target, 'li');
if (li && li.parentNode.classList.contains('dropdown'))
this.toggleItem(sb, li);
+ else if (li && li.parentNode.classList.contains('preview'))
+ this.closeDropdown(sb);
}
ev.preventDefault();
@@ -2205,7 +2248,9 @@ function cbi_update_table(table, data, placeholder) {
var tooltipDiv = null, tooltipTimeout = null;
function showTooltip(ev) {
- if (!matchesElem(ev.target, '[data-tooltip]'))
+ var target = findParent(ev.target, '[data-tooltip]');
+
+ if (!target)
return;
if (tooltipTimeout !== null) {
@@ -2213,19 +2258,19 @@ function showTooltip(ev) {
tooltipTimeout = null;
}
- var rect = ev.target.getBoundingClientRect(),
+ var rect = target.getBoundingClientRect(),
x = rect.left + window.pageXOffset,
y = rect.top + rect.height + window.pageYOffset;
tooltipDiv.className = 'cbi-tooltip';
tooltipDiv.innerHTML = '▲ ';
- tooltipDiv.firstChild.data += ev.target.getAttribute('data-tooltip');
+ tooltipDiv.firstChild.data += target.getAttribute('data-tooltip');
- if (ev.target.hasAttribute('data-tooltip-style'))
- tooltipDiv.classList.add(ev.target.getAttribute('data-tooltip-style'));
+ if (target.hasAttribute('data-tooltip-style'))
+ tooltipDiv.classList.add(target.getAttribute('data-tooltip-style'));
if ((y + tooltipDiv.offsetHeight) > (window.innerHeight + window.pageYOffset)) {
- y -= (tooltipDiv.offsetHeight + ev.target.offsetHeight);
+ y -= (tooltipDiv.offsetHeight + target.offsetHeight);
tooltipDiv.firstChild.data = '▼ ' + tooltipDiv.firstChild.data.substr(2);
}
@@ -2247,8 +2292,43 @@ function hideTooltip(ev) {
tooltipTimeout = window.setTimeout(function() { tooltipDiv.removeAttribute('style'); }, 250);
}
+
+var modalDiv = null;
+
+function showModal(title, children)
+{
+ var dlg = modalDiv.firstElementChild;
+
+ while (dlg.firstChild)
+ dlg.removeChild(dlg.firstChild);
+
+ dlg.setAttribute('class', 'modal');
+ dlg.appendChild(E('h4', {}, title));
+
+ if (!Array.isArray(children))
+ children = [ children ];
+
+ for (var i = 0; i < children.length; i++)
+ if (isElem(children[i]))
+ dlg.appendChild(children[i]);
+ else
+ dlg.appendChild(document.createTextNode('' + children[i]));
+
+ document.body.classList.add('modal-overlay-active');
+
+ return dlg;
+}
+
+function hideModal()
+{
+ document.body.classList.remove('modal-overlay-active');
+}
+
+
document.addEventListener('DOMContentLoaded', function() {
tooltipDiv = document.body.appendChild(E('div', { 'class': 'cbi-tooltip' }));
+ modalDiv = document.body.appendChild(E('div', { 'id': 'modal_overlay' },
+ E('div', { 'class': 'modal' })));
document.addEventListener('mouseover', showTooltip, true);
document.addEventListener('mouseout', hideTooltip, true);
diff --git a/modules/luci-base/luasrc/model/ipkg.lua b/modules/luci-base/luasrc/model/ipkg.lua
deleted file mode 100644
index e27ea52895..0000000000
--- a/modules/luci-base/luasrc/model/ipkg.lua
+++ /dev/null
@@ -1,247 +0,0 @@
--- Copyright 2008-2011 Jo-Philipp Wich <jow@openwrt.org>
--- Copyright 2008 Steven Barth <steven@midlink.org>
--- Licensed to the public under the Apache License 2.0.
-
-local os = require "os"
-local io = require "io"
-local fs = require "nixio.fs"
-local util = require "luci.util"
-
-local type = type
-local pairs = pairs
-local error = error
-local table = table
-
-local ipkg = "opkg --force-removal-of-dependent-packages --force-overwrite --nocase"
-local icfg = "/etc/opkg.conf"
-
-module "luci.model.ipkg"
-
-
--- Internal action function
-local function _action(cmd, ...)
- local cmdline = { ipkg, cmd }
-
- local k, v
- for k, v in pairs({...}) do
- cmdline[#cmdline+1] = util.shellquote(v)
- end
-
- local c = "%s >/tmp/opkg.stdout 2>/tmp/opkg.stderr" % table.concat(cmdline, " ")
- local r = os.execute(c)
- local e = fs.readfile("/tmp/opkg.stderr")
- local o = fs.readfile("/tmp/opkg.stdout")
-
- fs.unlink("/tmp/opkg.stderr")
- fs.unlink("/tmp/opkg.stdout")
-
- return r, o or "", e or ""
-end
-
--- Internal parser function
-local function _parselist(rawdata)
- if type(rawdata) ~= "function" then
- error("OPKG: Invalid rawdata given")
- end
-
- local data = {}
- local c = {}
- local l = nil
-
- for line in rawdata do
- if line:sub(1, 1) ~= " " then
- local key, val = line:match("(.-): ?(.*)%s*")
-
- if key and val then
- if key == "Package" then
- c = {Package = val}
- data[val] = c
- elseif key == "Status" then
- c.Status = {}
- for j in val:gmatch("([^ ]+)") do
- c.Status[j] = true
- end
- else
- c[key] = val
- end
- l = key
- end
- else
- -- Multi-line field
- c[l] = c[l] .. "\n" .. line
- end
- end
-
- return data
-end
-
--- Internal lookup function
-local function _lookup(cmd, pkg)
- local cmdline = { ipkg, cmd }
- if pkg then
- cmdline[#cmdline+1] = util.shellquote(pkg)
- end
-
- -- OPKG sometimes kills the whole machine because it sucks
- -- Therefore we have to use a sucky approach too and use
- -- tmpfiles instead of directly reading the output
- local tmpfile = os.tmpname()
- os.execute("%s >%s 2>/dev/null" %{ table.concat(cmdline, " "), tmpfile })
-
- local data = _parselist(io.lines(tmpfile))
- os.remove(tmpfile)
- return data
-end
-
-
-function info(pkg)
- return _lookup("info", pkg)
-end
-
-function status(pkg)
- return _lookup("status", pkg)
-end
-
-function install(...)
- return _action("install", ...)
-end
-
-function installed(pkg)
- local p = status(pkg)[pkg]
- return (p and p.Status and p.Status.installed)
-end
-
-function remove(...)
- return _action("remove", ...)
-end
-
-function update()
- return _action("update")
-end
-
-function upgrade()
- return _action("upgrade")
-end
-
--- List helper
-local function _list(action, pat, cb)
- local cmdline = { ipkg, action }
- if pat then
- cmdline[#cmdline+1] = util.shellquote(pat)
- end
-
- local fd = io.popen(table.concat(cmdline, " "))
- if fd then
- local name, version, sz, desc
- while true do
- local line = fd:read("*l")
- if not line then break end
-
- name, version, sz, desc = line:match("^(.-) %- (.-) %- (.-) %- (.+)")
-
- if not name then
- name, version, sz = line:match("^(.-) %- (.-) %- (.+)")
- desc = ""
- end
-
- if name and version then
- if #version > 26 then
- version = version:sub(1,21) .. ".." .. version:sub(-3,-1)
- end
-
- cb(name, version, sz, desc)
- end
-
- name = nil
- version = nil
- sz = nil
- desc = nil
- end
-
- fd:close()
- end
-end
-
-function list_all(pat, cb)
- _list("list --size", pat, cb)
-end
-
-function list_installed(pat, cb)
- _list("list_installed --size", pat, cb)
-end
-
-function find(pat, cb)
- _list("find --size", pat, cb)
-end
-
-
-function overlay_root()
- local od = "/"
- local fd = io.open(icfg, "r")
-
- if fd then
- local ln
-
- repeat
- ln = fd:read("*l")
- if ln and ln:match("^%s*option%s+overlay_root%s+") then
- od = ln:match("^%s*option%s+overlay_root%s+(%S+)")
-
- local s = fs.stat(od)
- if not s or s.type ~= "dir" then
- od = "/"
- end
-
- break
- end
- until not ln
-
- fd:close()
- end
-
- return od
-end
-
-function compare_versions(ver1, comp, ver2)
- if not ver1 or not ver2
- or not comp or not (#comp > 0) then
- error("Invalid parameters")
- return nil
- end
- -- correct compare string
- if comp == "<>" or comp == "><" or comp == "!=" or comp == "~=" then comp = "~="
- elseif comp == "<=" or comp == "<" or comp == "=<" then comp = "<="
- elseif comp == ">=" or comp == ">" or comp == "=>" then comp = ">="
- elseif comp == "=" or comp == "==" then comp = "=="
- elseif comp == "<<" then comp = "<"
- elseif comp == ">>" then comp = ">"
- else
- error("Invalid compare string")
- return nil
- end
-
- local av1 = util.split(ver1, "[%.%-]", nil, true)
- local av2 = util.split(ver2, "[%.%-]", nil, true)
-
- local max = table.getn(av1)
- if (table.getn(av1) < table.getn(av2)) then
- max = table.getn(av2)
- end
-
- for i = 1, max, 1 do
- local s1 = av1[i] or ""
- local s2 = av2[i] or ""
-
- -- first "not equal" found return true
- if comp == "~=" and (s1 ~= s2) then return true end
- -- first "lower" found return true
- if (comp == "<" or comp == "<=") and (s1 < s2) then return true end
- -- first "greater" found return true
- if (comp == ">" or comp == ">=") and (s1 > s2) then return true end
- -- not equal then return false
- if (s1 ~= s2) then return false end
- end
-
- -- all equal and not compare greater or lower then true
- return not (comp == "<" or comp == ">")
-end
diff --git a/modules/luci-base/luasrc/model/ipkg.luadoc b/modules/luci-base/luasrc/model/ipkg.luadoc
deleted file mode 100644
index 4e1548dda6..0000000000
--- a/modules/luci-base/luasrc/model/ipkg.luadoc
+++ /dev/null
@@ -1,125 +0,0 @@
----[[
-LuCI OPKG call abstraction library
-]]
-module "luci.model.ipkg"
-
----[[
-Return information about installed and available packages.
-
-@class function
-@name info
-@param pkg Limit output to a (set of) packages
-@return Table containing package information
-]]
-
----[[
-Return the package status of one or more packages.
-
-@class function
-@name status
-@param pkg Limit output to a (set of) packages
-@return Table containing package status information
-]]
-
----[[
-Install one or more packages.
-
-@class function
-@name install
-@param ... List of packages to install
-@return Boolean indicating the status of the action
-@return OPKG return code, STDOUT and STDERR
-]]
-
----[[
-Determine whether a given package is installed.
-
-@class function
-@name installed
-@param pkg Package
-@return Boolean
-]]
-
----[[
-Remove one or more packages.
-
-@class function
-@name remove
-@param ... List of packages to install
-@return Boolean indicating the status of the action
-@return OPKG return code, STDOUT and STDERR
-]]
-
----[[
-Update package lists.
-
-@class function
-@name update
-@return Boolean indicating the status of the action
-@return OPKG return code, STDOUT and STDERR
-]]
-
----[[
-Upgrades all installed packages.
-
-@class function
-@name upgrade
-@return Boolean indicating the status of the action
-@return OPKG return code, STDOUT and STDERR
-]]
-
----[[
-List all packages known to opkg.
-
-@class function
-@name list_all
-@param pat Only find packages matching this pattern, nil lists all packages
-@param cb Callback function invoked for each package, receives name, version and description as arguments
-@return nothing
-]]
-
----[[
-List installed packages.
-
-@class function
-@name list_installed
-@param pat Only find packages matching this pattern, nil lists all packages
-@param cb Callback function invoked for each package, receives name, version and description as arguments
-@return nothing
-]]
-
----[[
-Find packages that match the given pattern.
-
-@class function
-@name find
-@param pat Find packages whose names or descriptions match this pattern, nil results in zero results
-@param cb Callback function invoked for each patckage, receives name, version and description as arguments
-@return nothing
-]]
-
----[[
-Determines the overlay root used by opkg.
-
-@class function
-@name overlay_root
-@return String containing the directory path of the overlay root.
-]]
-
----[[
-lua version of opkg compare-versions
-
-@class function
-@name compare_versions
-@param ver1 string version 1
-@param ver2 string version 2
-@param comp string compare versions using
- "<=" or "<" lower-equal
- ">" or ">=" greater-equal
- "=" equal
- "<<" lower
- ">>" greater
- "~=" not equal
-@return Boolean indicating the status of the compare
-]]
-
diff --git a/modules/luci-base/luasrc/sys.lua b/modules/luci-base/luasrc/sys.lua
index 1436a3a235..7e4a9d63cf 100644
--- a/modules/luci-base/luasrc/sys.lua
+++ b/modules/luci-base/luasrc/sys.lua
@@ -13,8 +13,8 @@ local luci = {}
luci.util = require "luci.util"
luci.ip = require "luci.ip"
-local tonumber, ipairs, pairs, pcall, type, next, setmetatable, require, select =
- tonumber, ipairs, pairs, pcall, type, next, setmetatable, require, select
+local tonumber, ipairs, pairs, pcall, type, next, setmetatable, require, select, unpack =
+ tonumber, ipairs, pairs, pcall, type, next, setmetatable, require, select, unpack
module "luci.sys"
@@ -436,6 +436,96 @@ end
process.signal = nixio.kill
+local function xclose(fd)
+ if fd and fd:fileno() > 2 then
+ fd:close()
+ end
+end
+
+function process.exec(command, stdout, stderr, nowait)
+ local out_r, out_w, err_r, err_w
+ if stdout then out_r, out_w = nixio.pipe() end
+ if stderr then err_r, err_w = nixio.pipe() end
+
+ local pid = nixio.fork()
+ if pid == 0 then
+ nixio.chdir("/")
+
+ local null = nixio.open("/dev/null", "w+")
+ if null then
+ nixio.dup(out_w or null, nixio.stdout)
+ nixio.dup(err_w or null, nixio.stderr)
+ nixio.dup(null, nixio.stdin)
+ xclose(out_w)
+ xclose(out_r)
+ xclose(err_w)
+ xclose(err_r)
+ xclose(null)
+ end
+
+ nixio.exec(unpack(command))
+ os.exit(-1)
+ end
+
+ local _, pfds, rv = nil, {}, { code = -1, pid = pid }
+
+ xclose(out_w)
+ xclose(err_w)
+
+ if out_r then
+ pfds[#pfds+1] = {
+ fd = out_r,
+ cb = type(stdout) == "function" and stdout,
+ name = "stdout",
+ events = nixio.poll_flags("in", "err", "hup")
+ }
+ end
+
+ if err_r then
+ pfds[#pfds+1] = {
+ fd = err_r,
+ cb = type(stderr) == "function" and stderr,
+ name = "stderr",
+ events = nixio.poll_flags("in", "err", "hup")
+ }
+ end
+
+ while #pfds > 0 do
+ local nfds, err = nixio.poll(pfds, -1)
+ if not nfds and err ~= nixio.const.EINTR then
+ break
+ end
+
+ local i
+ for i = #pfds, 1, -1 do
+ local rfd = pfds[i]
+ if rfd.revents > 0 then
+ local chunk, err = rfd.fd:read(4096)
+ if chunk and #chunk > 0 then
+ if rfd.cb then
+ rfd.cb(chunk)
+ else
+ rfd.buf = rfd.buf or {}
+ rfd.buf[#rfd.buf + 1] = chunk
+ end
+ else
+ table.remove(pfds, i)
+ if rfd.buf then
+ rv[rfd.name] = table.concat(rfd.buf, "")
+ end
+ rfd.fd:close()
+ end
+ end
+ end
+ end
+
+ if not nowait then
+ _, _, rv.code = nixio.waitpid(pid)
+ end
+
+ return rv
+end
+
user = {}
diff --git a/modules/luci-base/luasrc/sys.luadoc b/modules/luci-base/luasrc/sys.luadoc
index 3c7f69c6e9..162650e7ac 100644
--- a/modules/luci-base/luasrc/sys.luadoc
+++ b/modules/luci-base/luasrc/sys.luadoc
@@ -272,6 +272,42 @@ Send a signal to a process identified by given pid.
]]
---[[
+Execute a process, optionally capturing stdio.
+
+Executes the process specified by the given argv vector, e.g.
+`{ "/bin/sh", "-c", "echo 1" }` and waits for it to terminate unless a true
+value has been passed for the "nowait" parameter.
+
+When a function value is passed for the stdout or stderr arguments, the passed
+function is repeatedly called for each chunk read from the corresponding stdio
+stream. The read data is passed as string containing at most 4096 bytes at a
+time.
+
+When a true, non-function value is passed for the stdout or stderr arguments,
+the data of the corresponding stdio stream is read into an internal string
+buffer and returned as "stdout" or "stderr" field respectively in the result
+table.
+
+When a true value is passed to the nowait parameter, the function does not
+await process termination but returns as soon as all captured stdio streams
+have been closed or - if no streams are captured - immediately after launching
+the process.
+
+@class function
+@name process.exec
+@param commend Table containing the argv vector to execute
+@param stdout Callback function or boolean to indicate capturing (optional)
+@param stderr Callback function or boolean to indicate capturing (optional)
+@param nowait Don't wait for process termination when true (optional)
+@return Table containing at least the fields "code" which holds the exit
+ status of the invoked process or "-1" on error and "pid", which
+ contains the process id assigned to the spawned process. When
+ stdout and/or stderr capturing has been requested, it additionally
+ contains "stdout" and "stderr" fields respectively, holding the
+ captured stdio data as string.
+]]
+
+---[[
LuCI system utilities / user related functions.
@class module
diff --git a/modules/luci-base/luasrc/view/cbi/apply_widget.htm b/modules/luci-base/luasrc/view/cbi/apply_widget.htm
index 0df16e88c8..05511c9ab0 100644
--- a/modules/luci-base/luasrc/view/cbi/apply_widget.htm
+++ b/modules/luci-base/luasrc/view/cbi/apply_widget.htm
@@ -1,49 +1,4 @@
<% export("cbi_apply_widget", function(redirect_ok, rollback_token) -%>
-<style type="text/css">
- #cbi_apply_overlay {
- position: absolute;
- top: 0;
- left: 0;
- bottom: 0;
- right: 0;
- background: rgba(0, 0, 0, 0.7);
- display: none;
- z-index: 20000;
- }
-
- #cbi_apply_overlay .alert-message {
- position: relative;
- top: 10%;
- width: 60%;
- margin: auto;
- display: flex;
- flex-wrap: wrap;
- min-height: 32px;
- align-items: center;
- }
-
- #cbi_apply_overlay .alert-message > h4,
- #cbi_apply_overlay .alert-message > p,
- #cbi_apply_overlay .alert-message > div {
- flex-basis: 100%;
- }
-
- #cbi_apply_overlay .alert-message > img {
- margin-right: 1em;
- flex-basis: 32px;
- }
-
- body.apply-overlay-active {
- overflow: hidden;
- height: 100vh;
- }
-
- body.apply-overlay-active #cbi_apply_overlay {
- display: block;
- }
-</style>
-
-<script type="text/javascript" src="<%=resource%>/cbi.js?v=git-18.138.59467-72fe5dd"></script>
<script type="text/javascript">//<![CDATA[
var xhr = new XHR(),
uci_apply_auth = { sid: '<%=luci.dispatcher.context.authsession%>', token: '<%=token%>' },
@@ -55,28 +10,22 @@
was_xhr_poll_running = false;
function uci_status_message(type, content) {
- var overlay = document.getElementById('cbi_apply_overlay') || document.body.appendChild(E('<div id="cbi_apply_overlay"><div class="alert-message"></div></div>')),
- message = overlay.querySelector('.alert-message');
-
- if (message && type) {
- if (!message.classList.contains(type)) {
- message.classList.remove('notice');
- message.classList.remove('warning');
- message.classList.add(type);
- }
+ if (type) {
+ var message = showModal('', '');
+
+ message.classList.add('alert-message');
+ DOMTokenList.prototype.add.apply(message.classList, type.split(/\s+/));
if (content)
message.innerHTML = content;
- document.body.classList.add('apply-overlay-active');
-
if (!was_xhr_poll_running) {
was_xhr_poll_running = XHR.running();
XHR.halt();
}
}
else {
- document.body.classList.remove('apply-overlay-active');
+ hideModal();
if (was_xhr_poll_running)
XHR.run();
@@ -85,19 +34,18 @@
function uci_rollback(checked) {
if (checked) {
- uci_status_message('warning',
- '<img src="<%=resource%>/icons/loading.gif" alt="" style="vertical-align:middle" /> ' +
- '<%:Failed to confirm apply within %ds, waiting for rollback…%>'.format(uci_apply_rollback));
+ uci_status_message('warning spinning',
+ '<p><%:Failed to confirm apply within %ds, waiting for rollback…%></p>'.format(uci_apply_rollback));
var call = function(r, data, duration) {
if (r.status === 204) {
uci_status_message('warning',
'<h4><%:Configuration has been rolled back!%></h4>' +
- '<p><%:The device could not be reached within %d seconds after applying the pending changes, which caused the configuration to be rolled back for safety reasons. If you believe that the configuration changes are correct nonetheless, proceed by applying anyway. Alternatively, you can dismiss this warning and edit changes before attempting to apply again, or revert all pending changes to keep the currently working configuration state.%></p>'.format(uci_apply_rollback) +
+ '<p><%:The device could not be reached within %d seconds after applying the pending changes, which caused the configuration to be rolled back for safety reasons. If you believe that the configuration changes are correct nonetheless, perform an unchecked configuration apply. Alternatively, you can dismiss this warning and edit changes before attempting to apply again, or revert all pending changes to keep the currently working configuration state.%></p>'.format(uci_apply_rollback) +
'<div class="right">' +
'<input type="button" class="btn" onclick="uci_status_message(false)" value="<%:Dismiss%>" /> ' +
'<input type="button" class="btn cbi-button-action important" onclick="uci_revert()" value="<%:Revert changes%>" /> ' +
- '<input type="button" class="btn cbi-button-negative important" onclick="uci_apply(false)" value="<%:Apply anyway%>" />' +
+ '<input type="button" class="btn cbi-button-negative important" onclick="uci_apply(false)" value="<%:Apply unchecked%>" />' +
'</div>');
return;
@@ -126,6 +74,7 @@
var call = function(r, data, duration) {
if (Date.now() >= deadline) {
+ window.clearTimeout(tt);
uci_rollback(checked);
return;
}
@@ -133,7 +82,7 @@
var indicator = document.querySelector('.uci_change_indicator');
if (indicator) indicator.style.display = 'none';
- uci_status_message('notice', '<%:Configuration has been applied.%>');
+ uci_status_message('notice', '<p><%:Configuration has been applied.%></p>');
window.clearTimeout(tt);
window.setTimeout(function() {
@@ -156,9 +105,8 @@
var tick = function() {
var now = Date.now();
- uci_status_message('notice',
- '<img src="<%=resource%>/icons/loading.gif" alt="" style="vertical-align:middle" /> ' +
- '<%:Waiting for configuration to be applied… %ds%>'.format(Math.max(Math.floor((deadline - Date.now()) / 1000), 0)));
+ uci_status_message('notice spinning',
+ '<p><%:Waiting for configuration to get applied… %ds%></p>'.format(Math.max(Math.floor((deadline - Date.now()) / 1000), 0)));
if (now >= deadline)
return;
@@ -174,9 +122,7 @@
}
function uci_apply(checked) {
- uci_status_message('notice',
- '<img src="<%=resource%>/icons/loading.gif" alt="" style="vertical-align:middle" /> ' +
- '<%:Starting configuration apply…%>');
+ uci_status_message('notice spinning', '<p><%:Starting configuration apply…%></p>');
xhr.post('<%=url("admin/uci")%>/' + (checked ? 'apply_rollback' : 'apply_unchecked'), uci_apply_auth, function(r, tok) {
if (r.status === (checked ? 200 : 204)) {
@@ -186,7 +132,7 @@
uci_confirm(checked, Date.now() + uci_apply_rollback * 1000);
}
else if (checked && r.status === 204) {
- uci_status_message('notice', '<%:There are no changes to apply.%>');
+ uci_status_message('notice', '<p><%:There are no changes to apply.%></p>');
window.setTimeout(function() {
<% if redirect_ok then -%>
location.href = decodeURIComponent('<%=luci.util.urlencode(redirect_ok)%>');
@@ -196,20 +142,18 @@
}, uci_apply_display * 1000);
}
else {
- uci_status_message('warning', '<%_Apply request failed with status <code>%h</code>%>'.format(r.responseText || r.statusText || r.status));
+ uci_status_message('warning', '<p><%_Apply request failed with status <code>%h</code>%></p>'.format(r.responseText || r.statusText || r.status));
window.setTimeout(function() { uci_status_message(false); }, uci_apply_display * 1000);
}
});
}
function uci_revert() {
- uci_status_message('notice',
- '<img src="<%=resource%>/icons/loading.gif" alt="" style="vertical-align:middle" /> ' +
- '<%:Reverting configuration…%>');
+ uci_status_message('notice spinning', '<p><%:Reverting configuration…%></p>');
xhr.post('<%=url("admin/uci/revert")%>', uci_apply_auth, function(r) {
if (r.status === 200) {
- uci_status_message('notice', '<%:Changes have been reverted.%>');
+ uci_status_message('notice', '<p><%:Changes have been reverted.%></p>');
window.setTimeout(function() {
<% if redirect_ok then -%>
location.href = decodeURIComponent('<%=luci.util.urlencode(redirect_ok)%>');
@@ -219,7 +163,7 @@
}, uci_apply_display * 1000);
}
else {
- uci_status_message('warning', '<%_Revert request failed with status <code>%h</code>%>'.format(r.statusText || r.status));
+ uci_status_message('warning', '<p><%_Revert request failed with status <code>%h</code>%></p>'.format(r.statusText || r.status));
window.setTimeout(function() { uci_status_message(false); }, uci_apply_display * 1000);
}
});
diff --git a/modules/luci-base/luasrc/view/cbi/dynlist.htm b/modules/luci-base/luasrc/view/cbi/dynlist.htm
index 4d0b50942b..fa7dbdb418 100644
--- a/modules/luci-base/luasrc/view/cbi/dynlist.htm
+++ b/modules/luci-base/luasrc/view/cbi/dynlist.htm
@@ -6,22 +6,8 @@
self.keylist, self.vallist,
self.datatype, self.optional or self.rmempty
})) ..
-
+ attr("data-values", luci.util.serialize_json(self:cfgvalue(section))) ..
ifattr(self.size, "data-size", self.size) ..
ifattr(self.placeholder, "data-placeholder", self.placeholder)
-%>>
-<%
- local vals = self:cfgvalue(section) or {}
- for i=1, #vals + 1 do
- local val = vals[i]
- if (val and #val > 0) or (i == 1) then
-%>
- <input class="cbi-input-text" value="<%=pcdata(val)%>" data-update="change" type="text"<%=
- attr("id", cbid .. "." .. i) ..
- attr("name", cbid) ..
- ifattr(self.size, "size") ..
- ifattr(i == 1 and self.placeholder, "placeholder", self.placeholder)
- %> /><br />
-<% end end %>
-</div>
+%>></div>
<%+cbi/valuefooter%>
diff --git a/modules/luci-base/luasrc/view/cbi/value.htm b/modules/luci-base/luasrc/view/cbi/value.htm
index 8eec865348..79a358b305 100644
--- a/modules/luci-base/luasrc/view/cbi/value.htm
+++ b/modules/luci-base/luasrc/view/cbi/value.htm
@@ -21,6 +21,6 @@
ifattr(#self.keylist > 0, "data-choices", { self.keylist, self.vallist })
%> />
<%- if self.password then -%>
- <div class="cbi-button cbi-button-neutral" title="<%:Reveal/hide password%>" onclick="var e = this.previousElementSibling; e.type = (e.type === 'password') ? 'text' : 'password'">∗</div>
+ <button class="cbi-button cbi-button-neutral" title="<%:Reveal/hide password%>" aria-label="<%:Reveal/hide password%>" onclick="var e = this.previousElementSibling; e.type = (e.type === 'password') ? 'text' : 'password'">∗</button>
<% end %>
<%+cbi/valuefooter%>
diff --git a/modules/luci-base/po/de/base.po b/modules/luci-base/po/de/base.po
index c5e6c1a896..0d63d02192 100644
--- a/modules/luci-base/po/de/base.po
+++ b/modules/luci-base/po/de/base.po
@@ -3,14 +3,14 @@ msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-05-26 17:57+0200\n"
-"PO-Revision-Date: 2018-07-15 12:25+0200\n"
+"PO-Revision-Date: 2018-11-05 13:01+0100\n"
"Last-Translator: JoeSemler <josef.semler@gmail.com>\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-"X-Generator: Poedit 1.8.11\n"
+"X-Generator: Poedit 2.0.5\n"
"Language-Team: \n"
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/network.lua:196
@@ -402,11 +402,11 @@ msgstr "Alias-Schnittstelle"
#: modules/luci-mod-network/luasrc/view/admin_network/iface_overview_status.htm:86
msgid "Alias of \"%s\""
-msgstr ""
+msgstr "Alias von \"%s\""
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/dhcp.lua:126
msgid "All Servers"
-msgstr ""
+msgstr "Alle Server"
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/dhcp.lua:69
msgid ""
@@ -427,6 +427,8 @@ msgstr "Erlaube Anmeldung per Passwort"
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/wifi.lua:533
msgid "Allow AP mode to disconnect STAs based on low ACK condition"
msgstr ""
+"Erlaubt dem Access-Point die Trennung von Clients mit schlechter "
+"Signalqualität"
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/wifi.lua:450
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/wifi.lua:577
@@ -480,6 +482,9 @@ msgid ""
"Always use 40MHz channels even if the secondary channel overlaps. Using this "
"option does not comply with IEEE 802.11n-2009!"
msgstr ""
+"Immer 40MHz Kanalbandbreite benutzen, auch wenn sich der sekundäre Kanal mit "
+"benachbarten Funkzellen überlappt. Die Benutzung dieser Option ist eine "
+"Verletzung des IEEE 802.11n-2009 Standards!"
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/network.lua:158
#: modules/luci-mod-status/luasrc/view/admin_status/index.htm:260
@@ -488,7 +493,7 @@ msgstr ""
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/network.lua:159
msgid "Annex A + L + M (all)"
-msgstr ""
+msgstr "Annex A, L und M (alle)"
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/network.lua:167
msgid "Annex A G.992.1"
@@ -782,7 +787,7 @@ msgstr "Frequenztyp"
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/wifi.lua:258
msgid "Beacon Interval"
-msgstr ""
+msgstr "Beacon-Intervall"
#: modules/luci-mod-system/luasrc/model/cbi/admin_system/backupfiles.lua:39
msgid ""
@@ -881,11 +886,11 @@ msgstr "Kategorie"
#: modules/luci-mod-system/luasrc/view/admin_system/upgrade.htm:44
msgid "Caution: Configuration files will be erased"
-msgstr ""
+msgstr "Achtung: Konfigurationsdateien werden gelöscht"
#: modules/luci-mod-system/luasrc/view/admin_system/upgrade.htm:48
msgid "Caution: System upgrade will be forced"
-msgstr ""
+msgstr "Achtung: Systemupgrade wird erzwungen"
#: modules/luci-mod-status/luasrc/view/admin_status/iptables.htm:87
#: modules/luci-mod-status/luasrc/view/admin_status/iptables.htm:89
@@ -946,7 +951,7 @@ msgstr "Prüfsumme"
#: modules/luci-mod-system/luasrc/view/admin_system/flashops.htm:70
msgid "Choose mtdblock"
-msgstr ""
+msgstr "Wähle \"mtdblock\" Datei"
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/ifaces.lua:358
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/wifi_add.lua:87
@@ -990,6 +995,9 @@ msgid ""
"Click \"Save mtdblock\" to download specified mtdblock file. (NOTE: THIS "
"FEATURE IS FOR PROFESSIONALS! )"
msgstr ""
+"\"Speichere mtdblock\" anklicken um die ausgewählte mtdblock-Datei "
+"herunterzuladen. (Hinweis: Diese Funktionalität ist nur für Experten "
+"gedacht!)"
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/wifi.lua:366
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/wifi.lua:459
@@ -1041,7 +1049,7 @@ msgstr "Befehl"
#: modules/luci-mod-status/luasrc/view/admin_status/iptables.htm:105
msgid "Comment"
-msgstr ""
+msgstr "Kommentar"
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/ifaces.lua:185
msgid "Common Configuration"
@@ -1075,7 +1083,7 @@ msgstr "Konfiguration fehlgeschlagen"
#: modules/luci-mod-system/luasrc/view/admin_system/upgrade.htm:42
msgid "Configuration files will be kept"
-msgstr ""
+msgstr "Konfigurationsdateien werden beibehalten"
#: modules/luci-base/luasrc/view/cbi/apply_widget.htm:136
msgid "Configuration has been applied."
@@ -1420,7 +1428,7 @@ msgstr "Verschlüsselung deaktivieren"
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/wifi.lua:518
msgid "Disable Inactivity Polling"
-msgstr ""
+msgstr "Inaktivitäts-Proben deaktivieren"
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/wifi_overview.lua:106
msgid "Disable this network"
@@ -1442,7 +1450,7 @@ msgstr "Deaktiviert (Standard)"
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/wifi.lua:532
msgid "Disassociate On Low Acknowledgement"
-msgstr ""
+msgstr "Trennung bei schlechtem Antwortverhalten"
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/dhcp.lua:150
msgid "Discard upstream RFC1918 responses"
@@ -1538,7 +1546,7 @@ msgstr "Backup herunterladen"
#: modules/luci-mod-system/luasrc/view/admin_system/flashops.htm:87
msgid "Download mtdblock"
-msgstr ""
+msgstr "ntdblock herunterladen"
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/network.lua:193
msgid "Downstream SNR offset"
@@ -1787,7 +1795,7 @@ msgstr "Hosts vervollständigen"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:246
msgid "Expecting %s"
-msgstr ""
+msgstr "Erwarte %s"
#: modules/luci-mod-status/luasrc/view/admin_status/index.htm:218
msgid "Expires"
@@ -1952,7 +1960,7 @@ msgstr "Start erzwingen"
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/wifi.lua:255
msgid "Force 40MHz mode"
-msgstr ""
+msgstr "40MHz-Modus forcieren"
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/wifi.lua:610
msgid "Force CCMP (AES)"
@@ -1978,7 +1986,7 @@ msgstr "Erzwinge Verbindung"
#: modules/luci-mod-system/luasrc/view/admin_system/flashops.htm:113
msgid "Force upgrade"
-msgstr ""
+msgstr "Erzwinge Upgrade"
#: protocols/luci-proto-vpnc/luasrc/model/cbi/admin_network/proto_vpnc.lua:60
msgid "Force use of NAT-T"
@@ -2171,7 +2179,7 @@ msgstr "ESSID verstecken"
#: modules/luci-mod-status/luasrc/view/admin_status/iptables.htm:140
#: modules/luci-mod-status/luasrc/view/admin_status/iptables.htm:310
msgid "Hide empty chains"
-msgstr ""
+msgstr "Leere Chains ausblenden"
#: modules/luci-base/luasrc/view/lease_status.htm:86
#: modules/luci-base/luasrc/view/wifi_assoclist.htm:75
@@ -2218,7 +2226,7 @@ msgstr ""
#: protocols/luci-proto-vpnc/luasrc/model/cbi/admin_network/proto_vpnc.lua:45
msgid "IKE DH Group"
-msgstr ""
+msgstr "IKE-DH-Gruppe"
#: protocols/luci-proto-wireguard/luasrc/model/cbi/admin_network/proto_wireguard.lua:41
msgid "IP Addresses"
@@ -2226,7 +2234,7 @@ msgstr "IP-Adressen"
#: protocols/luci-proto-ncm/luasrc/model/cbi/admin_network/proto_ncm.lua:40
msgid "IP Protocol"
-msgstr ""
+msgstr "IP-Protokoll"
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/hosts.lua:19
msgid "IP address"
@@ -2278,7 +2286,7 @@ msgstr "IPv4 Netzmaske"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:323
msgid "IPv4 network in address/netmask notation"
-msgstr ""
+msgstr "IPv4-Netzwerk in Addresse/Netzmaske-Notation"
#: protocols/luci-proto-ipv6/luasrc/model/cbi/admin_network/proto_map.lua:25
msgid "IPv4 prefix"
@@ -2349,7 +2357,7 @@ msgstr "IPv6 Gateway"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:328
msgid "IPv6 network in address/netmask notation"
-msgstr ""
+msgstr "IPv6-Netzwerk in Addresse/Netzmaske-Notation"
#: protocols/luci-proto-ipv6/luasrc/model/cbi/admin_network/proto_6rd.lua:26
#: protocols/luci-proto-ipv6/luasrc/model/cbi/admin_network/proto_map.lua:37
@@ -3056,7 +3064,7 @@ msgstr "Maximal erreichbare Datenrate (ATTNDR)"
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/wifi.lua:527
msgid "Maximum allowed Listen Interval"
-msgstr ""
+msgstr "Maximal erlaubter Inaktivitätszeitraum"
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/dhcp.lua:193
msgid "Maximum allowed number of active DHCP leases"
@@ -3150,7 +3158,7 @@ msgstr "Modell"
#: protocols/luci-proto-ncm/luasrc/model/cbi/admin_network/proto_ncm.lua:31
msgid "Modem default"
-msgstr ""
+msgstr "Modem-Grundeinstellung"
#: protocols/luci-proto-3g/luasrc/model/cbi/admin_network/proto_3g.lua:11
#: protocols/luci-proto-ncm/luasrc/model/cbi/admin_network/proto_ncm.lua:19
@@ -3367,7 +3375,7 @@ msgstr "Keine Regeln in dieser Kette"
#: modules/luci-mod-network/luasrc/view/admin_network/wifi_join.htm:171
msgid "No scan results available yet..."
-msgstr ""
+msgstr "Noch keine Scan-Ergebnisse verfügbar..."
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/network.lua:25
msgid "No zone assigned"
@@ -3440,7 +3448,7 @@ msgstr ""
#: modules/luci-mod-system/luasrc/model/cbi/admin_system/system.lua:125
msgid "Number of parallel threads used for compression"
-msgstr ""
+msgstr "Für Kompression benutze parallele Prozessanzahl"
#: modules/luci-mod-system/luasrc/view/admin_system/packages.htm:106
msgid "OK"
@@ -3899,7 +3907,7 @@ msgstr "Bitte Benutzernamen und Passwort eingeben."
#: modules/luci-mod-system/luasrc/view/admin_system/packages.htm:105
#: modules/luci-mod-system/luasrc/view/admin_system/packages.htm:113
msgid "Please update package lists first"
-msgstr ""
+msgstr "Bitte zuerst die Paketlisten aktualisieren"
#: modules/luci-mod-status/luasrc/view/admin_status/iptables.htm:87
msgid "Policy"
@@ -4396,7 +4404,7 @@ msgstr ""
#: modules/luci-mod-status/luasrc/view/admin_status/iptables.htm:281
msgid "Rule"
-msgstr ""
+msgstr "Regel"
#: modules/luci-mod-system/luasrc/model/cbi/admin_system/fstab/mount.lua:148
msgid "Run a filesystem check before mounting the device"
@@ -4460,11 +4468,11 @@ msgstr "Speichern & Anwenden"
#: modules/luci-mod-system/luasrc/view/admin_system/flashops.htm:89
msgid "Save mtdblock"
-msgstr ""
+msgstr "Speichere mtdblock"
#: modules/luci-mod-system/luasrc/view/admin_system/flashops.htm:64
msgid "Save mtdblock contents"
-msgstr ""
+msgstr "Inhalte von mtdblock-Partitionen speichern"
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/wifi_overview.lua:82
msgid "Scan"
@@ -4472,7 +4480,7 @@ msgstr "Scan"
#: modules/luci-mod-network/luasrc/view/admin_network/wifi_join.htm:133
msgid "Scan request failed"
-msgstr ""
+msgstr "Scan-Anforderung fehlgeschlagen"
#: modules/luci-mod-system/luasrc/controller/admin/system.lua:21
#: modules/luci-mod-system/luasrc/model/cbi/admin_system/crontab.lua:8
@@ -4497,6 +4505,9 @@ msgid ""
"fails. Use only if you are sure that the firmware is correct and meant for "
"your device!"
msgstr ""
+"\"Upgrade erzwingen\" auswählen um die Abbilddatei auch dann zu schreiben, "
+"wenn die Formatüberprüfung fehlschlägt. Diese Option nur benutzen wenn das "
+"Abbild korrekt und für dieses Gerät bestimmt ist!"
#: protocols/luci-proto-3g/luasrc/model/cbi/admin_network/proto_3g.lua:119
#: protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_ppp.lua:90
@@ -4568,7 +4579,7 @@ msgstr "kurzes Guardintervall"
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/wifi.lua:504
msgid "Short Preamble"
-msgstr ""
+msgstr "Kurze Präambel"
#: modules/luci-mod-system/luasrc/model/cbi/admin_system/backupfiles.lua:18
msgid "Show current backup file list"
@@ -4576,7 +4587,7 @@ msgstr "Zeige aktuelle Liste der gesicherten Dateien"
#: modules/luci-mod-status/luasrc/view/admin_status/iptables.htm:140
msgid "Show empty chains"
-msgstr ""
+msgstr "Leere Chains anzeigen"
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/network.lua:53
msgid "Shutdown this interface"
@@ -4615,7 +4626,7 @@ msgstr "Größe des DNS-Caches"
#: modules/luci-mod-system/luasrc/model/cbi/admin_system/system.lua:113
msgid "Size of the ZRam device in megabytes"
-msgstr ""
+msgstr "Größe der ZRAM-Gerätedatei in Megabytes."
#: modules/luci-base/luasrc/view/cbi/footer.htm:18
#: modules/luci-base/luasrc/view/cbi/simpleform.htm:57
@@ -4738,7 +4749,7 @@ msgstr "Starte Anwendung der Konfigurationsänderungen..."
#: modules/luci-mod-network/luasrc/view/admin_network/wifi_join.htm:128
msgid "Starting wireless scan..."
-msgstr ""
+msgstr "Starte WLAN Scan..."
#: modules/luci-mod-system/luasrc/controller/admin/system.lua:20
msgid "Startup"
@@ -4777,7 +4788,7 @@ msgstr ""
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/wifi.lua:522
msgid "Station inactivity limit"
-msgstr ""
+msgstr "Client-Inaktivitäts-Limit"
#: modules/luci-base/luasrc/controller/admin/index.lua:40
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/ifaces.lua:197
@@ -5270,7 +5281,7 @@ msgstr "Die Zeitsynchronisation wurde noch nicht konfiguriert."
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/wifi.lua:513
msgid "Time interval for rekeying GTK"
-msgstr ""
+msgstr "Zeitintervall für die neubestimmung des Gruppenschlüssels"
#: modules/luci-mod-system/luasrc/model/cbi/admin_system/system.lua:44
msgid "Timezone"
@@ -5877,22 +5888,25 @@ msgid ""
"upgrade it to at least version 7 or use another browser like Firefox, Opera "
"or Safari."
msgstr ""
+"Die benutzte Version des Internet Explorers ist zu alt, um diese Seite "
+"korrekt darzustellen. Bitte mindestens auf Version 7 upgraden oder einen "
+"anderen Browser wie Firefox, Opera oder Safari benutzen."
#: modules/luci-mod-system/luasrc/model/cbi/admin_system/system.lua:118
msgid "ZRam Compression Algorithm"
-msgstr ""
+msgstr "ZRAM Kompressionsalgorithmus"
#: modules/luci-mod-system/luasrc/model/cbi/admin_system/system.lua:125
msgid "ZRam Compression Streams"
-msgstr ""
+msgstr "ZRAM Kompressionsprozesse"
#: modules/luci-mod-system/luasrc/model/cbi/admin_system/system.lua:25
msgid "ZRam Settings"
-msgstr ""
+msgstr "ZRAM Einstellungen"
#: modules/luci-mod-system/luasrc/model/cbi/admin_system/system.lua:113
msgid "ZRam Size"
-msgstr ""
+msgstr "ZRAM Größe"
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/dhcp.lua:187
msgid "any"
@@ -5995,7 +6009,7 @@ msgstr "Halb-Duplex"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:589
msgid "hexadecimal encoded value"
-msgstr ""
+msgstr "hexadezimal kodierten Wert"
#: modules/luci-mod-network/luasrc/view/admin_network/wifi_join.htm:162
msgid "hidden"
@@ -6050,11 +6064,11 @@ msgstr "kbit/s"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:427
msgid "key between 8 and 63 characters"
-msgstr ""
+msgstr "Schlüssel zwischen 8 und 63 Zeichen"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:439
msgid "key with either 5 or 13 characters"
-msgstr ""
+msgstr "Schlüssel mit exakt 5 oder 13 Zeichen"
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/dhcp.lua:50
msgid "local <abbr title=\"Domain Name System\">DNS</abbr> file"
@@ -6066,7 +6080,7 @@ msgstr "Minuten"
#: modules/luci-mod-network/luasrc/view/admin_network/wifi_join.htm:66
msgid "mixed WPA/WPA2"
-msgstr ""
+msgstr "gemischtes WPA/WPA2"
#: modules/luci-mod-network/luasrc/view/admin_network/iface_overview_status.htm:44
#: modules/luci-mod-system/luasrc/model/cbi/admin_system/fstab.lua:225
@@ -6080,7 +6094,7 @@ msgstr "nicht verbunden"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:241
msgid "non-empty value"
-msgstr ""
+msgstr "nicht-leeren Wert"
#: modules/luci-mod-system/luasrc/view/admin_system/packages.htm:156
#: modules/luci-mod-system/luasrc/view/admin_system/packages.htm:157
@@ -6119,6 +6133,8 @@ msgid ""
"one of:\n"
" - %s"
msgstr ""
+"einen von:\n"
+"- %s"
#: modules/luci-mod-network/luasrc/view/admin_network/wifi_join.htm:71
msgid "open"
@@ -6134,11 +6150,11 @@ msgstr "Overlay"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:273
msgid "positive decimal value"
-msgstr ""
+msgstr "positiven Dezimalwert"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:265
msgid "positive integer value"
-msgstr ""
+msgstr "positive Ganzzahl"
#: protocols/luci-proto-wireguard/luasrc/model/cbi/admin_network/proto_wireguard.lua:34
msgid "random"
@@ -6157,7 +6173,7 @@ msgstr "routed"
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/wifi.lua:513
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/wifi.lua:522
msgid "sec"
-msgstr ""
+msgstr "Sekunden"
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/ifaces.lua:525
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/ifaces.lua:531
@@ -6186,7 +6202,7 @@ msgstr "Zeiteinheiten (TUs / 1024 ms) [1000-65535]"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:579
msgid "unique value"
-msgstr ""
+msgstr "eindeutigen Wert"
#: modules/luci-mod-network/luasrc/view/admin_network/wifi_join.htm:69
msgid "unknown"
@@ -6213,159 +6229,159 @@ msgstr "untagged"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:278
msgid "valid IP address"
-msgstr ""
+msgstr "gültige IP-Adresse"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:278
msgid "valid IP address or prefix"
-msgstr ""
+msgstr "gültige IP-Adresse oder gültigen IP-Präfix"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:313
msgid "valid IPv4 CIDR"
-msgstr ""
+msgstr "gültige IPv4-CIDR-Notation"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:286
msgid "valid IPv4 address"
-msgstr ""
+msgstr "gültige IPv4-Adresse"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:286
msgid "valid IPv4 address or network"
-msgstr ""
+msgstr "gültige IPv4-Adresse oder gültiges IPv4-Netzwerk"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:406
msgid "valid IPv4 address:port"
-msgstr ""
+msgstr "gültige IPv4 \"Adresse:Port\" Notation"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:346
msgid "valid IPv4 network"
-msgstr ""
+msgstr "gültiges IPv4-Netzwerk"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:308
msgid "valid IPv4 or IPv6 CIDR"
-msgstr ""
+msgstr "gültige IPv4- oder IPv6-CIDR-Notation"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:299
msgid "valid IPv4 prefix value (0-32)"
-msgstr ""
+msgstr "gültigen IPv4-Präfix-Wert (0-32)"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:318
msgid "valid IPv6 CIDR"
-msgstr ""
+msgstr "gültige iPv6-CIDR-Notation"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:294
msgid "valid IPv6 address"
-msgstr ""
+msgstr "gültige IPv6-Adresse"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:294
msgid "valid IPv6 address or prefix"
-msgstr ""
+msgstr "gültige IPv6-Addresse oder gültiges IPv6-Präfix"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:336
msgid "valid IPv6 host id"
-msgstr ""
+msgstr "gültige IPv6 Host-Identifikation"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:351
msgid "valid IPv6 network"
-msgstr ""
+msgstr "gültiges IPv6-Netzwerk"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:304
msgid "valid IPv6 prefix value (0-128)"
-msgstr ""
+msgstr "gültigen IPv6-Präfix-Wert (0-128)"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:372
msgid "valid MAC address"
-msgstr ""
+msgstr "gültige MAC-Adresse"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:443
msgid "valid UCI identifier"
-msgstr ""
+msgstr "gültigen UCI-Bezeichner"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:394
msgid "valid UCI identifier, hostname or IP address"
-msgstr ""
+msgstr "gültigen UCI-Bezeichner, Hostnamen oder IP-Adresse"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:415
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:418
msgid "valid address:port"
-msgstr ""
+msgstr "gültige \"Adresse:Port\" Notation"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:553
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:557
msgid "valid date (YYYY-MM-DD)"
-msgstr ""
+msgstr "gültiges Datum (JJJJ-MM-DD)"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:269
msgid "valid decimal value"
-msgstr ""
+msgstr "gültigen Dezimalwert"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:437
msgid "valid hexadecimal WEP key"
-msgstr ""
+msgstr "gültigen hexadezimalen WEP-Schlüssel"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:425
msgid "valid hexadecimal WPA key"
-msgstr ""
+msgstr "gültigen hexadezimalen WPA-Schlüssel"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:400
msgid "valid host:port"
-msgstr ""
+msgstr "gültige \"Host:Port\" Notation"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:387
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:389
msgid "valid hostname"
-msgstr ""
+msgstr "gültigen Hostnamen"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:377
msgid "valid hostname or IP address"
-msgstr ""
+msgstr "gültigen Hostnamen oder IP-Adresse"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:261
msgid "valid integer value"
-msgstr ""
+msgstr "gültige Ganzzahl"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:341
msgid "valid network in address/netmask notation"
-msgstr ""
+msgstr "gültiges Netzwerk in \"Addresse/Netzmaske\" Notation"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:528
msgid "valid phone digit (0-9, \"*\", \"#\", \"!\" or \".\")"
-msgstr ""
+msgstr "gültige Telefonnummernziffer (0-0, \"*\", \"#\", \"!\" oder \".\")"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:364
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:367
msgid "valid port or port range (port1-port2)"
-msgstr ""
+msgstr "gültigen Netzwerkport oder Port-Bereich (von-bis)"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:356
msgid "valid port value"
-msgstr ""
+msgstr "gültigen Netzwerkport"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:533
msgid "valid time (HH:MM:SS)"
-msgstr ""
+msgstr "gültige Zeit (SS:MM:ss)"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:462
msgid "value between %d and %d characters"
-msgstr ""
+msgstr "Wert zwischen %d und %d Zeichen"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:448
msgid "value between %f and %f"
-msgstr ""
+msgstr "Wert zwischen %f und %f"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:452
msgid "value greater or equal to %f"
-msgstr ""
+msgstr "Wert größer oder gleich %f"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:456
msgid "value smaller or equal to %f"
-msgstr ""
+msgstr "Wert kleiner oder gleich %f"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:467
msgid "value with at least %d characters"
-msgstr ""
+msgstr "Wert mit mindestens %d Zeichen"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:472
msgid "value with at most %d characters"
-msgstr ""
+msgstr "Wert mit maximal %d Zeichen"
#: modules/luci-mod-network/luasrc/view/admin_network/iface_overview_status.htm:44
#: modules/luci-mod-system/luasrc/model/cbi/admin_system/fstab.lua:221
diff --git a/modules/luci-base/po/zh-cn/base.po b/modules/luci-base/po/zh-cn/base.po
index 17dbe957a0..74558ccda9 100644
--- a/modules/luci-base/po/zh-cn/base.po
+++ b/modules/luci-base/po/zh-cn/base.po
@@ -855,11 +855,11 @@ msgstr "分类"
#: modules/luci-mod-system/luasrc/view/admin_system/upgrade.htm:44
msgid "Caution: Configuration files will be erased"
-msgstr ""
+msgstr "注意:配置文件将被删除"
#: modules/luci-mod-system/luasrc/view/admin_system/upgrade.htm:48
msgid "Caution: System upgrade will be forced"
-msgstr ""
+msgstr "注意:将强制进行系统升级"
#: modules/luci-mod-status/luasrc/view/admin_status/iptables.htm:87
#: modules/luci-mod-status/luasrc/view/admin_status/iptables.htm:89
@@ -917,7 +917,7 @@ msgstr "校验值"
#: modules/luci-mod-system/luasrc/view/admin_system/flashops.htm:70
msgid "Choose mtdblock"
-msgstr ""
+msgstr "选择 mtdblock"
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/ifaces.lua:358
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/wifi_add.lua:87
@@ -955,6 +955,8 @@ msgid ""
"Click \"Save mtdblock\" to download specified mtdblock file. (NOTE: THIS "
"FEATURE IS FOR PROFESSIONALS! )"
msgstr ""
+"单击“保存 mtdblock”以下载指定的 mtdblock 文件。(注意:此功能适用于专业人"
+"士!)"
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/wifi.lua:366
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/wifi.lua:459
@@ -1004,7 +1006,7 @@ msgstr "命令"
#: modules/luci-mod-status/luasrc/view/admin_status/iptables.htm:105
msgid "Comment"
-msgstr ""
+msgstr "备注"
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/ifaces.lua:185
msgid "Common Configuration"
@@ -1037,7 +1039,7 @@ msgstr "配置失败"
#: modules/luci-mod-system/luasrc/view/admin_system/upgrade.htm:42
msgid "Configuration files will be kept"
-msgstr ""
+msgstr "将保留配置文件"
#: modules/luci-base/luasrc/view/cbi/apply_widget.htm:136
msgid "Configuration has been applied."
@@ -1376,7 +1378,7 @@ msgstr "禁用加密"
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/wifi.lua:518
msgid "Disable Inactivity Polling"
-msgstr ""
+msgstr "禁用不活动轮询"
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/wifi_overview.lua:106
msgid "Disable this network"
@@ -1489,7 +1491,7 @@ msgstr "下载备份"
#: modules/luci-mod-system/luasrc/view/admin_system/flashops.htm:87
msgid "Download mtdblock"
-msgstr ""
+msgstr "下载 mtdblock"
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/network.lua:193
msgid "Downstream SNR offset"
@@ -1731,7 +1733,7 @@ msgstr "扩展 HOSTS 文件中的主机后缀"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:246
msgid "Expecting %s"
-msgstr ""
+msgstr "期望 %s"
#: modules/luci-mod-status/luasrc/view/admin_status/index.htm:218
msgid "Expires"
@@ -1912,7 +1914,7 @@ msgstr "强制链路"
#: modules/luci-mod-system/luasrc/view/admin_system/flashops.htm:113
msgid "Force upgrade"
-msgstr ""
+msgstr "强制升级"
#: protocols/luci-proto-vpnc/luasrc/model/cbi/admin_network/proto_vpnc.lua:60
msgid "Force use of NAT-T"
@@ -2100,7 +2102,7 @@ msgstr "隐藏 <abbr title=\"Extended Service Set Identifier\">ESSID</abbr>"
#: modules/luci-mod-status/luasrc/view/admin_status/iptables.htm:140
#: modules/luci-mod-status/luasrc/view/admin_status/iptables.htm:310
msgid "Hide empty chains"
-msgstr ""
+msgstr "隐藏空链"
#: modules/luci-base/luasrc/view/lease_status.htm:86
#: modules/luci-base/luasrc/view/wifi_assoclist.htm:75
@@ -2155,7 +2157,7 @@ msgstr "IP 地址"
#: protocols/luci-proto-ncm/luasrc/model/cbi/admin_network/proto_ncm.lua:40
msgid "IP Protocol"
-msgstr ""
+msgstr "IP 协议"
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/hosts.lua:19
msgid "IP address"
@@ -2207,7 +2209,7 @@ msgstr "IPv4 子网掩码"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:323
msgid "IPv4 network in address/netmask notation"
-msgstr ""
+msgstr "地址/网络掩码表示法中的 IPv4 网络"
#: protocols/luci-proto-ipv6/luasrc/model/cbi/admin_network/proto_map.lua:25
msgid "IPv4 prefix"
@@ -2220,7 +2222,7 @@ msgstr "IPv4 地址前缀长度"
#: protocols/luci-proto-ncm/luasrc/model/cbi/admin_network/proto_ncm.lua:43
msgid "IPv4+IPv6"
-msgstr ""
+msgstr "IPv4+IPv6"
#: modules/luci-base/luasrc/view/lease_status.htm:72
msgid "IPv4-Address"
@@ -2278,7 +2280,7 @@ msgstr "IPv6 网关"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:328
msgid "IPv6 network in address/netmask notation"
-msgstr ""
+msgstr "地址/网络掩码表示法中的 IPv6 网络"
#: protocols/luci-proto-ipv6/luasrc/model/cbi/admin_network/proto_6rd.lua:26
#: protocols/luci-proto-ipv6/luasrc/model/cbi/admin_network/proto_map.lua:37
@@ -2955,7 +2957,7 @@ msgstr "最大可达数据速率(ATTNDR)"
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/wifi.lua:527
msgid "Maximum allowed Listen Interval"
-msgstr ""
+msgstr "允许的最大监听间隔"
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/dhcp.lua:193
msgid "Maximum allowed number of active DHCP leases"
@@ -3048,14 +3050,14 @@ msgstr "主机型号"
#: protocols/luci-proto-ncm/luasrc/model/cbi/admin_network/proto_ncm.lua:31
msgid "Modem default"
-msgstr ""
+msgstr "调制解调器默认"
#: protocols/luci-proto-3g/luasrc/model/cbi/admin_network/proto_3g.lua:11
#: protocols/luci-proto-ncm/luasrc/model/cbi/admin_network/proto_ncm.lua:19
#: protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_ppp.lua:11
#: protocols/luci-proto-qmi/luasrc/model/cbi/admin_network/proto_qmi.lua:10
msgid "Modem device"
-msgstr "调制解调器节点"
+msgstr "调制解调器设备"
#: protocols/luci-proto-ncm/luasrc/model/network/proto_ncm.lua:66
msgid "Modem information query failed"
@@ -3333,7 +3335,7 @@ msgstr "缓存的 DNS 条目数量(最大 10000,0 表示不缓存)"
#: modules/luci-mod-system/luasrc/model/cbi/admin_system/system.lua:125
msgid "Number of parallel threads used for compression"
-msgstr ""
+msgstr "用于压缩的并行线程数"
#: modules/luci-mod-system/luasrc/view/admin_system/packages.htm:106
msgid "OK"
@@ -3780,7 +3782,7 @@ msgstr "请输入用户名和密码。"
#: modules/luci-mod-system/luasrc/view/admin_system/packages.htm:105
#: modules/luci-mod-system/luasrc/view/admin_system/packages.htm:113
msgid "Please update package lists first"
-msgstr ""
+msgstr "请先更新软件包列表"
#: modules/luci-mod-status/luasrc/view/admin_status/iptables.htm:87
msgid "Policy"
@@ -4262,7 +4264,7 @@ msgstr "路由表描述了数据包的可达路径。"
#: modules/luci-mod-status/luasrc/view/admin_status/iptables.htm:281
msgid "Rule"
-msgstr ""
+msgstr "规则"
#: modules/luci-mod-system/luasrc/model/cbi/admin_system/fstab/mount.lua:148
msgid "Run a filesystem check before mounting the device"
@@ -4311,7 +4313,7 @@ msgstr "SSID"
#: modules/luci-mod-system/luasrc/model/cbi/admin_system/fstab.lua:236
msgid "SWAP"
-msgstr ""
+msgstr "交换分区"
#: modules/luci-base/luasrc/view/cbi/error.htm:17
#: modules/luci-base/luasrc/view/cbi/footer.htm:26
@@ -4326,11 +4328,11 @@ msgstr "保存并应用"
#: modules/luci-mod-system/luasrc/view/admin_system/flashops.htm:89
msgid "Save mtdblock"
-msgstr ""
+msgstr "保存 mtdblock"
#: modules/luci-mod-system/luasrc/view/admin_system/flashops.htm:64
msgid "Save mtdblock contents"
-msgstr ""
+msgstr "保存 mtdblock 内容"
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/wifi_overview.lua:82
msgid "Scan"
@@ -4363,6 +4365,8 @@ msgid ""
"fails. Use only if you are sure that the firmware is correct and meant for "
"your device!"
msgstr ""
+"即使映像文件检查失败,也“强制升级”以烧录映像。仅在您确定固件正确且适用于您的"
+"设备时使用!"
#: protocols/luci-proto-3g/luasrc/model/cbi/admin_network/proto_3g.lua:119
#: protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_ppp.lua:90
@@ -4438,7 +4442,7 @@ msgstr "显示当前备份文件列表"
#: modules/luci-mod-status/luasrc/view/admin_status/iptables.htm:140
msgid "Show empty chains"
-msgstr ""
+msgstr "显示空链"
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/network.lua:53
msgid "Shutdown this interface"
@@ -4477,7 +4481,7 @@ msgstr "DNS 查询缓存的大小"
#: modules/luci-mod-system/luasrc/model/cbi/admin_system/system.lua:113
msgid "Size of the ZRam device in megabytes"
-msgstr ""
+msgstr "ZRam 设备的大小(以兆字节为单位)"
#: modules/luci-base/luasrc/view/cbi/footer.htm:18
#: modules/luci-base/luasrc/view/cbi/simpleform.htm:57
@@ -4627,7 +4631,7 @@ msgstr ""
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/wifi.lua:522
msgid "Station inactivity limit"
-msgstr ""
+msgstr "非活动站点限制"
#: modules/luci-base/luasrc/controller/admin/index.lua:40
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/ifaces.lua:197
@@ -5065,7 +5069,7 @@ msgstr "尚未配置时间同步。"
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/wifi.lua:513
msgid "Time interval for rekeying GTK"
-msgstr ""
+msgstr "重新加密 GTK 的时间间隔"
#: modules/luci-mod-system/luasrc/model/cbi/admin_system/system.lua:44
msgid "Timezone"
@@ -5664,19 +5668,19 @@ msgstr ""
#: modules/luci-mod-system/luasrc/model/cbi/admin_system/system.lua:118
msgid "ZRam Compression Algorithm"
-msgstr ""
+msgstr "ZRam 压缩算法"
#: modules/luci-mod-system/luasrc/model/cbi/admin_system/system.lua:125
msgid "ZRam Compression Streams"
-msgstr ""
+msgstr "ZRam 压缩流"
#: modules/luci-mod-system/luasrc/model/cbi/admin_system/system.lua:25
msgid "ZRam Settings"
-msgstr ""
+msgstr "ZRam 设置"
#: modules/luci-mod-system/luasrc/model/cbi/admin_system/system.lua:113
msgid "ZRam Size"
-msgstr ""
+msgstr "ZRam 大小"
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/dhcp.lua:187
msgid "any"
@@ -5781,7 +5785,7 @@ msgstr "半双工"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:589
msgid "hexadecimal encoded value"
-msgstr ""
+msgstr "十六进制编码值"
#: modules/luci-mod-network/luasrc/view/admin_network/wifi_join.htm:162
msgid "hidden"
@@ -5836,11 +5840,11 @@ msgstr "kbit/s"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:427
msgid "key between 8 and 63 characters"
-msgstr ""
+msgstr "密钥在 8 到 63 个字符之间"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:439
msgid "key with either 5 or 13 characters"
-msgstr ""
+msgstr "密钥为 5 或 13 个字符"
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/dhcp.lua:50
msgid "local <abbr title=\"Domain Name System\">DNS</abbr> file"
@@ -5866,7 +5870,7 @@ msgstr "未连接"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:241
msgid "non-empty value"
-msgstr ""
+msgstr "非空值"
#: modules/luci-mod-system/luasrc/view/admin_system/packages.htm:156
#: modules/luci-mod-system/luasrc/view/admin_system/packages.htm:157
@@ -5905,6 +5909,8 @@ msgid ""
"one of:\n"
" - %s"
msgstr ""
+"其一:\n"
+" - %s"
#: modules/luci-mod-network/luasrc/view/admin_network/wifi_join.htm:71
msgid "open"
@@ -5920,11 +5926,11 @@ msgstr "覆盖"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:273
msgid "positive decimal value"
-msgstr ""
+msgstr "正十进制值"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:265
msgid "positive integer value"
-msgstr ""
+msgstr "正整数值"
#: protocols/luci-proto-wireguard/luasrc/model/cbi/admin_network/proto_wireguard.lua:34
msgid "random"
@@ -5943,7 +5949,7 @@ msgstr "已路由"
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/wifi.lua:513
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/wifi.lua:522
msgid "sec"
-msgstr ""
+msgstr "秒"
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/ifaces.lua:525
#: modules/luci-mod-network/luasrc/model/cbi/admin_network/ifaces.lua:531
@@ -5972,7 +5978,7 @@ msgstr "时间单位(TUs / 1.024ms)[1000-65535]"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:579
msgid "unique value"
-msgstr ""
+msgstr "唯一值"
#: modules/luci-mod-network/luasrc/view/admin_network/wifi_join.htm:69
msgid "unknown"
@@ -5999,159 +6005,159 @@ msgstr "未标记"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:278
msgid "valid IP address"
-msgstr ""
+msgstr "有效 IP 地址"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:278
msgid "valid IP address or prefix"
-msgstr ""
+msgstr "有效 IP 地址或前缀"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:313
msgid "valid IPv4 CIDR"
-msgstr ""
+msgstr "有效 IPv4 CIDR"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:286
msgid "valid IPv4 address"
-msgstr ""
+msgstr "有效 IPv4 地址"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:286
msgid "valid IPv4 address or network"
-msgstr ""
+msgstr "有效 IPv4 地址或网络"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:406
msgid "valid IPv4 address:port"
-msgstr ""
+msgstr "有效 IPv4 address:port"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:346
msgid "valid IPv4 network"
-msgstr ""
+msgstr "有效 IPv4 网络"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:308
msgid "valid IPv4 or IPv6 CIDR"
-msgstr ""
+msgstr "有效 IPv4 或 IPv6 CIDR"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:299
msgid "valid IPv4 prefix value (0-32)"
-msgstr ""
+msgstr "有效 IPv4 前缀值(0-32)"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:318
msgid "valid IPv6 CIDR"
-msgstr ""
+msgstr "有效 IPv6 CIDR"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:294
msgid "valid IPv6 address"
-msgstr ""
+msgstr "有效 IPv6 地址"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:294
msgid "valid IPv6 address or prefix"
-msgstr ""
+msgstr "有效 IPv6 地址或前缀"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:336
msgid "valid IPv6 host id"
-msgstr ""
+msgstr "有效 IPv6 主机 ID"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:351
msgid "valid IPv6 network"
-msgstr ""
+msgstr "有效 IPv6 网络"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:304
msgid "valid IPv6 prefix value (0-128)"
-msgstr ""
+msgstr "有效 IPv6 前缀值(0-128)"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:372
msgid "valid MAC address"
-msgstr ""
+msgstr "有效 MAC 地址"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:443
msgid "valid UCI identifier"
-msgstr ""
+msgstr "有效 UCI 识别"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:394
msgid "valid UCI identifier, hostname or IP address"
-msgstr ""
+msgstr "有效 UCI 标识符,主机名或 IP 地址"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:415
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:418
msgid "valid address:port"
-msgstr ""
+msgstr "有效 address:port"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:553
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:557
msgid "valid date (YYYY-MM-DD)"
-msgstr ""
+msgstr "有效日期(YYYY-MM-DD)"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:269
msgid "valid decimal value"
-msgstr ""
+msgstr "有效十进制值"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:437
msgid "valid hexadecimal WEP key"
-msgstr ""
+msgstr "有效十六进制 WEP 密钥"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:425
msgid "valid hexadecimal WPA key"
-msgstr ""
+msgstr "有效十六进制 WPA 密钥"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:400
msgid "valid host:port"
-msgstr ""
+msgstr "有效 host:port"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:387
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:389
msgid "valid hostname"
-msgstr ""
+msgstr "有效主机名"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:377
msgid "valid hostname or IP address"
-msgstr ""
+msgstr "有效主机名或 IP 地址"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:261
msgid "valid integer value"
-msgstr ""
+msgstr "有效整数值"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:341
msgid "valid network in address/netmask notation"
-msgstr ""
+msgstr "地址/网络掩码表示法中的有效网络"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:528
msgid "valid phone digit (0-9, \"*\", \"#\", \"!\" or \".\")"
-msgstr ""
+msgstr "有效电话号码(0-9、“*”、“#”、“!”或“.”)"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:364
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:367
msgid "valid port or port range (port1-port2)"
-msgstr ""
+msgstr "有效端口或端口范围(port1-port2)"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:356
msgid "valid port value"
-msgstr ""
+msgstr "有效端口值"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:533
msgid "valid time (HH:MM:SS)"
-msgstr ""
+msgstr "有效时间(HH:MM:SS)"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:462
msgid "value between %d and %d characters"
-msgstr ""
+msgstr "%d 和 %d 字符之间的值"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:448
msgid "value between %f and %f"
-msgstr ""
+msgstr "%f 和 %f 之间的值"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:452
msgid "value greater or equal to %f"
-msgstr ""
+msgstr "值大于或等于 %f"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:456
msgid "value smaller or equal to %f"
-msgstr ""
+msgstr "值小于或等于 %f"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:467
msgid "value with at least %d characters"
-msgstr ""
+msgstr "值至少为 %d 个字符"
#: modules/luci-base/htdocs/luci-static/resources/cbi.js:472
msgid "value with at most %d characters"
-msgstr ""
+msgstr "值至多为 %d 个字符"
#: modules/luci-mod-network/luasrc/view/admin_network/iface_overview_status.htm:44
#: modules/luci-mod-system/luasrc/model/cbi/admin_system/fstab.lua:221
diff --git a/modules/luci-mod-freifunk/Makefile b/modules/luci-mod-freifunk/Makefile
index 550db1df15..70de10879c 100644
--- a/modules/luci-mod-freifunk/Makefile
+++ b/modules/luci-mod-freifunk/Makefile
@@ -7,7 +7,7 @@
include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI Freifunk module
-LUCI_DEPENDS:=+luci-mod-admin-full +luci-lib-json +freifunk-firewall +freifunk-common
+LUCI_DEPENDS:=+luci-mod-admin-full +luci-lib-json +luci-lib-ipkg +freifunk-firewall +freifunk-common
include ../../luci.mk
diff --git a/modules/luci-mod-status/luasrc/view/admin_status/index.htm b/modules/luci-mod-status/luasrc/view/admin_status/index.htm
index 54e35b82a0..b98ba76f89 100644
--- a/modules/luci-mod-status/luasrc/view/admin_status/index.htm
+++ b/modules/luci-mod-status/luasrc/view/admin_status/index.htm
@@ -132,21 +132,17 @@
<%+header%>
<script type="text/javascript">//<![CDATA[
- function progressbar(v, m)
+ function progressbar(q, v, m)
{
- var vn = parseInt(v) || 0;
- var mn = parseInt(m) || 100;
- var pc = Math.floor((100 / mn) * vn);
-
- return String.format(
- '<div style="width:100%%; max-width:200px; position:relative; border:1px solid #999999">' +
- '<div style="background-color:#CCCCCC; width:%d%%; height:15px">' +
- '<div style="position:absolute; left:0; top:0; text-align:center; width:100%%; color:#000000">' +
- '<small>%s / %s (%d%%)</small>' +
- '</div>' +
- '</div>' +
- '</div>', pc, v, m, pc
- );
+ var pg = document.querySelector(q),
+ vn = parseInt(v) || 0,
+ mn = parseInt(m) || 100,
+ pc = Math.floor((100 / mn) * vn);
+
+ if (pg) {
+ pg.firstElementChild.style.width = pc + '%';
+ pg.setAttribute('title', '%s / %s (%d%%)'.format(v, m, pc));
+ }
}
function labelList(items, offset) {
@@ -350,38 +346,28 @@
info.loadavg[2] / 65535.0
);
- if (e = document.getElementById('memtotal'))
- e.innerHTML = progressbar(
- ((info.memory.free + info.memory.buffered) / 1024) + " <%:kB%>",
- (info.memory.total / 1024) + " <%:kB%>"
- );
+ progressbar('#memtotal',
+ ((info.memory.free + info.memory.buffered) / 1024) + " <%:kB%>",
+ (info.memory.total / 1024) + " <%:kB%>");
- if (e = document.getElementById('memfree'))
- e.innerHTML = progressbar(
- (info.memory.free / 1024) + " <%:kB%>",
- (info.memory.total / 1024) + " <%:kB%>"
- );
+ progressbar('#memfree',
+ (info.memory.free / 1024) + " <%:kB%>",
+ (info.memory.total / 1024) + " <%:kB%>");
- if (e = document.getElementById('membuff'))
- e.innerHTML = progressbar(
- (info.memory.buffered / 1024) + " <%:kB%>",
- (info.memory.total / 1024) + " <%:kB%>"
- );
+ progressbar('#membuff',
+ (info.memory.buffered / 1024) + " <%:kB%>",
+ (info.memory.total / 1024) + " <%:kB%>");
- if (e = document.getElementById('swaptotal'))
- e.innerHTML = progressbar(
- (info.swap.free / 1024) + " <%:kB%>",
- (info.swap.total / 1024) + " <%:kB%>"
- );
+ progressbar('#swaptotal',
+ (info.swap.free / 1024) + " <%:kB%>",
+ (info.swap.total / 1024) + " <%:kB%>");
- if (e = document.getElementById('swapfree'))
- e.innerHTML = progressbar(
- (info.swap.free / 1024) + " <%:kB%>",
- (info.swap.total / 1024) + " <%:kB%>"
- );
+ progressbar('#swapfree',
+ (info.swap.free / 1024) + " <%:kB%>",
+ (info.swap.total / 1024) + " <%:kB%>");
- if (e = document.getElementById('conns'))
- e.innerHTML = progressbar(info.conncount, info.connmax);
+ progressbar('#conns',
+ info.conncount, info.connmax);
}
);
@@ -411,9 +397,9 @@
<h3><%:Memory%></h3>
<div class="table" width="100%">
- <div class="tr"><div class="td left" width="33%"><%:Total Available%></div><div class="td left" id="memtotal">-</div></div>
- <div class="tr"><div class="td left" width="33%"><%:Free%></div><div class="td left" id="memfree">-</div></div>
- <div class="tr"><div class="td left" width="33%"><%:Buffered%></div><div class="td left" id="membuff">-</div></div>
+ <div class="tr"><div class="td left" width="33%"><%:Total Available%></div><div class="td left"><div id="memtotal" class="cbi-progressbar" title="-"><div></div></div></div></div>
+ <div class="tr"><div class="td left" width="33%"><%:Free%></div><div class="td left"><div id="memfree" class="cbi-progressbar" title="-"><div></div></div></div></div>
+ <div class="tr"><div class="td left" width="33%"><%:Buffered%></div><div class="td left"><div id="membuff" class="cbi-progressbar" title="-"><div></div></div></div></div>
</div>
</div>
@@ -422,8 +408,8 @@
<h3><%:Swap%></h3>
<div class="table" width="100%">
- <div class="tr"><div class="td left" width="33%"><%:Total Available%></div><div class="td left" id="swaptotal">-</div></div>
- <div class="tr"><div class="td left" width="33%"><%:Free%></div><div class="td left" id="swapfree">-</div></div>
+ <div class="tr"><div class="td left" width="33%"><%:Total Available%></div><div class="td left"><div id="swaptotal" class="cbi-progressbar" title="-"><div></div></div></div></div>
+ <div class="tr"><div class="td left" width="33%"><%:Free%></div><div class="td left"><div id="swapfree" class="cbi-progressbar" title="-"><div></div></div></div></div>
</div>
</div>
<% end %>
@@ -436,7 +422,7 @@
</div>
<div class="table" width="100%">
- <div class="tr"><div class="td left" width="33%"><%:Active Connections%></div><div class="td left" id="conns">-</div></div>
+ <div class="tr"><div class="td left" width="33%"><%:Active Connections%></div><div class="td left"><div id="conns" class="cbi-progressbar" title="-"><div></div></div></div></div>
</div>
</div>
diff --git a/modules/luci-mod-system/luasrc/controller/admin/system.lua b/modules/luci-mod-system/luasrc/controller/admin/system.lua
index 4e83769ee0..68ca88b980 100644
--- a/modules/luci-mod-system/luasrc/controller/admin/system.lua
+++ b/modules/luci-mod-system/luasrc/controller/admin/system.lua
@@ -11,12 +11,6 @@ function index()
entry({"admin", "system", "clock_status"}, post_on({ set = true }, "action_clock_status"))
entry({"admin", "system", "admin"}, cbi("admin_system/admin"), _("Administration"), 2)
-
- if fs.access("/bin/opkg") then
- entry({"admin", "system", "packages"}, post_on({ exec = "1" }, "action_packages"), _("Software"), 10)
- entry({"admin", "system", "packages", "ipkg"}, form("admin_system/ipkg"))
- end
-
entry({"admin", "system", "startup"}, form("admin_system/startup"), _("Startup"), 45)
entry({"admin", "system", "crontab"}, form("admin_system/crontab"), _("Scheduled Tasks"), 46)
@@ -61,124 +55,6 @@ function action_clock_status()
luci.http.write_json({ timestring = os.date("%c") })
end
-function action_packages()
- local fs = require "nixio.fs"
- local ipkg = require "luci.model.ipkg"
- local submit = (luci.http.formvalue("exec") == "1")
- local update, upgrade
- local changes = false
- local install = { }
- local remove = { }
- local stdout = { "" }
- local stderr = { "" }
- local out, err
-
- -- Display
- local display = luci.http.formvalue("display") or "available"
-
- -- Letter
- local letter = string.byte(luci.http.formvalue("letter") or "A", 1)
- letter = (letter == 35 or (letter >= 65 and letter <= 90)) and letter or 65
-
- -- Search query
- local query = luci.http.formvalue("query")
- query = (query ~= '') and query or nil
-
-
- -- Modifying actions
- if submit then
- -- Packets to be installed
- local ninst = luci.http.formvalue("install")
- local uinst = nil
-
- -- Install from URL
- local url = luci.http.formvalue("url")
- if url and url ~= '' then
- uinst = url
- end
-
- -- Do install
- if ninst then
- install[ninst], out, err = ipkg.install(ninst)
- stdout[#stdout+1] = out
- stderr[#stderr+1] = err
- changes = true
- end
-
- if uinst then
- local pkg
- for pkg in luci.util.imatch(uinst) do
- install[uinst], out, err = ipkg.install(pkg)
- stdout[#stdout+1] = out
- stderr[#stderr+1] = err
- changes = true
- end
- end
-
- -- Remove packets
- local rem = luci.http.formvalue("remove")
- if rem then
- remove[rem], out, err = ipkg.remove(rem)
- stdout[#stdout+1] = out
- stderr[#stderr+1] = err
- changes = true
- end
-
-
- -- Update all packets
- update = luci.http.formvalue("update")
- if update then
- update, out, err = ipkg.update()
- stdout[#stdout+1] = out
- stderr[#stderr+1] = err
- end
-
-
- -- Upgrade all packets
- upgrade = luci.http.formvalue("upgrade")
- if upgrade then
- upgrade, out, err = ipkg.upgrade()
- stdout[#stdout+1] = out
- stderr[#stderr+1] = err
- end
- end
-
-
- -- List state
- local no_lists = true
- local old_lists = false
- if fs.access("/var/opkg-lists/") then
- local list
- for list in fs.dir("/var/opkg-lists/") do
- no_lists = false
- if (fs.stat("/var/opkg-lists/"..list, "mtime") or 0) < (os.time() - (24 * 60 * 60)) then
- old_lists = true
- break
- end
- end
- end
-
-
- luci.template.render("admin_system/packages", {
- display = display,
- letter = letter,
- query = query,
- install = install,
- remove = remove,
- update = update,
- upgrade = upgrade,
- no_lists = no_lists,
- old_lists = old_lists,
- stdout = table.concat(stdout, ""),
- stderr = table.concat(stderr, "")
- })
-
- -- Remove index cache
- if changes then
- fs.unlink("/tmp/luci-indexcache")
- end
-end
-
local function image_supported(image)
return (os.execute("sysupgrade -T %q >/dev/null" % image) == 0)
end
@@ -301,38 +177,32 @@ 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 (#force > 0) and "192.168.1.1" or nil
})
- fork_exec("sleep 1; killall dropbear uhttpd; sleep 1; /sbin/sysupgrade %s %s %q" %{ keep, force, image_tmp })
+ luci.sys.process.exec({ "/bin/sh", "-c","sleep 1; killall dropbear uhttpd; sleep 1; /sbin/sysupgrade %s %s %q" %{ keep, force, image_tmp } }, nil, nil, true)
end
end
function action_backup()
- local reader = ltn12_popen("sysupgrade --create-backup - 2>/dev/null")
-
- luci.http.header(
- 'Content-Disposition', 'attachment; filename="backup-%s-%s.tar.gz"' %{
- luci.sys.hostname(),
- os.date("%Y-%m-%d")
- })
+ luci.http.header('Content-Disposition', 'attachment; filename="backup-%s-%s.tar.gz"'
+ %{ luci.sys.hostname(), os.date("%Y-%m-%d") })
luci.http.prepare_content("application/x-targz")
- luci.ltn12.pump.all(reader, luci.http.write)
+ luci.sys.process.exec({ "/sbin/sysupgrade", "--create-backup", "-" }, luci.http.write)
end
function action_backupmtdblock()
- local http = require "luci.http"
- local mv = http.formvalue("mtdblockname")
- local m, s, n = mv:match('^([^%s]+)/([^%s]+)/([^%s]+)')
+ local mv = luci.http.formvalue("mtdblockname") or ""
+ local m, n = mv:match('^([^%s%./"]+)/%d+/(%d+)$')
- local reader = ltn12_popen("dd if=/dev/mtd%s conv=fsync,notrunc 2>/dev/null" % n)
+ if not m and n then
+ luci.http.status(400, "Bad Request")
+ return
+ end
- luci.http.header(
- 'Content-Disposition', 'attachment; filename="backup-%s-%s-%s.bin"' %{
- luci.sys.hostname(), m,
- os.date("%Y-%m-%d")
- })
+ luci.http.header('Content-Disposition', 'attachment; filename="backup-%s-%s-%s.bin"'
+ %{ luci.sys.hostname(), m, os.date("%Y-%m-%d") })
luci.http.prepare_content("application/octet-stream")
- luci.ltn12.pump.all(reader, luci.http.write)
+ luci.sys.process.exec({ "/bin/dd", "if=/dev/mtd%s" % n, "conv=fsync,notrunc" }, luci.http.write)
end
function action_restore()
@@ -387,7 +257,7 @@ function action_reset()
addr = "192.168.1.1"
})
- fork_exec("sleep 1; killall dropbear uhttpd; sleep 1; jffs2reset -y && reboot")
+ luci.sys.process.exec({ "/bin/sh", "-c", "sleep 1; killall dropbear uhttpd; sleep 1; jffs2reset -y && reboot" }, nil, nil, true)
return
end
@@ -413,57 +283,3 @@ end
function action_reboot()
luci.sys.reboot()
end
-
-function fork_exec(command)
- local pid = nixio.fork()
- if pid > 0 then
- return
- elseif pid == 0 then
- -- change to root dir
- nixio.chdir("/")
-
- -- patch stdin, out, err to /dev/null
- local null = nixio.open("/dev/null", "w+")
- if null then
- nixio.dup(null, nixio.stderr)
- nixio.dup(null, nixio.stdout)
- nixio.dup(null, nixio.stdin)
- if null:fileno() > 2 then
- null:close()
- end
- end
-
- -- replace with target command
- nixio.exec("/bin/sh", "-c", command)
- end
-end
-
-function ltn12_popen(command)
-
- local fdi, fdo = nixio.pipe()
- local pid = nixio.fork()
-
- if pid > 0 then
- fdo:close()
- local close
- return function()
- local buffer = fdi:read(2048)
- local wpid, stat = nixio.waitpid(pid, "nohang")
- if not close and wpid and stat == "exited" then
- close = true
- end
-
- if buffer and #buffer > 0 then
- return buffer
- elseif close then
- fdi:close()
- return nil
- end
- end
- elseif pid == 0 then
- nixio.dup(fdo, nixio.stdout)
- fdi:close()
- fdo:close()
- nixio.exec("/bin/sh", "-c", command)
- end
-end
diff --git a/modules/luci-mod-system/luasrc/model/cbi/admin_system/ipkg.lua b/modules/luci-mod-system/luasrc/model/cbi/admin_system/ipkg.lua
deleted file mode 100644
index 7c6d7e1c66..0000000000
--- a/modules/luci-mod-system/luasrc/model/cbi/admin_system/ipkg.lua
+++ /dev/null
@@ -1,64 +0,0 @@
--- Copyright 2008 Steven Barth <steven@midlink.org>
--- Copyright 2008-2011 Jo-Philipp Wich <jow@openwrt.org>
--- Licensed to the public under the Apache License 2.0.
-
-local ipkgfile = "/etc/opkg.conf"
-local distfeeds = "/etc/opkg/distfeeds.conf"
-local customfeeds = "/etc/opkg/customfeeds.conf"
-
-f = SimpleForm("ipkgconf", translate("OPKG-Configuration"), translate("General options for opkg"))
-
-f:append(Template("admin_system/ipkg"))
-
-t = f:field(TextValue, "lines")
-t.wrap = "off"
-t.rows = 10
-function t.cfgvalue()
- return nixio.fs.readfile(ipkgfile) or ""
-end
-
-function t.write(self, section, data)
- return nixio.fs.writefile(ipkgfile, data:gsub("\r\n", "\n"))
-end
-
-function f.handle(self, state, data)
- return true
-end
-
-g = SimpleForm("distfeedconf", translate("Distribution feeds"),
- translate("Build/distribution specific feed definitions. This file will NOT be preserved in any sysupgrade."))
-
-d = g:field(TextValue, "lines2")
-d.wrap = "off"
-d.rows = 10
-function d.cfgvalue()
- return nixio.fs.readfile(distfeeds) or ""
-end
-
-function d.write(self, section, data)
- return nixio.fs.writefile(distfeeds, data:gsub("\r\n", "\n"))
-end
-
-function g.handle(self, state, data)
- return true
-end
-
-h = SimpleForm("customfeedconf", translate("Custom feeds"),
- translate("Custom feed definitions, e.g. private feeds. This file can be preserved in a sysupgrade."))
-
-c = h:field(TextValue, "lines3")
-c.wrap = "off"
-c.rows = 10
-function c.cfgvalue()
- return nixio.fs.readfile(customfeeds) or ""
-end
-
-function c.write(self, section, data)
- return nixio.fs.writefile(customfeeds, data:gsub("\r\n", "\n"))
-end
-
-function h.handle(self, state, data)
- return true
-end
-
-return f, g, h
diff --git a/modules/luci-mod-system/luasrc/view/admin_system/ipkg.htm b/modules/luci-mod-system/luasrc/view/admin_system/ipkg.htm
deleted file mode 100644
index a7ff4e50bd..0000000000
--- a/modules/luci-mod-system/luasrc/view/admin_system/ipkg.htm
+++ /dev/null
@@ -1,10 +0,0 @@
-<%#
- Copyright 2008 Steven Barth <steven@midlink.org>
- Copyright 2008 Jo-Philipp Wich <jow@openwrt.org>
- Licensed to the public under the Apache License 2.0.
--%>
-
-<ul class="cbi-tabmenu">
- <li class="cbi-tab-disabled"><a href="<%=url("admin/system/packages")%>"><%:Actions%></a></li>
- <li class="cbi-tab"><a href="#"><%:Configuration%></a></li>
-</ul>
diff --git a/modules/luci-mod-system/luasrc/view/admin_system/packages.htm b/modules/luci-mod-system/luasrc/view/admin_system/packages.htm
deleted file mode 100644
index 9e364d69ae..0000000000
--- a/modules/luci-mod-system/luasrc/view/admin_system/packages.htm
+++ /dev/null
@@ -1,213 +0,0 @@
-<%#
- Copyright 2008 Steven Barth <steven@midlink.org>
- Copyright 2008-2010 Jo-Philipp Wich <jow@openwrt.org>
- Licensed to the public under the Apache License 2.0.
--%>
-
-<%-
-local opkg = require "luci.model.ipkg"
-local fs = require "nixio.fs"
-local wa = require "luci.tools.webadmin"
-local rowcnt = 1
-
-function rowstyle()
- rowcnt = rowcnt + 1
- return (rowcnt % 2) + 1
-end
-
-local fstat = fs.statvfs(opkg.overlay_root())
-local space_total = fstat and fstat.blocks or 0
-local space_free = fstat and fstat.bfree or 0
-local space_used = space_total - space_free
-
-local used_perc = math.floor(0.5 + ((space_total > 0) and ((100 / space_total) * space_used) or 100))
-local free_byte = space_free * fstat.frsize
-
-local filter = { }
-
-
-local opkg_list = luci.model.ipkg.list_all
-local querypat
-if query and #query > 0 then
- querypat = '*%s*' % query
- opkg_list = luci.model.ipkg.find
-end
-
-local letterpat
-if letter == 35 then
- letterpat = "[^a-z]*"
-else
- letterpat = string.char(letter, 42) -- 'A' '*'
-end
-
--%>
-
-<%+header%>
-
-
-<h2 name="content"><%:Software%></h2>
-
-<div class="cbi-map">
-
- <ul class="cbi-tabmenu">
- <li class="cbi-tab"><a href="#"><%:Actions%></a></li>
- <li class="cbi-tab-disabled"><a href="<%=REQUEST_URI%>/ipkg"><%:Configuration%></a></li>
- </ul>
-
- <form method="post" action="<%=REQUEST_URI%>">
- <input type="hidden" name="exec" value="1" />
- <input type="hidden" name="token" value="<%=token%>" />
-
- <div class="cbi-section">
- <div class="cbi-section-node">
- <% if (install and next(install)) or (remove and next(remove)) or update or upgrade then %>
- <div class="cbi-value">
- <% if #stdout > 0 then %><pre><%=pcdata(stdout)%></pre><% end %>
- <% if #stderr > 0 then %><pre class="error"><%=pcdata(stderr)%></pre><% end %>
- </div>
- <% end %>
-
- <% if querypat then %>
- <div class="cbi-value">
- <%:Displaying only packages containing%> <strong>"<%=pcdata(query)%>"</strong>
- <input type="button" onclick="location.href='?display=<%=luci.http.urlencode(display)%>'" href="#" class="cbi-button cbi-button-reset" style="margin-left:1em" value="<%:Reset%>" />
- <br style="clear:both" />
- </div>
- <% end %>
-
- <% if no_lists or old_lists then %>
- <div class="cbi-value">
- <% if old_lists then %>
- <%:Package lists are older than 24 hours%>
- <% else %>
- <%:No package lists available%>
- <% end %>
- <input type="submit" name="update" href="#" class="cbi-button cbi-button-apply" style="margin-left:3em" value="<%:Update lists%>" />
- </div>
- <% end %>
-
- <div class="cbi-value cbi-value-last">
- <%:Free space%>: <strong><%=(100-used_perc)%>%</strong> (<strong><%=wa.byte_format(free_byte)%></strong>)
- <div style="margin:3px 0; width:300px; height:10px; border:1px solid #000000; background-color:#80C080" id="swfreespace">
- <div style="background-color:#F08080; border-right:1px solid #000000; height:100%; width:<%=used_perc%>%">&#160;</div>
- </div>
- </div>
- </div>
-
- <br />
-
- <div class="cbi-section-node">
- <input type="hidden" name="display" value="<%=pcdata(display)%>" />
-
- <div class="cbi-value">
- <label class="cbi-value-title"><%:Download and install package%>:</label>
- <div class="cbi-value-field">
- <span><input type="text" name="url" size="30" <% if no_lists then %>disabled="disabled" placeholder="<%:Please update package lists first%>"<% end %> value="" /></span>
- <input class="cbi-button cbi-button-save" type="submit" name="go" <% if no_lists then %>disabled="disabled"<% end %> value="<%:OK%>" />
- </div>
- </div>
-
- <div class="cbi-value cbi-value-last">
- <label class="cbi-value-title"><%:Filter%>:</label>
- <div class="cbi-value-field">
- <span><input type="text" name="query" size="20" <% if no_lists then %>disabled="disabled" placeholder="<%:Please update package lists first%>"<% else %>value="<%=pcdata(query)%>"<% end %> /></span>
- <input type="submit" class="cbi-button cbi-button-action" name="search" <% if no_lists then %>disabled="disabled"<% end %> value="<%:Find package%>" />
- </div>
- </div>
- </div>
- </div>
- </form>
-
-
- <h3><%:Status%></h3>
-
-
- <ul class="cbi-tabmenu">
- <li class="cbi-tab<% if display ~= "available" then %>-disabled<% end %>"><a href="?display=available&amp;query=<%=pcdata(query)%>"><%:Available packages%><% if query then %> (<%=pcdata(query)%>)<% end %></a></li>
- <li class="cbi-tab<% if display ~= "installed" then %>-disabled<% end %>"><a href="?display=installed&amp;query=<%=pcdata(query)%>"><%:Installed packages%><% if query then %> (<%=pcdata(query)%>)<% end %></a></li>
- </ul>
-
- <% if display ~= "available" then %>
- <div class="cbi-section">
- <div class="cbi-section-node">
- <div class="table">
- <div class="tr cbi-section-table-titles">
- <div class="th left"><%:Package name%></div>
- <div class="th left"><%:Version%></div>
- <div class="th cbi-section-actions">&#160;</div>
- </div>
- <% local empty = true; luci.model.ipkg.list_installed(querypat, function(n, v, s, d) empty = false; filter[n] = true %>
- <div class="tr cbi-rowstyle-<%=rowstyle()%>">
- <div class="td left"><%=luci.util.pcdata(n)%></div>
- <div class="td left"><%=luci.util.pcdata(v)%></div>
- <div class="td cbi-section-actions">
- <form method="post" class="inline" action="<%=REQUEST_URI%>">
- <input type="hidden" name="exec" value="1" />
- <input type="hidden" name="token" value="<%=token%>" />
- <input type="hidden" name="remove" value="<%=pcdata(n)%>" />
- <input class="cbi-button cbi-button-remove" type="submit" onclick="window.confirm('<%:Remove%> &quot;<%=luci.util.pcdata(n)%>&quot; ?') &#38;&#38; this.parentNode.submit(); return false" value="<%:Remove%>" />
- </form>
- </div>
- </div>
- <% end) %>
- <% if empty then %>
- <div class="tr cbi-section-table-row">
- <div class="td left">&#160;</div>
- <div class="td left"><em><%:none%></em></div>
- <div class="td left"><em><%:none%></em></div>
- </div>
- <% end %>
- </div>
- </div>
- </div>
- <% else %>
- <div class="cbi-section">
- <% if not querypat then %>
- <ul class="cbi-tabmenu" style="flex-wrap:wrap">
- <% local i; for i = 65, 90 do %>
- <li class="cbi-tab<% if letter ~= i then %>-disabled<% end %>"><a href="?display=available&amp;letter=<%=string.char(i)%>"><%=string.char(i)%></a></li>
- <% end %>
- <li class="cbi-tab<% if letter ~= 35 then %>-disabled<% end %>"><a href="?display=available&amp;letter=%23">#</a></li>
- </ul>
- <% end %>
- <div class="cbi-section-node cbi-section-node-tabbed">
- <div class="table">
- <div class="tr cbi-section-table-titles">
- <div class="th col-2 left"><%:Package name%></div>
- <div class="th col-2 left"><%:Version%></div>
- <div class="th col-1 center"><%:Size (.ipk)%></div>
- <div class="th col-10 left"><%:Description%></div>
- <div class="th cbi-section-actions">&#160;</div>
- </div>
- <% local empty = true; opkg_list(querypat or letterpat, function(n, v, s, d) if filter[n] then return end; empty = false %>
- <div class="tr cbi-rowstyle-<%=rowstyle()%>">
- <div class="td col-2 left"><%=luci.util.pcdata(n)%></div>
- <div class="td col-2 left"><%=luci.util.pcdata(v)%></div>
- <div class="td col-1 center"><%=luci.util.pcdata(s)%></div>
- <div class="td col-10 left"><%=luci.util.pcdata(d)%></div>
- <div class="td cbi-section-actions">
- <form method="post" class="inline" action="<%=REQUEST_URI%>">
- <input type="hidden" name="exec" value="1" />
- <input type="hidden" name="token" value="<%=token%>" />
- <input type="hidden" name="install" value="<%=pcdata(n)%>" />
- <input class="cbi-button cbi-button-apply" type="submit" onclick="window.confirm('<%:Install%> &quot;<%=luci.util.pcdata(n)%>&quot; ?') &#38;&#38; this.parentNode.submit(); return false" value="<%:Install%>" />
- </form>
- </div>
- </div>
- <% end) %>
- <% if empty then %>
- <div class="tr">
- <div class="td left">&#160;</div>
- <div class="td left"><em><%:none%></em></div>
- <div class="td left"><em><%:none%></em></div>
- <div class="td right"><em><%:none%></em></div>
- <div class="td left"><em><%:none%></em></div>
- </div>
- <% end %>
- </div>
- </div>
- </div>
- <% end %>
-</div>
-
-<%+footer%>