From 93ed525c00ae809ce813f120b6c260fd197ca311 Mon Sep 17 00:00:00 2001 From: Nitin Kumar Maharana Date: Wed, 9 Sep 2015 12:42:15 +0530 Subject: [PATCH] CLOUDSTACK-8821: Provide appropriate message in the UI when configuring the Firewall rules. --- .../classes/resources/messages.properties | 2 ++ ui/dictionary.jsp | 2 ++ ui/scripts/network.js | 29 +++++++++++++++++++ 3 files changed, 33 insertions(+) diff --git a/client/WEB-INF/classes/resources/messages.properties b/client/WEB-INF/classes/resources/messages.properties index 492b46ee8b4..a2edde35b55 100644 --- a/client/WEB-INF/classes/resources/messages.properties +++ b/client/WEB-INF/classes/resources/messages.properties @@ -2172,3 +2172,5 @@ label.ssh.key.pairs=SSH Key Pairs message.desc.create.ssh.key.pair=Please fill in the following data to create or register a ssh key pair.

(1) If public key is set, CloudStack will register the public key. You can use it through your private key.

(2) If public key is not set, CloudStack will create a new SSH Key pair. In this case, please copy and save the private key. CloudStack will not keep it.
message.removed.ssh.key.pair=Removed a SSH Key Pair message.please.select.ssh.key.pair.use.with.this.vm=Please select a ssh key pair you want this VM to use: +message.configure.firewall.rules.allow.traffic=Configure the rules to allow Traffic +message.configure.firewall.rules.block.traffic=Configure the rules to block Traffic \ No newline at end of file diff --git a/ui/dictionary.jsp b/ui/dictionary.jsp index 7d172670f73..4161498da3e 100644 --- a/ui/dictionary.jsp +++ b/ui/dictionary.jsp @@ -1041,5 +1041,7 @@ dictionary = { 'label.role': '', 'label.root.disk.controller': '', 'label.root.disk.offering': '', +'message.configure.firewall.rules.allow.traffic': '', +'message.configure.firewall.rules.block.traffic': '', }; diff --git a/ui/scripts/network.js b/ui/scripts/network.js index e59ef095867..110bc4b98e4 100755 --- a/ui/scripts/network.js +++ b/ui/scripts/network.js @@ -1410,6 +1410,7 @@ title: 'label.egress.rules', custom: function(args) { var context = args.context; + var isConfigRulesMsgShown = false; return $('
').multiEdit({ context: context, @@ -1612,6 +1613,34 @@ }); } }); + + if (!isConfigRulesMsgShown) { + isConfigRulesMsgShown = true; + $.ajax({ + url: createURL('listNetworkOfferings'), + data: { + id: args.context.networks[0].networkofferingid + }, + dataType: 'json', + async: true, + success: function(json) { + var response = json.listnetworkofferingsresponse.networkoffering ? + json.listnetworkofferingsresponse.networkoffering[0] : null; + + if (response != null) { + if (response.egressdefaultpolicy == true) { + cloudStack.dialog.notice({ + message: _l('message.configure.firewall.rules.block.traffic') + }); + } else { + cloudStack.dialog.notice({ + message: _l('message.configure.firewall.rules.allow.traffic') + }); + } + } + } + }); + } } }); }