mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-21 04:12:37 +09:00
feature #3748: User formPanel for vnet creation
This commit is contained in:
1 parent
1eb8e2f270
commit
96d28c2057
6 files changed
+615
-32
No files matched your search
@@ -7,9 +7,9 @@ define(function(require) {
|
||||
var TAB_ID = require('./vnets-tab/tabId');
|
||||
var DATATABLE_ID = "dataTableVNets";
|
||||
|
||||
var _dialogs = [
|
||||
require('./vnets-tab/dialogs/create')
|
||||
];
|
||||
//var _dialogs = [
|
||||
// require('./vnets-tab/dialogs/create')
|
||||
//];
|
||||
|
||||
var _panels = [
|
||||
require('./vnets-tab/panels/info'),
|
||||
@@ -18,6 +18,10 @@ define(function(require) {
|
||||
require('./vnets-tab/panels/secgroups')
|
||||
];
|
||||
|
||||
var _formPanels = [
|
||||
require('./vnets-tab/form-panels/create')
|
||||
]
|
||||
|
||||
var VNetsTab = {
|
||||
tabId: TAB_ID,
|
||||
title: Locale.tr("Virtual Networks"),
|
||||
@@ -32,7 +36,8 @@ define(function(require) {
|
||||
actions: Actions,
|
||||
dataTable: new Table(DATATABLE_ID, {actions: true, info: true}),
|
||||
panels: _panels,
|
||||
dialogs: _dialogs
|
||||
formPanels: _formPanels,
|
||||
//dialogs: _dialogs
|
||||
};
|
||||
|
||||
return VNetsTab;
|
||||
|
||||
@@ -6,16 +6,16 @@ define(function(require) {
|
||||
var OpenNebulaNetwork = require('opennebula/network');
|
||||
|
||||
var TAB_ID = require('./tabId');
|
||||
var CREATE_DIALOG_ID = require('./dialogs/create/dialogId');
|
||||
var CREATE_DIALOG_ID = require('./form-panels/create/formPanelId');
|
||||
|
||||
var _actions = {
|
||||
"Network.create" : {
|
||||
type: "create",
|
||||
call: OpenNebulaNetwork.create,
|
||||
callback: function(request, response) {
|
||||
Sunstone.getDialog(CREATE_DIALOG_ID).hide();
|
||||
Sunstone.getDialog(CREATE_DIALOG_ID).reset();
|
||||
DataTable.addElement(request, response);
|
||||
$("a[href=back]", $("#"+TAB_ID)).trigger("click");
|
||||
Sunstone.hideFormPanelLoading($("#"+TAB_ID));
|
||||
Sunstone.getDataTable(TAB_ID).addElement(request, response);
|
||||
},
|
||||
error: Notifier.onError,
|
||||
notify: true
|
||||
@@ -24,7 +24,7 @@ define(function(require) {
|
||||
"Network.create_dialog" : {
|
||||
type: "custom",
|
||||
call: function(){
|
||||
Sunstone.getDialog(CREATE_DIALOG_ID).show();
|
||||
Sunstone.showFormPanel(TAB_ID, CREATE_DIALOG_ID, "create");
|
||||
}
|
||||
},
|
||||
|
||||
@@ -236,14 +236,12 @@ define(function(require) {
|
||||
notify: true
|
||||
},
|
||||
|
||||
// TODO: update
|
||||
/*
|
||||
"Network.update_dialog" : {
|
||||
type: "custom",
|
||||
call: function(){
|
||||
var selected_nodes = getSelectedNodes(dataTable_vNetworks);
|
||||
var selected_nodes = Sunstone.getDataTable(TAB_ID).elements();
|
||||
if ( selected_nodes.length != 1 ) {
|
||||
notifyMessage("Please select one (and just one) Virtual Network to update.");
|
||||
Notifier.notifyMessage("Please select one (and just one) Virtual Network to update.");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -256,37 +254,26 @@ define(function(require) {
|
||||
type: "single",
|
||||
call: OpenNebulaNetwork.show,
|
||||
callback: function(request, response) {
|
||||
// TODO: global var, better use jquery .data
|
||||
vnet_to_update_id = response.VNET.ID;
|
||||
|
||||
Sunstone.popUpFormPanel("create_vnet_form", "vnets-tab", "update", true, function(context){
|
||||
fillVNetUpdateFormPanel(response.VNET, context);
|
||||
|
||||
$("#default_sg_warning").hide();
|
||||
});
|
||||
Sunstone.resetFormPanel(TAB_ID, CREATE_DIALOG_ID);
|
||||
Sunstone.showFormPanel(TAB_ID, CREATE_DIALOG_ID, "update", response.VNET);
|
||||
},
|
||||
error: Notifier.onError
|
||||
},
|
||||
*/
|
||||
|
||||
// TODO: update
|
||||
/*
|
||||
"Network.update" : {
|
||||
type: "single",
|
||||
call: OpenNebulaNetwork.update,
|
||||
callback: function(request, response){
|
||||
$("a[href=back]", $("#vnets-tab")).trigger("click");
|
||||
popFormDialog("create_vnet_form", $("#vnets-tab"));
|
||||
|
||||
notifyMessage(tr("Virtual Network updated correctly"));
|
||||
$("a[href=back]", $("#"+TAB_ID)).trigger("click");
|
||||
Sunstone.hideFormPanelLoading($("#"+TAB_ID));
|
||||
Notifier.notifyMessage(tr("Virtual Network updated correctly"));
|
||||
},
|
||||
error: function(request, response){
|
||||
popFormDialog("create_vnet_form", $("#vnets-tab"));
|
||||
|
||||
onError(request, response);
|
||||
Sunstone.hideFormPanelLoading($("#"+TAB_ID));
|
||||
Notifier.onError(request, response);
|
||||
}
|
||||
},
|
||||
*/
|
||||
|
||||
|
||||
"Network.update_template" : {
|
||||
type: "single",
|
||||
|
||||
@@ -0,0 +1,313 @@
|
||||
define(function(require) {
|
||||
/*
|
||||
DEPENDENCIES
|
||||
*/
|
||||
|
||||
require('foundation.tab');
|
||||
var BaseFormPanel = require('utils/form-panels/form-panel');
|
||||
var Sunstone = require('sunstone');
|
||||
var Locale = require('utils/locale');
|
||||
var Tips = require('utils/tips');
|
||||
|
||||
/*
|
||||
TEMPLATES
|
||||
*/
|
||||
|
||||
var TemplateWizardHTML = require('hbs!./create/wizard');
|
||||
var TemplateAdvancedHTML = require('hbs!./create/advanced');
|
||||
|
||||
/*
|
||||
CONSTANTS
|
||||
*/
|
||||
|
||||
var FORM_PANEL_ID = require('./create/formPanelId');
|
||||
|
||||
/*
|
||||
CONSTRUCTOR
|
||||
*/
|
||||
|
||||
function FormPanel() {
|
||||
this.formPanelId = FORM_PANEL_ID;
|
||||
this.actions = {
|
||||
'create': {
|
||||
'title': Locale.tr("Create Virtual Network"),
|
||||
'buttonText': Locale.tr("Create"),
|
||||
'resetButton': true
|
||||
},
|
||||
'update': {
|
||||
'title': Locale.tr("Update Virtual Network"),
|
||||
'buttonText': Locale.tr("Update"),
|
||||
'resetButton': false
|
||||
}
|
||||
}
|
||||
|
||||
BaseFormPanel.call(this);
|
||||
};
|
||||
|
||||
FormPanel.FORM_PANEL_ID = FORM_PANEL_ID;
|
||||
FormPanel.prototype = Object.create(BaseFormPanel.prototype);
|
||||
FormPanel.prototype.constructor = FormPanel;
|
||||
FormPanel.prototype.htmlWizard = _htmlWizard;
|
||||
FormPanel.prototype.htmlAdvanced = _htmlAdvanced;
|
||||
FormPanel.prototype.submitWizard = _submitWizard;
|
||||
FormPanel.prototype.submitAdvanced = _submitAdvanced;
|
||||
FormPanel.prototype.onShow = _onShow;
|
||||
FormPanel.prototype.setup = _setup;
|
||||
|
||||
return FormPanel;
|
||||
|
||||
/*
|
||||
FUNCTION DEFINITIONS
|
||||
*/
|
||||
|
||||
function _htmlWizard() {
|
||||
return TemplateWizardHTML({formPanelId: this.formPanelId});
|
||||
}
|
||||
|
||||
function _htmlAdvanced() {
|
||||
return TemplateAdvancedHTML({formPanelId: this.formPanelId});
|
||||
}
|
||||
|
||||
function _setup(context) {
|
||||
var number_of_ar = 0;
|
||||
|
||||
// close icon: removing the tab on click
|
||||
$("#vnetCreateARTab", context).on("click", "i.remove-tab", function() {
|
||||
var target = $(this).parent().attr("href");
|
||||
var dd = $(this).closest('dd');
|
||||
var dl = $(this).closest('dl');
|
||||
var content = $(target);
|
||||
|
||||
dd.remove();
|
||||
content.remove();
|
||||
|
||||
if (dd.attr("class") == 'active') {
|
||||
$('a', dl.children('dd').last()).click();
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
$("#vnet_wizard_ar_btn", context).bind("click", function() {
|
||||
// TODO add_ar_tab(number_of_ar, context);
|
||||
number_of_ar++;
|
||||
|
||||
context.foundation();
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
$("#vnetCreateARTab #vnetCreateARTabUpdate", context).hide();
|
||||
|
||||
$('#network_mode', context).change(function() {
|
||||
$('input,select#vlan,label[for!="network_mode"]', $(this).parent()).hide();
|
||||
$('input', $(this).parent()).val("");
|
||||
switch ($(this).val()) {
|
||||
case "default":
|
||||
$('input#bridge,label[for="bridge"]', context).show().prop('wizard_field_disabled', false);
|
||||
$('input#phydev,label[for="phydev"]', context).hide().prop('wizard_field_disabled', true);
|
||||
$('select#vlan,label[for="vlan"]', context).hide().prop('wizard_field_disabled', true);
|
||||
$('input#vlan_id,label[for="vlan_id"]', context).hide().prop('wizard_field_disabled', true);
|
||||
$('input#ip_spoofing,label[for="ip_spoofing"]', context).show().prop('wizard_field_disabled', false);
|
||||
$('input#mac_spoofing,label[for="mac_spoofing"]', context).show().prop('wizard_field_disabled', false);
|
||||
$('input#mtu,label[for="mtu"]', context).hide().prop('wizard_field_disabled', false);
|
||||
|
||||
$('input#phydev', context).removeAttr('required');
|
||||
$('input#bridge', context).attr('required', '');
|
||||
break;
|
||||
case "802.1Q":
|
||||
$('input#bridge,label[for="bridge"]', context).show().prop('wizard_field_disabled', false);
|
||||
$('input#phydev,label[for="phydev"]', context).show().prop('wizard_field_disabled', false);
|
||||
$('select#vlan,label[for="vlan"]', context).show().prop('wizard_field_disabled', false);
|
||||
$('input#vlan_id,label[for="vlan_id"]', context).show().prop('wizard_field_disabled', false);
|
||||
$('input#ip_spoofing,label[for="ip_spoofing"]', context).show().prop('wizard_field_disabled', false);
|
||||
$('input#mac_spoofing,label[for="mac_spoofing"]', context).show().prop('wizard_field_disabled', false);
|
||||
$('input#mtu,label[for="mtu"]', context).show().prop('wizard_field_disabled', false);
|
||||
|
||||
$('input#phydev', context).removeAttr('required');
|
||||
$('input#bridge', context).removeAttr('required');
|
||||
break;
|
||||
case "vxlan":
|
||||
$('input#bridge,label[for="bridge"]', context).show().prop('wizard_field_disabled', false);
|
||||
$('input#phydev,label[for="phydev"]', context).show().prop('wizard_field_disabled', false);
|
||||
$('select#vlan,label[for="vlan"]', context).show().prop('wizard_field_disabled', false);
|
||||
$('input#vlan_id,label[for="vlan_id"]', context).show().prop('wizard_field_disabled', false);
|
||||
$('input#ip_spoofing,label[for="ip_spoofing"]', context).show().prop('wizard_field_disabled', false);
|
||||
$('input#mac_spoofing,label[for="mac_spoofing"]', context).show().prop('wizard_field_disabled', false);
|
||||
$('input#mtu,label[for="mtu"]', context).show().prop('wizard_field_disabled', false);
|
||||
|
||||
$('input#phydev', context).removeAttr('required');
|
||||
$('input#bridge', context).removeAttr('required');
|
||||
break;
|
||||
case "ebtables":
|
||||
$('input#bridge,label[for="bridge"]', context).show().prop('wizard_field_disabled', false);
|
||||
$('input#phydev,label[for="phydev"]', context).hide().prop('wizard_field_disabled', true);
|
||||
$('select#vlan,label[for="vlan"]', context).show().prop('wizard_field_disabled', false);
|
||||
$('input#vlan_id,label[for="vlan_id"]', context).hide().prop('wizard_field_disabled', true);
|
||||
$('input#ip_spoofing,label[for="ip_spoofing"]', context).show().prop('wizard_field_disabled', false);
|
||||
$('input#mac_spoofing,label[for="mac_spoofing"]', context).show().prop('wizard_field_disabled', false);
|
||||
$('input#mtu,label[for="mtu"]', context).hide().prop('wizard_field_disabled', false);
|
||||
|
||||
$('input#phydev', context).removeAttr('required');
|
||||
$('input#bridge', context).attr('required', '');
|
||||
break;
|
||||
case "openvswitch":
|
||||
$('input#bridge,label[for="bridge"]', context).show().prop('wizard_field_disabled', false);
|
||||
$('input#phydev,label[for="phydev"]', context).hide().prop('wizard_field_disabled', true);
|
||||
$('select#vlan,label[for="vlan"]', context).show().prop('wizard_field_disabled', false);
|
||||
$('input#vlan_id,label[for="vlan_id"]', context).show().prop('wizard_field_disabled', false);
|
||||
$('input#ip_spoofing,label[for="ip_spoofing"]', context).hide().prop('wizard_field_disabled', true);
|
||||
$('input#mac_spoofing,label[for="mac_spoofing"]', context).show().prop('wizard_field_disabled', false);
|
||||
$('input#mtu,label[for="mtu"]', context).hide().prop('wizard_field_disabled', false);
|
||||
|
||||
$('input#phydev', context).removeAttr('required');
|
||||
$('input#bridge', context).attr('required', '');
|
||||
break;
|
||||
case "vmware":
|
||||
$('input#bridge,label[for="bridge"]', context).show();
|
||||
$('input#phydev,label[for="phydev"]', context).hide();
|
||||
$('select#vlan,label[for="vlan"]', context).show();
|
||||
$('input#vlan_id,label[for="vlan_id"]', context).show();
|
||||
$('input#ip_spoofing,label[for="ip_spoofing"]', context).hide().prop('wizard_field_disabled', true);
|
||||
$('input#mac_spoofing,label[for="mac_spoofing"]', context).hide().prop('wizard_field_disabled', true);
|
||||
$('input#mtu,label[for="mtu"]', context).hide().prop('wizard_field_disabled', false);
|
||||
|
||||
$('input#phydev', context).removeAttr('required');
|
||||
$('input#bridge', context).attr('required', '');
|
||||
break;
|
||||
};
|
||||
|
||||
$("div.network_mode_description").hide();
|
||||
$('div.network_mode_description[value="' + $(this).val() + '"]').show();
|
||||
});
|
||||
|
||||
//Initialize shown options
|
||||
$('#network_mode', context).trigger("change");
|
||||
|
||||
//TODO setupSecurityGroupTableSelect(context, "vnet_create", {"multiple_choice": true});
|
||||
//TODO setupCustomTags($("#vnetCreateContextTab", context));
|
||||
//
|
||||
// Add first AR
|
||||
//TODO $("#vnet_wizard_ar_btn", context).trigger("click");
|
||||
|
||||
$(document).foundation('reflow', 'tab');
|
||||
Tips.setup();
|
||||
return false;
|
||||
}
|
||||
|
||||
function _submitWizard(context) {
|
||||
//Fetch values
|
||||
var network_json = {};
|
||||
|
||||
this.retrieveWizardFields($("#vnetCreateGeneralTab", context), network_json);
|
||||
this.retrieveWizardFields($("#vnetCreateBridgeTab", context), network_json);
|
||||
this.retrieveWizardFields($("#vnetCreateContextTab", context), network_json);
|
||||
|
||||
/* TODO
|
||||
var secgroups = retrieveSecurityGroupTableSelect(context, "vnet_create");
|
||||
if (secgroups != undefined && secgroups.length != 0) {
|
||||
network_json["SECURITY_GROUPS"] = secgroups.join(",");
|
||||
}*/
|
||||
|
||||
// TODO retrieveCustomTags($("#vnetCreateContextTab", context), network_json);
|
||||
|
||||
/* TODO
|
||||
$('.ar_tab', context).each(function() {
|
||||
hash = retrieve_ar_tab_data(this);
|
||||
|
||||
if (!$.isEmptyObject(hash)) {
|
||||
if (!network_json["AR"])
|
||||
network_json["AR"] = [];
|
||||
|
||||
network_json["AR"].push(hash);
|
||||
}
|
||||
});*/
|
||||
|
||||
if (this.action == "create") {
|
||||
network_json = {
|
||||
"vnet" : network_json
|
||||
};
|
||||
|
||||
Sunstone.runAction("Network.create", network_json);
|
||||
return false;
|
||||
} else if (this.action == "update") {
|
||||
Sunstone.runAction("Network.update", this.resourceId, convert_template_to_string(network_json));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function _submitAdvanced(context) {
|
||||
if (this.action == "create") {
|
||||
var template = $('textarea#template', context).val();
|
||||
var vnet_json = {vnet: {vnet_raw: template}};
|
||||
Sunstone.runAction("Network.create", vnet_json);
|
||||
return false;
|
||||
|
||||
} else if (this.action == "update") {
|
||||
var template_raw = $('textarea#template', context).val();
|
||||
Sunstone.runAction("Network.update", this.resourceId, template_raw);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function _onShow(element, context) {
|
||||
if (this.action != "update") {return;}
|
||||
this.resourceId = element.ID;
|
||||
|
||||
$("#default_sg_warning").hide();
|
||||
// Populates the Avanced mode Tab
|
||||
// TODO $('#template',context).val(convert_template_to_string(element.TEMPLATE).replace(/^[\r\n]+$/g, ""));
|
||||
|
||||
$('[wizard_field="NAME"]',context).val(
|
||||
element.NAME). //TODO escapeDoubleQuotes(htmlDecode( element.NAME ))).
|
||||
prop("disabled", true).
|
||||
prop('wizard_field_disabled', true);
|
||||
|
||||
this.fillWizardFields($("#vnetCreateGeneralTab", context), element.TEMPLATE);
|
||||
this.fillWizardFields($("#vnetCreateBridgeTab", context), element.TEMPLATE);
|
||||
this.fillWizardFields($("#vnetCreateContextTab", context), element.TEMPLATE);
|
||||
|
||||
// Show all network mode inputs, and make them not required. This will change
|
||||
// if a different network model is selected
|
||||
$('input#bridge,label[for="bridge"]',context).show().prop('wizard_field_disabled', false).removeAttr('required');
|
||||
$('input#phydev,label[for="phydev"]',context).show().prop('wizard_field_disabled', false).removeAttr('required');
|
||||
$('select#vlan,label[for="vlan"]',context).show().prop('wizard_field_disabled', false).removeAttr('required');
|
||||
$('input#vlan_id,label[for="vlan_id"]',context).show().prop('wizard_field_disabled', false).removeAttr('required');
|
||||
$('input#ip_spoofing,label[for="ip_spoofing"]',context).show().prop('wizard_field_disabled', false);
|
||||
$('input#mac_spoofing,label[for="mac_spoofing"]',context).show().prop('wizard_field_disabled', false);
|
||||
|
||||
/* TODO
|
||||
if (element.TEMPLATE["SECURITY_GROUPS"] != undefined &&
|
||||
element.TEMPLATE["SECURITY_GROUPS"].length != 0){
|
||||
|
||||
var secgroups = element.TEMPLATE["SECURITY_GROUPS"].split(",");
|
||||
|
||||
selectSecurityGroupTableSelect(
|
||||
$("#vnetCreateSecurityTab", context),
|
||||
"vnet_create",
|
||||
{ ids: secgroups });
|
||||
|
||||
} else {
|
||||
refreshSecurityGroupTableSelect(context, "vnet_create");
|
||||
}
|
||||
|
||||
// Delete so these attributes don't end in the custom tags table also
|
||||
delete element.TEMPLATE["SECURITY_GROUPS"];*/
|
||||
|
||||
var fields = $('[wizard_field]', context);
|
||||
|
||||
fields.each(function(){
|
||||
var field = $(this);
|
||||
var field_name = field.attr('wizard_field');
|
||||
|
||||
delete element.TEMPLATE[field_name];
|
||||
});
|
||||
|
||||
// TODO fillCustomTags($("#vnetCreateContextTab", context), element.TEMPLATE);
|
||||
|
||||
// Remove the first AR added in initialize_
|
||||
$("#vnetCreateARTab i.remove-tab", context).trigger("click");
|
||||
$("#vnetCreateARTab #vnetCreateARTabUpdate", context).show();
|
||||
$("#vnetCreateARTab #vnetCreateARTabCreate", context).hide();
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,12 @@
|
||||
<form data-abide="ajax" id="{{formPanelId}}Advanced" class="custom creation">
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<p>{{tr "Write the Virtual Network template here"}}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<textarea id="template" rows="15" required></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@@ -0,0 +1,3 @@
|
||||
define(function(require){
|
||||
return 'createVNetForm';
|
||||
})
|
||||
@@ -0,0 +1,263 @@
|
||||
<form data-abide="ajax" id="{{formPanelId}}Wizard" class="custom creation">
|
||||
<div>
|
||||
<dl id="vnet_create_tabs" class="tabs right-info-tabs text-center" data-tab>
|
||||
<dd class="active">
|
||||
<a href="#vnetCreateGeneralTab"> <i class="fa fa-globe"></i>
|
||||
<br>{{tr "General"}}</a>
|
||||
</dd>
|
||||
<dd>
|
||||
<a href="#vnetCreateBridgeTab"> <i class="fa fa-cog"></i>
|
||||
<br>{{tr "Conf"}}</a>
|
||||
</dd>
|
||||
<dd>
|
||||
<a href="#vnetCreateARTab">
|
||||
<i class="fa fa-align-justify"></i>
|
||||
<br>{{tr "Addresses"}}</a>
|
||||
</dd>
|
||||
<dd>
|
||||
<a href="#vnetCreateSecurityTab">
|
||||
<i class="fa fa-shield"></i>
|
||||
<br>{{tr "Security"}}</a>
|
||||
</dd>
|
||||
<dd>
|
||||
<a href="#vnetCreateContextTab">
|
||||
<i class="fa fa-folder"></i>
|
||||
<br>{{tr "Context"}}</a>
|
||||
</dd>
|
||||
</dl>
|
||||
<div id="vnet_create_tabs_content" class="tabs-content">
|
||||
<div class="content active" id="vnetCreateGeneralTab">
|
||||
<div class="row">
|
||||
<div class="large-6 columns">
|
||||
<label for="name" >
|
||||
{{tr "Name"}}:
|
||||
<span class="tip">
|
||||
{{tr "Name that the Virtual Network will get for description purposes."}}
|
||||
</span>
|
||||
</label>
|
||||
<input type="text" wizard_field="NAME" required name="name" id="name"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="large-6 columns">
|
||||
<label for="DESCRIPTION" >
|
||||
{{tr "Description"}}:
|
||||
<span class="tip">{{tr "Description of the Virtual Network"}}</span>
|
||||
</label>
|
||||
<textarea type="text" wizard_field="DESCRIPTION" id="DESCRIPTION" name="DESCRIPTION"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content" id="vnetCreateBridgeTab">
|
||||
<div class="row">
|
||||
<div class="large-6 columns">
|
||||
<label for="bridge">
|
||||
{{tr "Bridge"}}:
|
||||
<span class="tip">
|
||||
{{tr "Name of the physical bridge in the physical host where the VM should connect its network interface"}}
|
||||
</span>
|
||||
</label>
|
||||
<input type="text" wizard_field="BRIDGE" name="bridge" id="bridge" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="large-6 columns">
|
||||
<label for="network_mode">
|
||||
{{tr "Network model"}}:
|
||||
<span class="tip">
|
||||
{{tr "Choose the same networking model you chose for the hosts that will use this newtork"}}
|
||||
</span>
|
||||
</label>
|
||||
<select name="network_mode" id="network_mode">
|
||||
<option value="default">{{tr "Default"}}</option>
|
||||
<option value="802.1Q">{{tr "802.1Q"}}</option>
|
||||
<option value="vxlan">{{tr "VXLAN"}}</option>
|
||||
<option value="ebtables">{{tr "ebtables"}}</option>
|
||||
<option value="openvswitch">{{tr "Open vSwitch"}}</option>
|
||||
<option value="vmware">{{tr "VMware"}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="large-12 columns">
|
||||
<div class="network_mode_description" value="default">
|
||||
{{tr "Default: dummy driver that doesn’t perform any network operation. Firewalling rules are also ignored."}}
|
||||
</div>
|
||||
<div class="network_mode_description" value="802.1Q">
|
||||
{{tr "802.1Q: restrict network access through VLAN tagging, which also requires support from the hardware switches."}}
|
||||
</div>
|
||||
<div class="network_mode_description" value="vxlan">
|
||||
{{tr "VXLAN: creates a L2 network overlay based on the VXLAN protocol, each VLAN has associated a multicast address in the 239.0.0.0/8 range."}}
|
||||
</div>
|
||||
<div class="network_mode_description" value="ebtables">
|
||||
{{tr "ebtables: restrict network access through Ebtables rules. No special hardware configuration required."}}
|
||||
</div>
|
||||
<div class="network_mode_description" value="openvswitch">
|
||||
{{tr "Open vSwitch: restrict network access with Open vSwitch Virtual Switch."}}
|
||||
</div>
|
||||
<div class="network_mode_description" value="vmware">
|
||||
{{tr "VMware: uses the VMware networking infrastructure to provide an isolated and 802.1Q compatible network for VMs launched with the VMware hypervisor."}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="row">
|
||||
<div class="large-6 columns">
|
||||
<label for="mac_spoofing">
|
||||
<input type="checkbox" wizard_field="FILTER_MAC_SPOOFING" value="YES" name="mac_spoofing" id="mac_spoofing" />
|
||||
{{tr "Filter MAC spoofing"}}
|
||||
<span class="tip">
|
||||
{{tr "Activate the filter to prevent mac spoofing. Only works with FW, 802.1Q, VXLAN and Ebtables network drivers."}}
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="large-6 columns">
|
||||
<label for="ip_spoofing">
|
||||
<input type="checkbox" wizard_field="FILTER_IP_SPOOFING" value="YES" name="ip_spoofing" id="ip_spoofing" />
|
||||
{{tr "Filter IP spoofing"}}
|
||||
<span class="tip">
|
||||
{{tr "Activate the filter to prevent IP spoofing. Only works with FW, 802.1Q, VXLAN and Ebtables network drivers."}}
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="large-6 columns">
|
||||
<div class="row">
|
||||
<div class="large-6 columns">
|
||||
<label for="vlan">
|
||||
{{tr "VLAN"}}:
|
||||
<span class="tip">
|
||||
{{tr "Whether or not to isolate this virtual network using the Virtual Network Manager drivers"}}
|
||||
</span>
|
||||
</label>
|
||||
<select wizard_field="VLAN" name="vlan" id="vlan">
|
||||
<option value="YES" selected="selected">{{tr "Yes"}}</option>
|
||||
<option value="NO">{{tr "No"}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="large-6 columns">
|
||||
<label for="vlan_id">
|
||||
{{tr "VLAN ID"}}:
|
||||
<span class="tip">{{tr "Optional: Set a specific VLAN id"}}</span>
|
||||
</label>
|
||||
<input type="text" wizard_field="VLAN_ID" name="vlan_id" id="vlan_id" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="large-6 columns">
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<label for="phydev">
|
||||
{{tr "Physical device"}}:
|
||||
<span class="tip">
|
||||
{{tr "Name of the physical network device that will be attached to the bridge"}}
|
||||
</span>
|
||||
</label>
|
||||
<input type="text" wizard_field="PHYDEV" name="phydev" id="phydev" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="large-3 columns">
|
||||
<label for="mtu">
|
||||
{{tr "MTU"}}:
|
||||
<span class="tip">
|
||||
{{tr "Set the MTU for the tagged interface. This MTU will be then inherited by the bridge and by the tagged interface."}}
|
||||
</span>
|
||||
</label>
|
||||
<input type="text" wizard_field="MTU" name="mtu" id="mtu" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content" id="vnetCreateARTab">
|
||||
<div class="row" id="vnetCreateARTabCreate">
|
||||
<div class="large-12 columns">
|
||||
<div class="row">
|
||||
<dl class="tabs vertical" id="vnet_wizard_ar_tabs" data-tab>
|
||||
<dt class="text-center">
|
||||
<button type="button" class="button tiny radius" id="vnet_wizard_ar_btn">
|
||||
<span class="fa fa-plus"></span>
|
||||
{{tr "Add another Address Range"}}
|
||||
</button>
|
||||
</dt>
|
||||
</dl>
|
||||
<div class="tabs-content vertical" id="vnet_wizard_ar_tabs_content"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" id="vnetCreateARTabUpdate">
|
||||
<div class="large-12 columns">
|
||||
<p>
|
||||
{{tr "Address Ranges need to be managed in the individual Virtual Network panel"}}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content" id="vnetCreateSecurityTab">
|
||||
{{! TODO generateSecurityGroupTableSelect("vnet_create")}}
|
||||
<div class="row" id="default_sg_warning">
|
||||
<div class="large-12 columns">
|
||||
<span class="radius secondary label">
|
||||
<i class="fa fa-warning"/>{{tr "The default Security Group 0 is automatically added to new Virtual Networks"}}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content" id="vnetCreateContextTab">
|
||||
<div class="row">
|
||||
<div class="large-6 columns">
|
||||
<label for="net_address">
|
||||
{{tr "Network address"}}:
|
||||
<span class="tip">{{tr "Base network address. For example, 192.168.1.0"}}</span>
|
||||
</label>
|
||||
<input type="text" wizard_field="NETWORK_ADDRESS" name="net_address" id="net_address" />
|
||||
</div>
|
||||
<div class="large-6 columns">
|
||||
<label for="net_mask">
|
||||
{{tr "Network mask"}}:
|
||||
<span class="tip">{{tr "Network mask. For example, 255.255.255.0"}}</span>
|
||||
</label>
|
||||
<input type="text" wizard_field="NETWORK_MASK" name="net_mask" id="net_mask" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="large-6 columns">
|
||||
<label for="net_gateway">
|
||||
{{tr "Gateway"}}:
|
||||
<span class="tip">
|
||||
{{tr "Router for this network. Leave empty if the network is not routable"}}
|
||||
</span>
|
||||
</label>
|
||||
<input type="text" wizard_field="GATEWAY" name="net_gateway" id="net_gateway" />
|
||||
</div>
|
||||
<div class="large-6 columns">
|
||||
<label for="net_gateway6">
|
||||
{{tr "IPv6 Gateway"}}:
|
||||
<span class="tip">{{tr "IPv6 Router for this network"}}</span>
|
||||
</label>
|
||||
<input type="text" wizard_field="GATEWAY6" name="net_gateway6" id="net_gateway6" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="large-6 columns">
|
||||
<label for="net_dns">
|
||||
{{tr "DNS"}}:
|
||||
<span class="tip">{{tr "Specific DNS for this network"}}</span>
|
||||
</label>
|
||||
<input type="text" wizard_field="DNS" name="net_dns" id="net_dns" />
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<span>{{tr "Custom attributes"}}</span>
|
||||
<br>
|
||||
<br></div>
|
||||
</div>
|
||||
{{! TODO customTagsHtml()}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
Reference in new issue
Block a user