Merge pull request #791 from nitin-maharana/CloudStack-Nitin3

CLOUDSTACK-8821: UI Change while configuring firewall rule.It provides appropriate message in the UI when configuring the firewall rules in Network page.
If the default egress policy is allow, then it says to block traffic. If the default egress policy is deny, then it says to allow traffic.

* pr/791:
  CLOUDSTACK-8821: Provide appropriate message in the UI when configuring the Firewall rules.

Signed-off-by: Daan Hoogland <daan@onecht.net>
This commit is contained in:
Daan Hoogland 2015-09-11 13:52:18 +02:00
commit 6e2ac9974a
3 changed files with 33 additions and 0 deletions

View File

@ -2176,3 +2176,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.<br><br>(1) If public key is set, CloudStack will register the public key. You can use it through your private key.<br><br>(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.<br>
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

View File

@ -1041,5 +1041,7 @@ dictionary = {
'label.role': '<fmt:message key="label.role" />',
'label.root.disk.controller': '<fmt:message key="label.root.disk.controller" />',
'label.root.disk.offering': '<fmt:message key="label.root.disk.offering" />',
'message.configure.firewall.rules.allow.traffic': '<fmt:message key="message.configure.firewall.rules.allow.traffic" />',
'message.configure.firewall.rules.block.traffic': '<fmt:message key="message.configure.firewall.rules.block.traffic" />',
};
</script>

View File

@ -1410,6 +1410,7 @@
title: 'label.egress.rules',
custom: function(args) {
var context = args.context;
var isConfigRulesMsgShown = false;
return $('<div>').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')
});
}
}
}
});
}
}
});
}