luci: service: Rewrite func serviceActionEx

This commit is contained in:
remittor
2026-01-26 16:08:37 +03:00
parent e2c6c0552e
commit 83bf86b2f8
3 changed files with 59 additions and 81 deletions

View File

@@ -148,6 +148,13 @@ return baseclass.extend({
ui.addNotification(null, E('p', _('Service action failed "%s %s": %s').format(name, action, e)));
});
},
checkUnsavedChanges: function()
{
if (!ui.changes) return false;
if (!ui.changes.changes) return false;
return ui.changes.changes[this.appName] ? true : false;
},
normalizeValue: function(v) {
return (v && typeof(v) === 'string') ? v.trim().replace(/\r?\n/g, '') : v;