\
\
\
Path to the initrd image
\
@@ -290,7 +290,7 @@ var create_template_tmpl = '
\
\
\
\
-
\
+
\
\
\
@@ -326,14 +326,61 @@ var create_template_tmpl = '
\
\
Hardware that will emulate this network interface. With Xen this is the type attribute of the vif.
\
\
+
\
+ \
+ \
+
\
+
\
+
\
+
\
+
\
+
Permits access to the VM only through the specified ports in the TCP protocol
\
+
\
+
\
+
\
+
\
+
Disallow access to the VM through the specified ports in the TCP protocol
\
+
\
+
\
+ \
+ \
+
\
+
\
+
\
+
\
+
\
+
Permits access to the VM only through the specified ports in the UDP protocol
\
+
\
+
\
+
\
+
\
+
Disallow access to the VM through the specified ports in the UDP protocol
\
+
\
+
\
+
\
+
\
+
ICMP policy
\
+
\
+
\
\
\
-
\
-
\
-
\
-
\
-
\
+
\
+
\
+
\
+
\
+
\
\
\
\
@@ -1448,6 +1495,7 @@ function setupCreateTemplateDialog(){
var networks_setup = function(){
$('.vm_param',section_networks).hide();
+ $('.firewall_select').hide();
$('fieldset',section_networks).hide();
$('#add_networks',section_networks).click(function(){
@@ -1459,6 +1507,12 @@ function setupCreateTemplateDialog(){
//some fields
$('#network_vs_niccfg input',section_networks).click(function(){
+ //firewall
+ $('.firewall',section_networks).hide();
+ $('.firewall',section_networks).attr("disabled","disabled");
+ $('.firewall_select',section_networks).show();
+ $('.firewall_select select option',section_networks).removeAttr("selected");
+
select = $('#network_vs_niccfg :checked',section_networks).val();
switch (select) {
case "network":
@@ -1477,6 +1531,50 @@ function setupCreateTemplateDialog(){
//hide_disabled(section_networks);
});
+ $('#black_white_tcp',section_networks).live("change",function(){
+ switch ($(this).val()) {
+ case "whitelist":
+ $('#BLACK_PORTS_TCP',section_networks).parent().attr("disabled","disabled");
+ $('#BLACK_PORTS_TCP',section_networks).parent().hide();
+ $('#WHITE_PORTS_TCP',section_networks).parent().removeAttr("disabled");
+ $('#WHITE_PORTS_TCP',section_networks).parent().show();
+ break;
+ case "blacklist":
+ $('#WHITE_PORTS_TCP',section_networks).parent().attr("disabled","disabled");
+ $('#WHITE_PORTS_TCP',section_networks).parent().hide();
+ $('#BLACK_PORTS_TCP',section_networks).parent().removeAttr("disabled");
+ $('#BLACK_PORTS_TCP',section_networks).parent().show();
+ break;
+ default:
+ $('#WHITE_PORTS_TCP',section_networks).parent().attr("disabled","disabled");
+ $('#WHITE_PORTS_TCP',section_networks).parent().hide();
+ $('#BLACK_PORTS_TCP',section_networks).parent().attr("disabled","disabled");
+ $('#BLACK_PORTS_TCP',section_networks).parent().hide();
+ };
+ });
+
+ $('#black_white_udp',section_networks).live("change",function(){
+ switch ($(this).val()) {
+ case "whitelist":
+ $('#BLACK_PORTS_UDP',section_networks).parent().attr("disabled","disabled");
+ $('#BLACK_PORTS_UDP',section_networks).parent().hide();
+ $('#WHITE_PORTS_UDP',section_networks).parent().removeAttr("disabled");
+ $('#WHITE_PORTS_UDP',section_networks).parent().show();
+ break;
+ case "blacklist":
+ $('#WHITE_PORTS_UDP',section_networks).parent().attr("disabled","disabled");
+ $('#WHITE_PORTS_UDP',section_networks).parent().hide();
+ $('#BLACK_PORTS_UDP',section_networks).parent().removeAttr("disabled");
+ $('#BLACK_PORTS_UDP',section_networks).parent().show();
+ break;
+ default:
+ $('#WHITE_PORTS_UDP',section_networks).parent().attr("disabled","disabled");
+ $('#WHITE_PORTS_UDP',section_networks).parent().hide();
+ $('#BLACK_PORTS_UDP',section_networks).parent().attr("disabled","disabled");
+ $('#BLACK_PORTS_UDP',section_networks).parent().hide();
+ };
+ });
+
//The filter to add a new network checks that we have selected a
//network, or that the ip or mac are set
//TODO: Improve this check