Skip to content

Commit 93ed525

Browse files
author
Nitin Kumar Maharana
committed
CLOUDSTACK-8821: Provide appropriate message in the UI when configuring the Firewall rules.
1 parent dd9ba48 commit 93ed525

3 files changed

Lines changed: 33 additions & 0 deletions

File tree

client/WEB-INF/classes/resources/messages.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2172,3 +2172,5 @@ label.ssh.key.pairs=SSH Key Pairs
21722172
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>
21732173
message.removed.ssh.key.pair=Removed a SSH Key Pair
21742174
message.please.select.ssh.key.pair.use.with.this.vm=Please select a ssh key pair you want this VM to use:
2175+
message.configure.firewall.rules.allow.traffic=Configure the rules to allow Traffic
2176+
message.configure.firewall.rules.block.traffic=Configure the rules to block Traffic

ui/dictionary.jsp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,5 +1041,7 @@ dictionary = {
10411041
'label.role': '<fmt:message key="label.role" />',
10421042
'label.root.disk.controller': '<fmt:message key="label.root.disk.controller" />',
10431043
'label.root.disk.offering': '<fmt:message key="label.root.disk.offering" />',
1044+
'message.configure.firewall.rules.allow.traffic': '<fmt:message key="message.configure.firewall.rules.allow.traffic" />',
1045+
'message.configure.firewall.rules.block.traffic': '<fmt:message key="message.configure.firewall.rules.block.traffic" />',
10441046
};
10451047
</script>

ui/scripts/network.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1410,6 +1410,7 @@
14101410
title: 'label.egress.rules',
14111411
custom: function(args) {
14121412
var context = args.context;
1413+
var isConfigRulesMsgShown = false;
14131414

14141415
return $('<div>').multiEdit({
14151416
context: context,
@@ -1612,6 +1613,34 @@
16121613
});
16131614
}
16141615
});
1616+
1617+
if (!isConfigRulesMsgShown) {
1618+
isConfigRulesMsgShown = true;
1619+
$.ajax({
1620+
url: createURL('listNetworkOfferings'),
1621+
data: {
1622+
id: args.context.networks[0].networkofferingid
1623+
},
1624+
dataType: 'json',
1625+
async: true,
1626+
success: function(json) {
1627+
var response = json.listnetworkofferingsresponse.networkoffering ?
1628+
json.listnetworkofferingsresponse.networkoffering[0] : null;
1629+
1630+
if (response != null) {
1631+
if (response.egressdefaultpolicy == true) {
1632+
cloudStack.dialog.notice({
1633+
message: _l('message.configure.firewall.rules.block.traffic')
1634+
});
1635+
} else {
1636+
cloudStack.dialog.notice({
1637+
message: _l('message.configure.firewall.rules.allow.traffic')
1638+
});
1639+
}
1640+
}
1641+
}
1642+
});
1643+
}
16151644
}
16161645
});
16171646
}

0 commit comments

Comments
 (0)