mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-01 09:43:56 +08:00
💐 Sync 2026-07-09 02:25:04
This commit is contained in:
1 parent
f077ddaf47
commit
2af7926aeb
37 files changed
+597
-329
No files matched your search
@@ -4,9 +4,22 @@
|
||||
'require baseclass';
|
||||
'require form';
|
||||
'require fs';
|
||||
'require ui';
|
||||
'require uci';
|
||||
'require view.daede.widgets as widgets';
|
||||
|
||||
function applyUciChanges() {
|
||||
return uci.save().then(function() {
|
||||
return uci.changes().then(function(ch) {
|
||||
return (ch && Object.keys(ch).length) ? uci.apply() : null;
|
||||
});
|
||||
}).then(function() {
|
||||
return new Promise(function(resolve) { window.setTimeout(resolve, 1800); });
|
||||
}).then(function() {
|
||||
return ui.changes.init();
|
||||
});
|
||||
}
|
||||
|
||||
function renderDaedSettings() {
|
||||
let m, s, o;
|
||||
m = new form.Map('daed', null, null);
|
||||
@@ -96,12 +109,7 @@ function renderDaedSettings() {
|
||||
ev.preventDefault();
|
||||
save.disabled = true;
|
||||
m.save(null, true)
|
||||
.then(function() { return uci.save(); })
|
||||
.then(function() {
|
||||
return uci.changes().then(function(ch) {
|
||||
return (ch && Object.keys(ch).length) ? uci.apply() : null;
|
||||
});
|
||||
})
|
||||
.then(applyUciChanges)
|
||||
.then(function() {
|
||||
const enabled = uci.get('daed', 'config', 'subscribe_auto_update') === '1';
|
||||
return fs.exec('/usr/share/luci-app-daede/daed-sub-cron.sh', [ enabled ? 'enable' : 'disable' ]);
|
||||
|
||||
Reference in new issue
Block a user