From f2d2aa44a5df6ba352ecbc946348f5a9a8438542 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Thu, 1 Oct 2015 21:54:16 +0200 Subject: [PATCH] Change firewall url to match to other part of the UI --- src/js/app.js | 26 +++++++++---------- .../firewall.ms => tools/tools_firewall.ms} | 25 +++++++++--------- 2 files changed, 26 insertions(+), 25 deletions(-) rename src/views/{firewall/firewall.ms => tools/tools_firewall.ms} (81%) diff --git a/src/js/app.js b/src/js/app.js index d19c6375..0d446ec7 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -1472,7 +1472,7 @@ var app = Sammy('#main', function (sam) { */ // Firewall status - sam.get('#/firewall', function (c) { + sam.get('#/tools/firewall', function (c) { c.api('/firewall?raw', function(data) { var firewall = { ports : {}, @@ -1493,12 +1493,12 @@ var app = Sammy('#main', function (sam) { // Get UPnP status firewall.upnp = data.uPnP.enabled; - c.view('firewall/firewall', firewall); + c.view('tools/tools_firewall', firewall); }); }); // Enable/Disable UPnP - sam.get('#/firewall/upnp/:action', function (c) { + sam.get('#/tools/firewall/upnp/:action', function (c) { c.confirm( y18n.t('firewall'), y18n.t('confirm_upnp_action', [y18n.t(c.params['action'])]), @@ -1506,12 +1506,12 @@ var app = Sammy('#main', function (sam) { params = {'action' : c.params['action']}; c.api('/firewall/upnp', function(data) { store.clear('slide'); - c.redirect('#/firewall'); + c.redirect('#/tools/firewall'); }, 'GET', params); }, function(){ store.clear('slide'); - c.redirect('#/firewall'); + c.redirect('#/tools/firewall'); } ); }); @@ -1526,7 +1526,7 @@ var app = Sammy('#main', function (sam) { if (port != parseInt(port) || port < 0 || port > 65535) { c.flash('fail', y18n.t('unknown_argument', [port])); store.clear('slide'); - c.redirect('#/firewall'); + c.redirect('#/tools/firewall'); } switch (connection) { @@ -1559,7 +1559,7 @@ var app = Sammy('#main', function (sam) { default: c.flash('fail', y18n.t('unknown_action', [action])); store.clear('slide'); - c.redirect('#/firewall'); + c.redirect('#/tools/firewall'); } if (method !== null && protocol !== null && port !== null) { @@ -1577,19 +1577,19 @@ var app = Sammy('#main', function (sam) { }; c.api('/firewall/port?'+endurl, function(data) { store.clear('slide'); - c.redirect('#/firewall'); + c.redirect('#/tools/firewall'); }, method, params); } else { store.clear('slide'); - c.redirect('#/firewall'); + c.redirect('#/tools/firewall'); } return; }); // Update port status from direct link // #/firewall/port/{{@key}}/tcp/ipv4/close - sam.get('#/firewall/port/:port/:protocol/:connection/:action', function (c) { + sam.get('#/tools/firewall/port/:port/:protocol/:connection/:action', function (c) { c.confirm( y18n.t('firewall'), y18n.t( 'confirm_firewall', [ y18n.t(c.params['action']), c.params['port'], y18n.t(c.params['protocol']), y18n.t(c.params['connection'])]), @@ -1603,13 +1603,13 @@ var app = Sammy('#main', function (sam) { }, function(){ store.clear('slide'); - c.redirect('#/firewall'); + c.redirect('#/tools/firewall'); } ); }); // Update port status from form - sam.post('#/firewall/port', function (c) { + sam.post('#/tools/firewall/port', function (c) { c.confirm( y18n.t('firewall'), y18n.t('confirm_firewall', [ y18n.t(c.params['action']), c.params['port'], y18n.t(c.params['protocol']), y18n.t(c.params['connection']) ]), @@ -1623,7 +1623,7 @@ var app = Sammy('#main', function (sam) { }, function(){ store.clear('slide'); - c.redirect('#/firewall'); + c.redirect('#/tools/firewall'); } ); }); diff --git a/src/views/firewall/firewall.ms b/src/views/tools/tools_firewall.ms similarity index 81% rename from src/views/firewall/firewall.ms rename to src/views/tools/tools_firewall.ms index d9e01c8f..afe7e538 100644 --- a/src/views/firewall/firewall.ms +++ b/src/views/tools/tools_firewall.ms @@ -1,6 +1,7 @@
{{t 'home'}} - {{t 'firewall'}} + {{t 'tools'}} + {{t 'firewall'}}
@@ -28,20 +29,20 @@ {{#if this.ipv4}} - {{t 'close'}} + {{t 'close'}} {{else}} - {{t 'open'}} + {{t 'open'}} {{/if}} {{#if this.ipv6}} - {{t 'close'}} + {{t 'close'}} {{else}} - {{t 'open'}} + {{t 'open'}} {{/if}} @@ -74,20 +75,20 @@ {{#if this.ipv4}} - {{t 'close'}} + {{t 'close'}} {{else}} - {{t 'open'}} + {{t 'open'}} {{/if}} {{#if this.ipv6}} - {{t 'close'}} + {{t 'close'}} {{else}} - {{t 'open'}} + {{t 'open'}} {{/if}} @@ -121,7 +122,7 @@

{{t 'operations'}}

-
+
@@ -167,10 +168,10 @@
{{#if upnp}}

{{t 'upnp_enabled'}}

- {{t 'disable'}} + {{t 'disable'}} {{else}}

{{t 'upnp_disabled'}}

- {{t 'enable'}} + {{t 'enable'}} {{/if}}