mirror of
https://github.com/kiddin9/openwrt-packages.git
synced 2025-01-09 09:47:28 +08:00
🐶 Sync 2024-03-26 23:37:00
This commit is contained in:
parent
0f11168a48
commit
8d72950512
45
luci-base/htdocs/luci-static/resources/tools/views.js
Normal file
45
luci-base/htdocs/luci-static/resources/tools/views.js
Normal file
@ -0,0 +1,45 @@
|
||||
'use strict';
|
||||
'require fs';
|
||||
|
||||
var CBILogreadBox = function(logtag, name) {
|
||||
return L.view.extend({
|
||||
load: function() {
|
||||
return Promise.all([
|
||||
L.resolveDefault(fs.stat('/sbin/logread'), null),
|
||||
L.resolveDefault(fs.stat('/usr/sbin/logread'), null)
|
||||
]);
|
||||
},
|
||||
render: function(stat) {
|
||||
var logger = stat[0] ? stat[0].path : stat[1] ? stat[1].path : null;
|
||||
L.Poll.add(function() {
|
||||
return L.resolveDefault(fs.exec_direct(logger, ['-e', logtag])).then(function(res) {
|
||||
var log = document.getElementById("logfile");
|
||||
if (res) {
|
||||
log.value = res.trim();
|
||||
} else {
|
||||
log.value = _('No related logs yet!');
|
||||
}
|
||||
log.scrollTop = log.scrollHeight;
|
||||
});
|
||||
});
|
||||
return E('div', { class: 'cbi-map' },
|
||||
E('div', { class: 'cbi-section' }, [
|
||||
E('div', { class: 'cbi-section-descr' }, _('The syslog output, pre-filtered for messages related to: ' + name)),
|
||||
E('textarea', {
|
||||
'id': 'logfile',
|
||||
'style': 'width: 100% !important; padding: 5px; font-family: monospace',
|
||||
'readonly': 'readonly',
|
||||
'wrap': 'off',
|
||||
'rows': 25
|
||||
})
|
||||
]));
|
||||
},
|
||||
handleSaveApply: null,
|
||||
handleSave: null,
|
||||
handleReset: null
|
||||
});
|
||||
};
|
||||
|
||||
return L.Class.extend({
|
||||
LogreadBox: CBILogreadBox,
|
||||
});
|
@ -4548,7 +4548,7 @@ var UI = baseclass.extend(/** @lends LuCI.ui.prototype */ {
|
||||
E('p', _('Failed to confirm apply within %ds, waiting for rollback…')
|
||||
.format(L.env.apply_rollback)));
|
||||
|
||||
var call = function(r, data, duration) {
|
||||
var call = function(r) {
|
||||
if (r.status === 204) {
|
||||
UI.prototype.changes.displayStatus('warning', [
|
||||
E('h4', _('Configuration changes have been rolled back!')),
|
||||
@ -4572,13 +4572,13 @@ var UI = baseclass.extend(/** @lends LuCI.ui.prototype */ {
|
||||
return;
|
||||
}
|
||||
|
||||
var delay = isNaN(duration) ? 0 : Math.max(1000 - duration, 0);
|
||||
var delay = isNaN(r.duration) ? 0 : Math.max(1000 - r.duration, 0);
|
||||
window.setTimeout(function() {
|
||||
request.request(L.url('admin/uci/confirm'), {
|
||||
method: 'post',
|
||||
timeout: L.env.apply_timeout * 1000,
|
||||
query: { sid: L.env.sessionid, token: L.env.token }
|
||||
}).then(call, call.bind(null, { status: 0 }, null, 0));
|
||||
}).then(call, call.bind(null, { status: 0, duration: 0 }));
|
||||
}, delay);
|
||||
};
|
||||
|
||||
@ -4602,13 +4602,13 @@ var UI = baseclass.extend(/** @lends LuCI.ui.prototype */ {
|
||||
if (override_token)
|
||||
this.confirm_auth = { token: override_token };
|
||||
|
||||
var call = function(r, data, duration) {
|
||||
var call = function(r) {
|
||||
if (Date.now() >= deadline) {
|
||||
window.clearTimeout(tt);
|
||||
UI.prototype.changes.rollback(checked);
|
||||
return;
|
||||
}
|
||||
else if (r && (r.status === 200 || r.status === 204)) {
|
||||
else if (r.status === 200 || r.status === 204) {
|
||||
document.dispatchEvent(new CustomEvent('uci-applied'));
|
||||
|
||||
UI.prototype.changes.setIndicator(0);
|
||||
@ -4624,13 +4624,13 @@ var UI = baseclass.extend(/** @lends LuCI.ui.prototype */ {
|
||||
return;
|
||||
}
|
||||
|
||||
var delay = isNaN(duration) ? 0 : Math.max(1000 - duration, 0);
|
||||
var delay = isNaN(r.duration) ? 0 : Math.max(1000 - r.duration, 0);
|
||||
window.setTimeout(function() {
|
||||
request.request(L.url('admin/uci/confirm'), {
|
||||
method: 'post',
|
||||
timeout: L.env.apply_timeout * 1000,
|
||||
query: UI.prototype.changes.confirm_auth
|
||||
}).then(call, call);
|
||||
}).then(call, call.bind(null, { status: 0, duration: 0 }));
|
||||
}, delay);
|
||||
};
|
||||
|
||||
@ -4651,7 +4651,7 @@ var UI = baseclass.extend(/** @lends LuCI.ui.prototype */ {
|
||||
tick();
|
||||
|
||||
/* wait a few seconds for the settings to become effective */
|
||||
window.setTimeout(call, Math.max(L.env.apply_holdoff * 1000 - ((ts + L.env.apply_rollback * 1000) - deadline), 1));
|
||||
window.setTimeout(call.bind(null, { status: 0 }), L.env.apply_holdoff * 1000);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -2763,6 +2763,11 @@ msgstr ""
|
||||
msgid "Dual-Stack Lite (RFC6333)"
|
||||
msgstr "Dual-Stack Lite (RFC6333)"
|
||||
|
||||
#: modules/luci-compat/luasrc/model/network/proto_4x6.lua:20
|
||||
#: protocols/luci-proto-ipv6/htdocs/luci-static/resources/protocol/ipip6.js:10
|
||||
msgid "IPv4 over IPv6 (RFC2473-IPIPv6)"
|
||||
msgstr "IPv4 over IPv6 (ipip6)"
|
||||
|
||||
#: modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js:365
|
||||
msgid "Dump cache on SIGUSR1, include requesting IP."
|
||||
msgstr ""
|
||||
@ -5356,6 +5361,7 @@ msgstr "割り当てるローカル IPアドレス"
|
||||
#: protocols/luci-proto-gre/htdocs/luci-static/resources/protocol/gre.js:46
|
||||
#: protocols/luci-proto-gre/htdocs/luci-static/resources/protocol/gretap.js:46
|
||||
#: protocols/luci-proto-ipip/htdocs/luci-static/resources/protocol/ipip.js:44
|
||||
#: protocols/luci-proto-ipv6/htdocs/luci-static/resources/protocol/ipip6.js:44
|
||||
#: protocols/luci-proto-ipv6/htdocs/luci-static/resources/protocol/6in4.js:40
|
||||
#: protocols/luci-proto-ipv6/htdocs/luci-static/resources/protocol/6rd.js:39
|
||||
#: protocols/luci-proto-ipv6/htdocs/luci-static/resources/protocol/6to4.js:39
|
||||
@ -5373,6 +5379,7 @@ msgstr "ローカル IPv6 DNS サーバー"
|
||||
#: protocols/luci-proto-gre/htdocs/luci-static/resources/protocol/grev6tap.js:53
|
||||
#: protocols/luci-proto-ipv6/htdocs/luci-static/resources/protocol/6in4.js:54
|
||||
#: protocols/luci-proto-ipv6/htdocs/luci-static/resources/protocol/dslite.js:45
|
||||
#: protocols/luci-proto-ipv6/htdocs/luci-static/resources/protocol/ipip6.js:48
|
||||
#: protocols/luci-proto-vxlan/htdocs/luci-static/resources/protocol/vxlan6.js:44
|
||||
msgid "Local IPv6 address"
|
||||
msgstr "ローカルIPv6アドレス"
|
||||
@ -7874,6 +7881,7 @@ msgstr "リモートIPv6アドレス"
|
||||
|
||||
#: protocols/luci-proto-gre/htdocs/luci-static/resources/protocol/grev6.js:42
|
||||
#: protocols/luci-proto-gre/htdocs/luci-static/resources/protocol/grev6tap.js:42
|
||||
#: protocols/luci-proto-ipv6/htdocs/luci-static/resources/protocol/ipip6.js:40
|
||||
msgid "Remote IPv6 address or FQDN"
|
||||
msgstr "リモートIPv6アドレスまたはFQDN"
|
||||
|
||||
|
@ -2751,6 +2751,11 @@ msgstr ""
|
||||
msgid "Dual-Stack Lite (RFC6333)"
|
||||
msgstr "轻型双栈(RFC6333)"
|
||||
|
||||
#: modules/luci-compat/luasrc/model/network/proto_4x6.lua:20
|
||||
#: protocols/luci-proto-ipv6/htdocs/luci-static/resources/protocol/ipip6.js:10
|
||||
msgid "IPv4 over IPv6 (RFC2473-IPIPv6)"
|
||||
msgstr "IPv4 over IPv6 (RFC2473-IPIPv6)"
|
||||
|
||||
#: modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js:365
|
||||
msgid "Dump cache on SIGUSR1, include requesting IP."
|
||||
msgstr "转储 SIGUSR1 缓存,包括请求 IP。"
|
||||
@ -5315,6 +5320,7 @@ msgstr "要分配的本地 IP 地址"
|
||||
#: protocols/luci-proto-gre/htdocs/luci-static/resources/protocol/gre.js:46
|
||||
#: protocols/luci-proto-gre/htdocs/luci-static/resources/protocol/gretap.js:46
|
||||
#: protocols/luci-proto-ipip/htdocs/luci-static/resources/protocol/ipip.js:44
|
||||
#: protocols/luci-proto-ipv6/htdocs/luci-static/resources/protocol/ipip6.js:44
|
||||
#: protocols/luci-proto-ipv6/htdocs/luci-static/resources/protocol/6in4.js:40
|
||||
#: protocols/luci-proto-ipv6/htdocs/luci-static/resources/protocol/6rd.js:39
|
||||
#: protocols/luci-proto-ipv6/htdocs/luci-static/resources/protocol/6to4.js:39
|
||||
@ -5332,6 +5338,7 @@ msgstr "本地 IPV6 DNS 服务器"
|
||||
#: protocols/luci-proto-gre/htdocs/luci-static/resources/protocol/grev6tap.js:53
|
||||
#: protocols/luci-proto-ipv6/htdocs/luci-static/resources/protocol/6in4.js:54
|
||||
#: protocols/luci-proto-ipv6/htdocs/luci-static/resources/protocol/dslite.js:45
|
||||
#: protocols/luci-proto-ipv6/htdocs/luci-static/resources/protocol/ipip6.js:48
|
||||
#: protocols/luci-proto-vxlan/htdocs/luci-static/resources/protocol/vxlan6.js:44
|
||||
msgid "Local IPv6 address"
|
||||
msgstr "本机 IPv6 地址"
|
||||
@ -7814,6 +7821,7 @@ msgstr "远程 IPv6 地址"
|
||||
|
||||
#: protocols/luci-proto-gre/htdocs/luci-static/resources/protocol/grev6.js:42
|
||||
#: protocols/luci-proto-gre/htdocs/luci-static/resources/protocol/grev6tap.js:42
|
||||
#: protocols/luci-proto-ipv6/htdocs/luci-static/resources/protocol/ipip6.js:40
|
||||
msgid "Remote IPv6 address or FQDN"
|
||||
msgstr "远程 IPv6 地址或 FQDN"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user