luci-app-banip: new button "Apply & Restart"
[project/luci.git] / applications / luci-app-banip / htdocs / luci-static / resources / view / banip / overview.js
index bb5804a90e74631a34c218ec7636feb230896de5..850b9a446f98488663a7f3aa6e63c1de34a3f720 100644 (file)
@@ -1,4 +1,5 @@
 'use strict';
+'require dom';
 'require view';
 'require poll';
 'require fs';
        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);