mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-10-31 23:55:13 +08:00
🐶 Sync 2026-10-08 01:07:04
This commit is contained in:
1 parent
31f25ca6cb
commit
ef5af2e0cc
283 files changed
+34710
-16084
No files matched your search
@@ -33,10 +33,10 @@ return view.extend({
|
||||
}),
|
||||
|
||||
callInitAction: rpc.declare({
|
||||
object: 'luci',
|
||||
method: 'setInitAction',
|
||||
object: 'rc',
|
||||
method: 'init',
|
||||
params: [ 'name', 'action' ],
|
||||
expect: { result: false }
|
||||
reject: true
|
||||
}),
|
||||
|
||||
callDDnsGetStatus: rpc.declare({
|
||||
@@ -164,22 +164,21 @@ return view.extend({
|
||||
},
|
||||
|
||||
handleReloadDDnsRule(m, section_id, ev) {
|
||||
return fs.exec('/usr/lib/ddns/dynamic_dns_lucihelper.sh',
|
||||
[ '-S', section_id, '--', 'start' ])
|
||||
return fs.exec('/etc/init.d/ddns', [ 'restart', section_id ])
|
||||
.then(L.bind(m.load, m))
|
||||
.then(L.bind(m.render, m))
|
||||
.catch(function(e) { ui.addNotification(null, E('p', e.message)) });
|
||||
},
|
||||
|
||||
handleStopDDnsRule(m, section_id, ev) {
|
||||
return fs.exec('/usr/lib/ddns/dynamic_dns_lucihelper.sh',
|
||||
[ '-S', section_id, '--', 'stop' ])
|
||||
return fs.exec('/etc/init.d/ddns', [ 'stop', section_id ])
|
||||
.then(L.bind(m.load, m))
|
||||
.then(L.bind(m.render, m))
|
||||
.catch(function(e) { ui.addNotification(null, E('p', e.message)) });
|
||||
},
|
||||
|
||||
handleToggleDDns(m, ev) {
|
||||
let action = this.status['_enabled'];
|
||||
let action = this.status['_enabled'];
|
||||
return this.callInitAction('ddns', action ? 'disable' : 'enable')
|
||||
.then(L.bind(function () { return this.callInitAction('ddns', action ? 'stop' : 'start')}, this))
|
||||
.then(L.bind(m.render, m))
|
||||
@@ -188,7 +187,8 @@ return view.extend({
|
||||
|
||||
handleRestartDDns(m, ev) {
|
||||
return this.callInitAction('ddns', 'restart')
|
||||
.then(L.bind(m.render, m));
|
||||
.then(L.bind(m.render, m))
|
||||
.catch(function(e) { ui.addNotification(null, E('p', e.message)) });
|
||||
},
|
||||
|
||||
poll_status(map, data) {
|
||||
@@ -220,8 +220,8 @@ return view.extend({
|
||||
const stop = rows[i].querySelector('.cbi-section-actions .stop');
|
||||
const cfg_enabled = uci.get('ddns', section_id, 'enabled');
|
||||
|
||||
reload.disabled = (status['_enabled'] == 0 || cfg_enabled == 0);
|
||||
stop.disabled = (!service[section_id].pid);
|
||||
reload.disabled = (cfg_enabled == 0)
|
||||
stop.disabled = !(service[section_id] && service[section_id].pid);
|
||||
|
||||
const host = uci.get('ddns', section_id, 'lookup_host') || _('Configuration Error');
|
||||
const ip = service[section_id]?.ip || _('No Data');
|
||||
@@ -555,11 +555,9 @@ return view.extend({
|
||||
'title': _('Stop this service'),
|
||||
};
|
||||
|
||||
if (status['_enabled'] == 0 || cfg_enabled == 0)
|
||||
if (cfg_enabled == 0)
|
||||
reload_opt['disabled'] = 'disabled';
|
||||
|
||||
if (!resolved[section_id] || !resolved[section_id].pid ||
|
||||
(resolved[section_id].pid && cfg_enabled == '1'))
|
||||
if (!(resolved[section_id] && resolved[section_id].pid))
|
||||
stop_opt['disabled'] = 'disabled';
|
||||
|
||||
dom.content(tdEl.lastChild, [
|
||||
@@ -879,6 +877,7 @@ return view.extend({
|
||||
o.modalonly = true;
|
||||
o.multiple = false;
|
||||
o.default = 'wan';
|
||||
o.rmempty = false;
|
||||
o.depends("ip_source", "web");
|
||||
o.depends("ip_source", "script");
|
||||
o.depends("ip_source", "interface");
|
||||
|
||||
Reference in new issue
Block a user