diff options
author | Dirk Brenken <dev@brenken.org> | 2024-04-26 19:13:12 +0200 |
---|---|---|
committer | Dirk Brenken <dev@brenken.org> | 2024-04-26 19:13:12 +0200 |
commit | 1661b210c80102fb77f1a61d5c658c54ac339289 (patch) | |
tree | 973fd91c33ee3be8394c342c731e5bb70973b2dd /applications/luci-app-banip/htdocs/luci-static/resources | |
parent | f8eb80bac75df3b69ec0713524c8bb1169d7d3b9 (diff) |
luci-app-banip: new button "Apply & Restart"
* Many changes to the user interface require a banIP restart, e.g. to restructure the underlying nft rule set. In this case, “Apply & Restart” saves the user an unnecessary “Save & Apply” (followed by a banIP reload & restart to obtain the new nft structure.
Signed-off-by: Dirk Brenken <dev@brenken.org>
Diffstat (limited to 'applications/luci-app-banip/htdocs/luci-static/resources')
-rw-r--r-- | applications/luci-app-banip/htdocs/luci-static/resources/view/banip/overview.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/applications/luci-app-banip/htdocs/luci-static/resources/view/banip/overview.js b/applications/luci-app-banip/htdocs/luci-static/resources/view/banip/overview.js index bb5804a90e..850b9a446f 100644 --- a/applications/luci-app-banip/htdocs/luci-static/resources/view/banip/overview.js +++ b/applications/luci-app-banip/htdocs/luci-static/resources/view/banip/overview.js @@ -1,4 +1,5 @@ 'use strict'; +'require dom'; 'require view'; 'require poll'; 'require fs'; @@ -11,6 +12,12 @@ button handling */ function handleAction(ev) { + if (ev === 'restart') { + let map = document.querySelector('.cbi-map'); + dom.callClassMethod(map, 'save').then(function() { + classes.ui.changes.apply(false); + }); + } return fs.exec_direct('/etc/init.d/banip', [ev]) } @@ -222,7 +229,7 @@ return view.extend({ 'click': ui.createHandlerFn(this, function () { return handleAction('restart'); }) - }, [_('Restart')]) + }, [_('Apply & Restart')]) ]) ]); }, o, this); |