From 1661b210c80102fb77f1a61d5c658c54ac339289 Mon Sep 17 00:00:00 2001 From: Dirk Brenken Date: Fri, 26 Apr 2024 19:13:12 +0200 Subject: luci-app-banip: new button "Apply & Restart" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 --- .../htdocs/luci-static/resources/view/banip/overview.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'applications/luci-app-banip/htdocs/luci-static/resources/view/banip/overview.js') 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); -- cgit v1.2.3