luci: Fix restart service when pressed on Save&Apply or Restart buttons

This commit is contained in:
remittor
2026-01-27 13:52:28 +03:00
parent e0dbf3653d
commit 5860c9829a
4 changed files with 75 additions and 35 deletions

View File

@@ -24,7 +24,7 @@ return view.extend({
return;
}
this.svc_info = data.svc_info;
tools.checkAndRestartSvc(this.svc_info);
tools.execDefferedAction(this.svc_info);
let m, s, o, tabname;
@@ -458,10 +458,14 @@ return view.extend({
handleSaveApply: function(ev, mode)
{
return this.handleSave(ev).then(() => {
ui.changes.apply(mode == '0');
if (this.svc_info?.dmn.inited) {
localStorage.setItem(tools.skey_need_restart, '1');
console.log('STOR KEY: '+tools.skey_need_restart+' = 1');
let apply_exec = tools.checkUnsavedChanges();
if (apply_exec) {
ui.changes.apply(mode == '0');
tools.setDefferedAction('restart', this.svc_info);
} else {
if (this.svc_info?.dmn.inited) {
tools.serviceActionEx('restart');
}
}
});
},