luci-app-firewall: use Firewall.removeZone() helper
authorJo-Philipp Wich <jo@mein.io>
Thu, 26 Mar 2020 18:14:47 +0000 (19:14 +0100)
committerJo-Philipp Wich <jo@mein.io>
Thu, 26 Mar 2020 18:15:27 +0000 (19:15 +0100)
Fixes: FS#2932
Ref: https://bugs.openwrt.org/index.php?do=details&task_id=2932
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/zones.js

index fe9ef75c5a37bc2cebf0f3777234e61aaf433e2d..85c126d7aed77a240db4907bc2c3ec13e85bfb4b 100644 (file)
@@ -82,6 +82,12 @@ return L.view.extend({
                s.anonymous = true;
                s.sortable  = true;
 
+               s.handleRemove = function(section_id, ev) {
+                       return firewall.deleteZone(section_id).then(L.bind(function() {
+                               return this.super('handleRemove', [section_id, ev]);
+                       }, this));
+               };
+
                s.tab('general', _('General Settings'));
                s.tab('advanced', _('Advanced Settings'));
                s.tab('conntrack', _('Conntrack Settings'));