mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-27 10:50:10 +03:00
Feature #3175: Improve SG wizard
This commit is contained in:
parent
1ed22ef3c4
commit
d4b42ca9f3
@ -22,10 +22,20 @@ function initialize_create_security_group_dialog(dialog){
|
||||
setupTips(dialog);
|
||||
|
||||
dialog.on("change", '.security_group_rule_protocol', function(){
|
||||
if ( $(this).val() == "ICMP" ){
|
||||
$('.icmp_type_wrapper', dialog).show();
|
||||
} else {
|
||||
switch ($(this).val()) {
|
||||
case "TCP":
|
||||
case "UDP":
|
||||
$('.range_row', dialog).show();
|
||||
$('.icmp_type_wrapper', dialog).hide();
|
||||
break;
|
||||
case "ICMP":
|
||||
$('.range_row', dialog).hide();
|
||||
$('.icmp_type_wrapper', dialog).show();
|
||||
break;
|
||||
case "IPSEC":
|
||||
$('.range_row', dialog).hide();
|
||||
$('.icmp_type_wrapper', dialog).hide();
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
@ -134,7 +144,7 @@ function initialize_create_security_group_dialog(dialog){
|
||||
|
||||
$('#create_security_group_form_wizard',dialog).on('invalid', function () {
|
||||
notifyError(tr("One or more required fields are missing or malformed."));
|
||||
popFormDialog("create_security_group_form", $("#secgroup-tab"));
|
||||
popFormDialog("create_security_group_form", $("#secgroups-tab"));
|
||||
}).on('valid', function() {
|
||||
|
||||
security_group_json = generate_json_security_group_from_form(this);
|
||||
@ -161,7 +171,7 @@ function initialize_create_security_group_dialog(dialog){
|
||||
|
||||
$('#create_security_group_form_advanced',dialog).on('invalid.fndtn.abide', function () {
|
||||
notifyError(tr("One or more required fields are missing or malformed."));
|
||||
popFormDialog("create_security_group_form", $("#secgroup-tab"));
|
||||
popFormDialog("create_security_group_form", $("#secgroups-tab"));
|
||||
}).on('valid.fndtn.abide', function() {
|
||||
if ($('#create_security_group_form_advanced',dialog).attr("action") == "create") {
|
||||
|
||||
@ -326,7 +336,7 @@ var create_security_group_wizard_html =
|
||||
<div class="row">\
|
||||
<div class="medium-4 columns">\
|
||||
<label for="security_group_name">'+tr("Security Group Name")+':</label>\
|
||||
<input type="text" name="security_group_name" id="security_group_name" />\
|
||||
<input required type="text" name="security_group_name" id="security_group_name"/>\
|
||||
</div>\
|
||||
<div class="medium-8 columns">\
|
||||
<label for="security_group_description">'+tr("Description")+'\
|
||||
@ -362,10 +372,42 @@ var create_security_group_wizard_html =
|
||||
<label>'+tr("ICMP Type")+'\
|
||||
<span class="tip">'+tr("TODO")+'</span>\
|
||||
</label>\
|
||||
<input class="security_group_rule_icmp_type" type="text"/>\
|
||||
<select class="security_group_rule_icmp_type">\
|
||||
<option value="" selected="selected">'+tr("All")+'</option>\
|
||||
<option value = "0">'+"0: Echo Reply"+'</option>\
|
||||
<option value = "3">'+"3: Destination Unreachable"+'</option>\
|
||||
<option value = "4">'+"4: Source Quench"+'</option>\
|
||||
<option value = "5">'+"5: Redirect"+'</option>\
|
||||
<option value = "6">'+"6: Alternate Host Address"+'</option>\
|
||||
<option value = "8">'+"8: Echo"+'</option>\
|
||||
<option value = "9">'+"9: Router Advertisement"+'</option>\
|
||||
<option value = "10">'+"10: Router Solicitation"+'</option>\
|
||||
<option value = "11">'+"11: Time Exceeded"+'</option>\
|
||||
<option value = "12">'+"12: Parameter Problem"+'</option>\
|
||||
<option value = "13">'+"13: Timestamp"+'</option>\
|
||||
<option value = "14">'+"14: Timestamp Reply"+'</option>\
|
||||
<option value = "15">'+"15: Information Request"+'</option>\
|
||||
<option value = "16">'+"16: Information Reply"+'</option>\
|
||||
<option value = "17">'+"17: Address Mask Request"+'</option>\
|
||||
<option value = "18">'+"18: Address Mask Reply"+'</option>\
|
||||
<option value = "30">'+"30: Traceroute"+'</option>\
|
||||
<option value = "31">'+"31: Datagram Conversion Error"+'</option>\
|
||||
<option value = "32">'+"32: Mobile Host Redirect"+'</option>\
|
||||
<option value = "33">'+"33: IPv6 Where-Are-You"+'</option>\
|
||||
<option value = "34">'+"34: IPv6 I-Am-Here"+'</option>\
|
||||
<option value = "35">'+"35: Mobile Registration Request"+'</option>\
|
||||
<option value = "36">'+"36: Mobile Registration Reply"+'</option>\
|
||||
<option value = "37">'+"37: Domain Name Request"+'</option>\
|
||||
<option value = "38">'+"38: Domain Name Reply"+'</option>\
|
||||
<option value = "39">'+"39: SKIP"+'</option>\
|
||||
<option value = "40">'+"40: Photuris"+'</option>\
|
||||
<option value = "41">'+"41: ICMP messages utilized by experimental mobility protocols such as Seamoby"+'</option>\
|
||||
<option value = "253">'+"253: RFC3692-style Experiment 1"+'</option>\
|
||||
<option value = "254">'+"254: RFC3692-style Experiment 2"+'</option>\
|
||||
</select>\
|
||||
</div>\
|
||||
</div>\
|
||||
<div class="row">\
|
||||
<div class="row range_row">\
|
||||
<div class="medium-4 columns">\
|
||||
<label>'+tr("Range")+'\
|
||||
<span class="tip">'+tr("TODO")+'</span>\
|
||||
|
@ -6569,37 +6569,39 @@ function generateAdvancedSection(opts){
|
||||
//==============================================================================
|
||||
|
||||
function icmp_to_st(icmp_type){
|
||||
switch( parseInt(icmp_type) ){
|
||||
case 0: return "0: Echo Reply";
|
||||
case 3: return "3: Destination Unreachable";
|
||||
case 4: return "4: Source Quench";
|
||||
case 5: return "5: Redirect";
|
||||
case 6: return "6: Alternate Host Address";
|
||||
case 8: return "8: Echo";
|
||||
case 9: return "9: Router Advertisement";
|
||||
case 10: return "10: Router Solicitation";
|
||||
case 11: return "11: Time Exceeded";
|
||||
case 12: return "12: Parameter Problem";
|
||||
case 13: return "13: Timestamp";
|
||||
case 14: return "14: Timestamp Reply";
|
||||
case 15: return "15: Information Request";
|
||||
case 16: return "16: Information Reply";
|
||||
case 17: return "17: Address Mask Request";
|
||||
case 18: return "18: Address Mask Reply";
|
||||
case 30: return "30: Traceroute";
|
||||
case 31: return "31: Datagram Conversion Error";
|
||||
case 32: return "32: Mobile Host Redirect";
|
||||
case 33: return "33: IPv6 Where-Are-You";
|
||||
case 34: return "34: IPv6 I-Am-Here";
|
||||
case 35: return "35: Mobile Registration Request";
|
||||
case 36: return "36: Mobile Registration Reply";
|
||||
case 37: return "37: Domain Name Request";
|
||||
case 38: return "38: Domain Name Reply";
|
||||
case 39: return "39: SKIP";
|
||||
case 40: return "40: Photuris";
|
||||
case 41: return "41: ICMP messages utilized by experimental mobility protocols such as Seamoby";
|
||||
case 253: return "253: RFC3692-style Experiment 1";
|
||||
case 254: return "254: RFC3692-style Experiment 2";
|
||||
switch( icmp_type ){
|
||||
case "": return tr("All");
|
||||
case "0": return "0: Echo Reply";
|
||||
case "0": return "0: Echo Reply";
|
||||
case "3": return "3: Destination Unreachable";
|
||||
case "4": return "4: Source Quench";
|
||||
case "5": return "5: Redirect";
|
||||
case "6": return "6: Alternate Host Address";
|
||||
case "8": return "8: Echo";
|
||||
case "9": return "9: Router Advertisement";
|
||||
case "10": return "10: Router Solicitation";
|
||||
case "11": return "11: Time Exceeded";
|
||||
case "12": return "12: Parameter Problem";
|
||||
case "13": return "13: Timestamp";
|
||||
case "14": return "14: Timestamp Reply";
|
||||
case "15": return "15: Information Request";
|
||||
case "16": return "16: Information Reply";
|
||||
case "17": return "17: Address Mask Request";
|
||||
case "18": return "18: Address Mask Reply";
|
||||
case "30": return "30: Traceroute";
|
||||
case "31": return "31: Datagram Conversion Error";
|
||||
case "32": return "32: Mobile Host Redirect";
|
||||
case "33": return "33: IPv6 Where-Are-You";
|
||||
case "34": return "34: IPv6 I-Am-Here";
|
||||
case "35": return "35: Mobile Registration Request";
|
||||
case "36": return "36: Mobile Registration Reply";
|
||||
case "37": return "37: Domain Name Request";
|
||||
case "38": return "38: Domain Name Reply";
|
||||
case "39": return "39: SKIP";
|
||||
case "40": return "40: Photuris";
|
||||
case "41": return "41: ICMP messages utilized by experimental mobility protocols such as Seamoby";
|
||||
case "253": return "253: RFC3692-style Experiment 1";
|
||||
case "254": return "254: RFC3692-style Experiment 2";
|
||||
default: return "" + icmp_type;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user