1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-16 22:50:10 +03:00

Feature #3748: Move the DS create dialog to a form panel

This commit is contained in:
Carlos Martín 2015-06-22 18:48:38 +02:00
parent 0f1aeab87e
commit 5fc292560a
8 changed files with 453 additions and 449 deletions

View File

@ -8,7 +8,10 @@ define(function(require) {
var DATATABLE_ID = "dataTableDatastores";
var _dialogs = [
require('./datastores-tab/dialogs/create')
];
var _formPanels = [
require('./datastores-tab/form-panels/create')
];
var _panels = [
@ -29,6 +32,7 @@ define(function(require) {
actions: Actions,
dataTable: new Table(DATATABLE_ID, {actions: true, info: true}),
panels: _panels,
formPanels: _formPanels,
dialogs: _dialogs
};

View File

@ -7,25 +7,28 @@ define(function(require) {
var OpenNebulaAction = require('opennebula/action');
var TAB_ID = require('./tabId');
var CREATE_DIALOG_ID = require('./dialogs/create/dialogId');
var CREATE_DIALOG_ID = require('./form-panels/create/formPanelId');
var _actions = {
"Datastore.create" : {
type: "create",
call : OpenNebulaDatastore.create,
callback : function(request, response) {
Sunstone.getDialog(CREATE_DIALOG_ID).hide();
Sunstone.getDialog(CREATE_DIALOG_ID).reset();
Sunstone.resetFormPanel(TAB_ID, CREATE_DIALOG_ID);
Sunstone.hideFormPanel(TAB_ID);
Sunstone.getDataTable(TAB_ID).addElement(request, response);
Notifier.notifyCustom(Locale.tr("Datastore created"), " ID: " + response.DATASTORE.ID, false);
},
error : Notifier.onError
error: function(request, response) {
Sunstone.hideFormPanelLoading(TAB_ID);
Notifier.onError(request, response);
},
},
"Datastore.create_dialog" : {
type: "custom",
call: function() {
Sunstone.getDialog(CREATE_DIALOG_ID).show();
Sunstone.showFormPanel(TAB_ID, CREATE_DIALOG_ID, "create");
}
},

View File

@ -1,3 +0,0 @@
define(function(require){
return 'createDatastoreDialog';
})

View File

@ -1,295 +0,0 @@
<div id="{{dialogId}}" class="reveal-modal medium max-height" role="dialog" data-reveal>
<div class="row">
<div class="large-5 columns">
<h3 id="create_cluster_header" class="subheader">{{tr "Create Datastore"}}</h3>
</div>
<div class="large-7 columns">
<dl class="tabs right wizard_tabs" data-tab>
<dd class="active">
<a href="#datastore_easyTab">{{tr "Wizard"}}</a>
</dd>
<dd>
<a href="#datastore_manualTab">{{tr "Advanced mode"}}</a>
</dd>
</dl>
</div>
</div>
<div class="reveal-body">
<form id="{{dialogId}}Form" action="" class="creation">
<div class="tabs-content">
<div id="datastore_easyTab" class="active content">
<div class="row">
<div class="large-6 columns">
<label for="name" >{{tr "Name"}}:</label>
<input type="text" name="name" id="name"/>
</div>
</div>
<div class="row">
<div class="large-6 columns">
<label for="presets">{{tr "Presets"}}</label>
<select id="presets" name="presets">
<option value="fs">{{tr "Filesystem"}}</option>
<option value="vmware_vmfs">{{tr "VMware VMFS"}}</option>
<option value="block_lvm">{{tr "Block LVM"}}</option>
<option value="fs_lvm">{{tr "FS LVM"}}</option>
<option value="ceph">{{tr "Ceph"}}</option>
<option value="gluster">{{tr "Gluster"}}</option>
<option value="dev">{{tr "Devices"}}</option>
<option value="custom">{{tr "Custom"}}</option>
</select>
</div>
<div class="large-6 columns">
<label for="cluster">{{tr "Cluster"}}</label>
<div id="cluster_id" name="cluster_id"></div>
</div>
</div>
<div class="row">
<div class="large-12 columns">
<fieldset>
<legend>{{tr "Type"}}</legend>
<div class="large-12 columns text-center">
<input id="image_ds_type" type="radio" name="ds_type" value="IMAGE_DS" checked/>
<label for="image_ds_type">{{tr "Images"}}</label>
<input id="system_ds_type" type="radio" name="ds_type" value="SYSTEM_DS" />
<label for="system_ds_type">{{tr "System"}}</label>
<input id="file_ds_type" type="radio" name="ds_type" value="FILE_DS" />
<label for="file_ds_type">{{tr "Files"}}</label>
</div>
</fieldset>
</div>
</div>
<div class="row">
<div class="large-12 columns">
<fieldset>
<legend>{{tr "Managers"}}</legend>
<div class="large-6 columns">
<label for="ds_mad">{{tr "Datastore"}}</label>
<select id="ds_mad" name="ds_mad">
<option value="fs">{{tr "Filesystem"}}</option>
<option value="vmware">{{tr "VMware"}}</option>
<option value="lvm">{{tr "LVM"}}</option>
<option value="vmfs">{{tr "VMFS"}}</option>
<option value="ceph">{{tr "Ceph"}}</option>
<option value="dev">{{tr "Devices"}}</option>
<option value="custom">{{tr "Custom"}}</option>
</select>
<div>
<label>{{tr "Custom DS_MAD"}}:</label>
<input type="text" name="ds_tab_custom_ds_mad" />
</div>
</div>
<div class="large-6 columns">
<label for="tm_mad">{{tr "Transfer"}}:</label>
<select id="tm_mad" name="tm_mad">
<option value="shared">{{tr "Shared"}}</option>
<option value="ssh">{{tr "SSH"}}</option>
<option value="qcow2">{{tr "qcow2"}}</option>
<option value="lvm">{{tr "LVM"}}</option>
<option value="fs_lvm">{{tr "FS LVM"}}</option>
<option value="vmfs">{{tr "VMFS"}}</option>
<option value="ceph">{{tr "Ceph"}}</option>
<option value="dev">{{tr "Devices"}}</option>
<option value="custom">{{tr "Custom"}}</option>
</select>
<div>
<label>{{tr "Custom TM_MAD"}}:</label>
<input type="text" name="ds_tab_custom_tm_mad" />
</div>
</div>
</fieldset>
</div>
</div>
<div class="row">
<div class="large-6 columns">
<label for="disk_type">{{tr "Disk type"}}:</label>
<select id="disk_type" name="disk_type">
<option value="file">{{tr "File"}}</option>
<option value="block">{{tr "Block"}}</option>
<option value="RBD">{{tr "RBD"}}</option>
<option value="gluster">{{tr "Gluster"}}</option>
</select>
</div>
</div>
<div class="row">
<div class="large-12 columns">
<label for="safe_dirs">
{{tr "Safe Directories"}}
<span class="tip">
{{tr "If you need to un-block a directory under one of the RESTRICTED_DIRS"}}
</span>
</label>
<input type="text" name="safe_dirs" id="safe_dirs" />
</div>
<div class="large-12 columns">
<label for="restricted_dirs">
{{tr "Restricted Directories"}}
<span class="tip">
{{tr "Paths that can not be used to register images. A space separated list of paths. This will prevent users registering important files as VM images and accessing them thourgh their VMs. OpenNebula will automatically add its configuration directories: /var/lib/one, /etc/one and oneadmin's home ($HOME)."}}
</span>
</label>
<input type="text" name="restricted_dirs" id="restricted_dirs" />
</div>
<div class="large-6 columns">
<label for="base_path">
{{tr "Base Path"}}
<span class="tip">
{{tr "When needed, the front-end will access the datastores using BASE_PATH (defaults to /var/lib/one/datastores)."}}
</span>
</label>
<input type="text" name="base_path" id="base_path" />
</div>
<div class="large-6 columns">
<label for="limit_transfer_bw">
{{tr "Transfer BW Limit"}}
<span class="tip">
{{tr "Specify the maximum transfer rate in bytes/second when downloading images from a http/https URL. Suffixes K, M or G can be used."}}
</span>
</label>
<input type="text" name="limit_transfer_bw" id="limit_transfer_bw" />
</div>
<div class="large-6 columns">
<label for="limit_mb">
{{tr "Limit"}}
<span class="tip">
{{tr "Optional limit, in MB. If set, OpenNebula will only use this amount of storage, instead of the whole free disk."}}
</span>
</label>
<input type="text" name="limit_mb" id="limit_mb" />
</div>
<div class="large-12 columns">
<input id="no_decompress" type="checkbox" name="no_decompress" value="YES" />
<label for="no_decompress">{{tr "Do not try to untar or decompress"}}</label>
</div>
<div class="large-12 columns">
<input id="datastore_capacity_check" type="checkbox" name="datastore_capacity_check" value="YES" />
<label for="datastore_capacity_check">
{{tr "Check available capacity of the datastore before creating a new image"}}
</label>
</div>
<div class="large-12 columns">
<label for="bridge_list">
{{tr "Host Bridge List"}}
<span class="tip">
{{tr "Space separated list of Server names or IPs where OpenNebula will be staging the new images into. This server will act as the entry point for new inmages in the datastore."}}
</span>
</label>
<input type="text" name="bridge_list" id="bridge_list" />
</div>
<div class="large-6 columns">
<label for="ds_tmp_dir">
{{tr "DS Tmp Dir"}}
<span class="tip">
{{tr "Path in the OpenNebula front-end to be used as a buffer to stage in files in vmfs datastores."}}
</span>
</label>
<input type="text" name="ds_tmp_dir" id="ds_tmp_dir" />
</div>
<div class="large-6 columns">
<label for="vg_name">{{tr "Volume Group Name"}}</label>
<input type="text" name="vg_name" id="vg_name" />
</div>
<div class="large-6 columns">
<label for="gluster_host">
{{tr "Gluster Host"}}
<span class="tip">
{{tr "Host and port of one (and only one) Gluster server (host:port)"}}
</span>
</label>
<input type="text" name="gluster_host" id="gluster_host" />
</div>
<div class="large-6 columns">
<label for="gluster_volume">
{{tr "Gluster Volume"}}
<span class="tip">{{tr "Gluster volume to use for the datastore"}}</span>
</label>
<input type="text" name="gluster_volume" id="gluster_volume" />
</div>
<div class="large-6 columns">
<label for="pool_name">
{{tr "Pool Name"}}
<span class="tip">
{{tr "The OpenNebula Ceph pool name. Defaults to 'one' (this pool must exist before using the drivers)."}}
</span>
</label>
<input type="text" name="pool_name" id="pool_name" />
</div>
<div class="large-6 columns">
<label for="ceph_host">
{{tr "Ceph Host"}}
<span class="tip">
{{tr "Space-separated list of Ceph monitors. Example: host1 host2:port2 host3 host4:port4 (if no port is specified, the default one is chosen) (Required for Libvirt 1.x when cephx is enabled)."}}
</span>
</label>
<input type="text" name="ceph_host" id="ceph_host" />
</div>
<div class="large-6 columns">
<label for="ceph_user">
{{tr "Ceph User"}}
<span class="tip">
{{tr "The OpenNebula Ceph user name. If set it is used by RBD commands. This ceph user must exist before using the drivers. Required for Libvirt 1.x when cephx is enabled ."}}
</span>
</label>
<input type="text" name="ceph_user" id="ceph_user" />
</div>
<div class="large-6 columns">
<label for="ceph_secret">
{{tr "Ceph Secret"}}
<span class="tip">
{{tr "A generated UUID for a LibVirt secret (to hold the CephX authentication key in Libvirt on each hypervisor). This should be generated when creating the Ceph datastore in OpenNebula. (Required for Libvirt 1.x when cephx is enabled)."}}
</span>
</label>
<input type="text" name="ceph_secret" id="ceph_secret" />
</div>
<div class="large-6 columns">
<label class="fs" for="staging_dir">
{{tr "Staging Dir"}}
<span class="tip">
{{tr "FS: Default path where images will be temporarily copied to in the host carrying out the registration operation (chosen from the bridge list). If empty, defaults to /var/tmp."}}
<br>
<br>
{{tr "Ceph: Default path for image operations in the OpenNebula Ceph frontend."}}
</span>
</label>
<input type="text" name="staging_dir" id="staging_dir" />
</div>
<div class="large-6 columns">
<label for="rbd_format">
{{tr "RBD Format"}}
<span class="tip">
{{tr "By default RBD Format 2 will be used. If RBD_FORMAT=2 is specified then when instantiating non-persistent images the Ceph driver will perform rbd snap instead of rbd copy."}}
</span>
</label>
<input type="text" name="rbd_format" id="rbd_format" />
</div>
</div>
<div class="reveal-footer">
<div class="form_buttons">
<button class="button radius right success" type="submit" id="create_datastore_submit" value="OpenNebula.Datastore.create">{{tr "Create"}}</button>
<button class="button radius secondary resetDialog" type="reset" value="reset">{{tr "Reset"}}</button>
</div>
</div>
</div>
<div id="datastore_manualTab" class="content">
<div class="row">
<div class="columns large-6">
<label for="datastore_cluster_raw">{{tr "Cluster"}}</label>
<div id="datastore_cluster_raw" name="datastore_cluster_raw"></div>
</div>
</div>
<div class="row">
<div class="columns large-12">
<textarea id="template" rows="15"></textarea>
</div>
</div>
<div class="reveal-footer">
<div class="form_buttons">
<button class="button success radius right" id="create_datastore_submit_manual" value="datastore/create">{{tr "Create"}}</button>
<button class="button secondary radius resetDialog" type="reset" value="reset">{{tr "Reset"}}</button>
</div>
</div>
</div>
</div>
</form>
<a class="close-reveal-modal">&#215;</a>
</div>
</div>

View File

@ -3,43 +3,70 @@ define(function(require) {
DEPENDENCIES
*/
var BaseDialog = require('utils/dialogs/dialog');
var TemplateHTML = require('hbs!./create/html');
require('foundation.tab');
var BaseFormPanel = require('utils/form-panels/form-panel');
var Sunstone = require('sunstone');
var Locale = require('utils/locale');
var Notifier = require('utils/notifier');
var Tips = require('utils/tips');
var ResourceSelect = require('utils/resource-select')
var ResourceSelect = require('utils/resource-select');
/*
TEMPLATES
*/
var TemplateWizardHTML = require('hbs!./create/wizard');
var TemplateAdvancedHTML = require('hbs!./create/advanced');
/*
CONSTANTS
*/
var DIALOG_ID = require('./create/dialogId');
var FORM_PANEL_ID = require('./create/formPanelId');
var TAB_ID = require('../tabId');
/*
CONSTRUCTOR
*/
function Dialog() {
this.dialogId = DIALOG_ID;
BaseDialog.call(this);
};
function FormPanel() {
this.formPanelId = FORM_PANEL_ID;
this.tabId = TAB_ID;
this.actions = {
'create': {
'title': Locale.tr("Create Datastore"),
'buttonText': Locale.tr("Create"),
'resetButton': true
}
};
Dialog.DIALOG_ID = DIALOG_ID;
Dialog.prototype = Object.create(BaseDialog.prototype);
Dialog.prototype.constructor = Dialog;
Dialog.prototype.html = _html;
Dialog.prototype.onShow = _onShow;
Dialog.prototype.setup = _setup;
BaseFormPanel.call(this);
}
return Dialog;
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 _html() {
return TemplateHTML({dialogId: DIALOG_ID});
function _htmlWizard() {
return TemplateWizardHTML({
'formPanelId': this.formPanelId,
});
}
function _htmlAdvanced() {
return TemplateAdvancedHTML({formPanelId: this.formPanelId});
}
function _onShow(dialog) {
@ -111,133 +138,6 @@ define(function(require) {
}
});
$('#create_datastore_submit', dialog).click(function() {
var name = $('#name', dialog).val();
var cluster_id = $(".resource_list_select", $('#cluster_id', dialog)).val();
var ds_type = $('input[name=ds_type]:checked', dialog).val();
var ds_mad = $('#ds_mad', dialog).val();
ds_mad = ds_mad == "custom" ? $('input[name="ds_tab_custom_ds_mad"]').val() : ds_mad;
var tm_mad = $('#tm_mad', dialog).val();
tm_mad = tm_mad == "custom" ? $('input[name="ds_tab_custom_tm_mad"]').val() : tm_mad;
var type = $('#disk_type', dialog).val();
var safe_dirs = $('#safe_dirs', dialog).val();
var base_path = $('#base_path', dialog).val();
var restricted_dirs = $('#restricted_dirs', dialog).val();
var limit_transfer_bw = $('#limit_transfer_bw', dialog).val();
var datastore_capacity_check = $('#datastore_capacity_check', dialog).is(':checked');
var no_decompress = $('#no_decompress', dialog).is(':checked');
var bridge_list = $('#bridge_list', dialog).val();
var ds_tmp_dir = $('#ds_tmp_dir', dialog).val();
var vg_name = $('#vg_name', dialog).val();
var limit_mb = $('#limit_mb', dialog).val();
var gluster_host = $('#gluster_host', dialog).val();
var gluster_volume = $('#gluster_volume', dialog).val();
var pool_name = $('#pool_name', dialog).val();
var ceph_host = $('#ceph_host', dialog).val();
var ceph_secret = $('#ceph_secret', dialog).val();
var ceph_user = $('#ceph_user', dialog).val();
var rbd_format = $('#rbd_format', dialog).val();
var staging_dir = $('#staging_dir', dialog).val();
if (!name) {
Notifier.notifyError("Please provide a name");
return false;
};
var ds_obj = {
"datastore" : {
"name" : name,
"tm_mad" : tm_mad,
"disk_type" : type,
"type" : ds_type
},
"cluster_id" : cluster_id
};
// If we are adding a system datastore then
// we do not use ds_mad
if (ds_type != "SYSTEM_DS")
ds_obj.datastore.ds_mad = ds_mad;
if (base_path)
ds_obj.datastore.base_path = base_path;
if (safe_dirs)
ds_obj.datastore.safe_dirs = safe_dirs;
if (restricted_dirs)
ds_obj.datastore.restricted_dirs = restricted_dirs;
if (limit_transfer_bw)
ds_obj.datastore.limit_transfer_bw = limit_transfer_bw;
if (no_decompress)
ds_obj.datastore.no_decompress = "YES";
if (datastore_capacity_check)
ds_obj.datastore.datastore_capacity_check = "YES";
if (bridge_list)
ds_obj.datastore.bridge_list = bridge_list;
if (ds_tmp_dir)
ds_obj.datastore.ds_tmp_dir = ds_tmp_dir;
if (vg_name)
ds_obj.datastore.vg_name = vg_name;
if (limit_mb)
ds_obj.datastore.limit_mb = limit_mb;
if (gluster_host)
ds_obj.datastore.gluster_host = gluster_host;
if (gluster_volume)
ds_obj.datastore.gluster_volume = gluster_volume;
if (pool_name)
ds_obj.datastore.pool_name = pool_name;
if (ceph_host)
ds_obj.datastore.ceph_host = ceph_host;
if (ceph_secret)
ds_obj.datastore.ceph_secret = ceph_secret;
if (ceph_user)
ds_obj.datastore.ceph_user = ceph_user;
if (rbd_format)
ds_obj.datastore.rbd_format = rbd_format;
if (staging_dir)
ds_obj.datastore.staging_dir = staging_dir;
Sunstone.runAction("Datastore.create", ds_obj);
return false;
});
$('#create_datastore_submit_manual', dialog).click(function() {
var template = $('#template', dialog).val();
var cluster_id = $(".resource_list_select", $('#datastore_cluster_raw', dialog)).val();
if (!cluster_id) {
Notifier.notifyError(tr("Please select a cluster for this datastore"));
return false;
};
var ds_obj = {
"datastore" : {
"datastore_raw" : template
},
"cluster_id" : cluster_id
};
Sunstone.runAction("Datastore.create", ds_obj);
return false;
});
// Hide disk_type
$('select#disk_type').parent().hide();
@ -245,6 +145,130 @@ define(function(require) {
_selectFilesystem();
}
function _submitWizard(dialog) {
var name = $('#name', dialog).val();
var cluster_id = $(".resource_list_select", $('#cluster_id', dialog)).val();
var ds_type = $('input[name=ds_type]:checked', dialog).val();
var ds_mad = $('#ds_mad', dialog).val();
ds_mad = ds_mad == "custom" ? $('input[name="ds_tab_custom_ds_mad"]').val() : ds_mad;
var tm_mad = $('#tm_mad', dialog).val();
tm_mad = tm_mad == "custom" ? $('input[name="ds_tab_custom_tm_mad"]').val() : tm_mad;
var type = $('#disk_type', dialog).val();
var safe_dirs = $('#safe_dirs', dialog).val();
var base_path = $('#base_path', dialog).val();
var restricted_dirs = $('#restricted_dirs', dialog).val();
var limit_transfer_bw = $('#limit_transfer_bw', dialog).val();
var datastore_capacity_check = $('#datastore_capacity_check', dialog).is(':checked');
var no_decompress = $('#no_decompress', dialog).is(':checked');
var bridge_list = $('#bridge_list', dialog).val();
var ds_tmp_dir = $('#ds_tmp_dir', dialog).val();
var vg_name = $('#vg_name', dialog).val();
var limit_mb = $('#limit_mb', dialog).val();
var gluster_host = $('#gluster_host', dialog).val();
var gluster_volume = $('#gluster_volume', dialog).val();
var pool_name = $('#pool_name', dialog).val();
var ceph_host = $('#ceph_host', dialog).val();
var ceph_secret = $('#ceph_secret', dialog).val();
var ceph_user = $('#ceph_user', dialog).val();
var rbd_format = $('#rbd_format', dialog).val();
var staging_dir = $('#staging_dir', dialog).val();
var ds_obj = {
"datastore" : {
"name" : name,
"tm_mad" : tm_mad,
"disk_type" : type,
"type" : ds_type
},
"cluster_id" : cluster_id
};
// If we are adding a system datastore then
// we do not use ds_mad
if (ds_type != "SYSTEM_DS")
ds_obj.datastore.ds_mad = ds_mad;
if (base_path)
ds_obj.datastore.base_path = base_path;
if (safe_dirs)
ds_obj.datastore.safe_dirs = safe_dirs;
if (restricted_dirs)
ds_obj.datastore.restricted_dirs = restricted_dirs;
if (limit_transfer_bw)
ds_obj.datastore.limit_transfer_bw = limit_transfer_bw;
if (no_decompress)
ds_obj.datastore.no_decompress = "YES";
if (datastore_capacity_check)
ds_obj.datastore.datastore_capacity_check = "YES";
if (bridge_list)
ds_obj.datastore.bridge_list = bridge_list;
if (ds_tmp_dir)
ds_obj.datastore.ds_tmp_dir = ds_tmp_dir;
if (vg_name)
ds_obj.datastore.vg_name = vg_name;
if (limit_mb)
ds_obj.datastore.limit_mb = limit_mb;
if (gluster_host)
ds_obj.datastore.gluster_host = gluster_host;
if (gluster_volume)
ds_obj.datastore.gluster_volume = gluster_volume;
if (pool_name)
ds_obj.datastore.pool_name = pool_name;
if (ceph_host)
ds_obj.datastore.ceph_host = ceph_host;
if (ceph_secret)
ds_obj.datastore.ceph_secret = ceph_secret;
if (ceph_user)
ds_obj.datastore.ceph_user = ceph_user;
if (rbd_format)
ds_obj.datastore.rbd_format = rbd_format;
if (staging_dir)
ds_obj.datastore.staging_dir = staging_dir;
Sunstone.runAction("Datastore.create", ds_obj);
return false;
}
function _submitAdvanced(dialog) {
var template = $('#template', dialog).val();
var cluster_id = $(".resource_list_select", $('#datastore_cluster_raw', dialog)).val();
if (!cluster_id) {
Notifier.notifyError(tr("Please select a cluster for this datastore"));
return false;
}
var ds_obj = {
"datastore" : {
"datastore_raw" : template
},
"cluster_id" : cluster_id
};
Sunstone.runAction("Datastore.create", ds_obj);
return false;
}
function _hideAll(dialog) {
// Hide all the options that depends on datastore type
// and reset the selects

View File

@ -0,0 +1,22 @@
<form data-abide="ajax" id="{{formPanelId}}Advanced" class="custom creation">
<div class="row">
<div class="columns large-6">
<label for="datastore_cluster_raw">{{tr "Cluster"}}</label>
<div id="datastore_cluster_raw" name="datastore_cluster_raw"></div>
</div>
</div>
<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>

View File

@ -0,0 +1,3 @@
define(function(require){
return 'createDatastoreForm';
})

View File

@ -0,0 +1,246 @@
<form data-abide="ajax" id="{{formPanelId}}Wizard" class="custom creation">
<div class="row">
<div class="large-6 columns">
<label for="name" >{{tr "Name"}}:</label>
<input required type="text" name="name" id="name"/>
</div>
</div>
<div class="row">
<div class="large-6 columns">
<label for="presets">{{tr "Presets"}}</label>
<select id="presets" name="presets">
<option value="fs">{{tr "Filesystem"}}</option>
<option value="vmware_vmfs">{{tr "VMware VMFS"}}</option>
<option value="block_lvm">{{tr "Block LVM"}}</option>
<option value="fs_lvm">{{tr "FS LVM"}}</option>
<option value="ceph">{{tr "Ceph"}}</option>
<option value="gluster">{{tr "Gluster"}}</option>
<option value="dev">{{tr "Devices"}}</option>
<option value="custom">{{tr "Custom"}}</option>
</select>
</div>
<div class="large-6 columns">
<label for="cluster">{{tr "Cluster"}}</label>
<div id="cluster_id" name="cluster_id"></div>
</div>
</div>
<div class="row">
<div class="large-12 columns">
<fieldset>
<legend>{{tr "Type"}}</legend>
<div class="large-12 columns text-center">
<input id="image_ds_type" type="radio" name="ds_type" value="IMAGE_DS" checked/>
<label for="image_ds_type">{{tr "Images"}}</label>
<input id="system_ds_type" type="radio" name="ds_type" value="SYSTEM_DS" />
<label for="system_ds_type">{{tr "System"}}</label>
<input id="file_ds_type" type="radio" name="ds_type" value="FILE_DS" />
<label for="file_ds_type">{{tr "Files"}}</label>
</div>
</fieldset>
</div>
</div>
<div class="row">
<div class="large-12 columns">
<fieldset>
<legend>{{tr "Managers"}}</legend>
<div class="large-6 columns">
<label for="ds_mad">{{tr "Datastore"}}</label>
<select id="ds_mad" name="ds_mad">
<option value="fs">{{tr "Filesystem"}}</option>
<option value="vmware">{{tr "VMware"}}</option>
<option value="lvm">{{tr "LVM"}}</option>
<option value="vmfs">{{tr "VMFS"}}</option>
<option value="ceph">{{tr "Ceph"}}</option>
<option value="dev">{{tr "Devices"}}</option>
<option value="custom">{{tr "Custom"}}</option>
</select>
<div>
<label>{{tr "Custom DS_MAD"}}:</label>
<input type="text" name="ds_tab_custom_ds_mad" />
</div>
</div>
<div class="large-6 columns">
<label for="tm_mad">{{tr "Transfer"}}:</label>
<select id="tm_mad" name="tm_mad">
<option value="shared">{{tr "Shared"}}</option>
<option value="ssh">{{tr "SSH"}}</option>
<option value="qcow2">{{tr "qcow2"}}</option>
<option value="lvm">{{tr "LVM"}}</option>
<option value="fs_lvm">{{tr "FS LVM"}}</option>
<option value="vmfs">{{tr "VMFS"}}</option>
<option value="ceph">{{tr "Ceph"}}</option>
<option value="dev">{{tr "Devices"}}</option>
<option value="custom">{{tr "Custom"}}</option>
</select>
<div>
<label>{{tr "Custom TM_MAD"}}:</label>
<input type="text" name="ds_tab_custom_tm_mad" />
</div>
</div>
</fieldset>
</div>
</div>
<div class="row">
<div class="large-6 columns">
<label for="disk_type">{{tr "Disk type"}}:</label>
<select id="disk_type" name="disk_type">
<option value="file">{{tr "File"}}</option>
<option value="block">{{tr "Block"}}</option>
<option value="RBD">{{tr "RBD"}}</option>
<option value="gluster">{{tr "Gluster"}}</option>
</select>
</div>
</div>
<div class="row">
<div class="large-12 columns">
<label for="safe_dirs">
{{tr "Safe Directories"}}
<span class="tip">
{{tr "If you need to un-block a directory under one of the RESTRICTED_DIRS"}}
</span>
</label>
<input type="text" name="safe_dirs" id="safe_dirs" />
</div>
<div class="large-12 columns">
<label for="restricted_dirs">
{{tr "Restricted Directories"}}
<span class="tip">
{{tr "Paths that can not be used to register images. A space separated list of paths. This will prevent users registering important files as VM images and accessing them thourgh their VMs. OpenNebula will automatically add its configuration directories: /var/lib/one, /etc/one and oneadmin's home ($HOME)."}}
</span>
</label>
<input type="text" name="restricted_dirs" id="restricted_dirs" />
</div>
<div class="large-6 columns">
<label for="base_path">
{{tr "Base Path"}}
<span class="tip">
{{tr "When needed, the front-end will access the datastores using BASE_PATH (defaults to /var/lib/one/datastores)."}}
</span>
</label>
<input type="text" name="base_path" id="base_path" />
</div>
<div class="large-6 columns">
<label for="limit_transfer_bw">
{{tr "Transfer BW Limit"}}
<span class="tip">
{{tr "Specify the maximum transfer rate in bytes/second when downloading images from a http/https URL. Suffixes K, M or G can be used."}}
</span>
</label>
<input type="text" name="limit_transfer_bw" id="limit_transfer_bw" />
</div>
<div class="large-6 columns">
<label for="limit_mb">
{{tr "Limit"}}
<span class="tip">
{{tr "Optional limit, in MB. If set, OpenNebula will only use this amount of storage, instead of the whole free disk."}}
</span>
</label>
<input type="text" name="limit_mb" id="limit_mb" />
</div>
<div class="large-12 columns">
<input id="no_decompress" type="checkbox" name="no_decompress" value="YES" />
<label for="no_decompress">{{tr "Do not try to untar or decompress"}}</label>
</div>
<div class="large-12 columns">
<input id="datastore_capacity_check" type="checkbox" name="datastore_capacity_check" value="YES" />
<label for="datastore_capacity_check">
{{tr "Check available capacity of the datastore before creating a new image"}}
</label>
</div>
<div class="large-12 columns">
<label for="bridge_list">
{{tr "Host Bridge List"}}
<span class="tip">
{{tr "Space separated list of Server names or IPs where OpenNebula will be staging the new images into. This server will act as the entry point for new inmages in the datastore."}}
</span>
</label>
<input type="text" name="bridge_list" id="bridge_list" />
</div>
<div class="large-6 columns">
<label for="ds_tmp_dir">
{{tr "DS Tmp Dir"}}
<span class="tip">
{{tr "Path in the OpenNebula front-end to be used as a buffer to stage in files in vmfs datastores."}}
</span>
</label>
<input type="text" name="ds_tmp_dir" id="ds_tmp_dir" />
</div>
<div class="large-6 columns">
<label for="vg_name">{{tr "Volume Group Name"}}</label>
<input type="text" name="vg_name" id="vg_name" />
</div>
<div class="large-6 columns">
<label for="gluster_host">
{{tr "Gluster Host"}}
<span class="tip">
{{tr "Host and port of one (and only one) Gluster server (host:port)"}}
</span>
</label>
<input type="text" name="gluster_host" id="gluster_host" />
</div>
<div class="large-6 columns">
<label for="gluster_volume">
{{tr "Gluster Volume"}}
<span class="tip">{{tr "Gluster volume to use for the datastore"}}</span>
</label>
<input type="text" name="gluster_volume" id="gluster_volume" />
</div>
<div class="large-6 columns">
<label for="pool_name">
{{tr "Pool Name"}}
<span class="tip">
{{tr "The OpenNebula Ceph pool name. Defaults to 'one' (this pool must exist before using the drivers)."}}
</span>
</label>
<input type="text" name="pool_name" id="pool_name" />
</div>
<div class="large-6 columns">
<label for="ceph_host">
{{tr "Ceph Host"}}
<span class="tip">
{{tr "Space-separated list of Ceph monitors. Example: host1 host2:port2 host3 host4:port4 (if no port is specified, the default one is chosen) (Required for Libvirt 1.x when cephx is enabled)."}}
</span>
</label>
<input type="text" name="ceph_host" id="ceph_host" />
</div>
<div class="large-6 columns">
<label for="ceph_user">
{{tr "Ceph User"}}
<span class="tip">
{{tr "The OpenNebula Ceph user name. If set it is used by RBD commands. This ceph user must exist before using the drivers. Required for Libvirt 1.x when cephx is enabled ."}}
</span>
</label>
<input type="text" name="ceph_user" id="ceph_user" />
</div>
<div class="large-6 columns">
<label for="ceph_secret">
{{tr "Ceph Secret"}}
<span class="tip">
{{tr "A generated UUID for a LibVirt secret (to hold the CephX authentication key in Libvirt on each hypervisor). This should be generated when creating the Ceph datastore in OpenNebula. (Required for Libvirt 1.x when cephx is enabled)."}}
</span>
</label>
<input type="text" name="ceph_secret" id="ceph_secret" />
</div>
<div class="large-6 columns">
<label class="fs" for="staging_dir">
{{tr "Staging Dir"}}
<span class="tip">
{{tr "FS: Default path where images will be temporarily copied to in the host carrying out the registration operation (chosen from the bridge list). If empty, defaults to /var/tmp."}}
<br>
<br>
{{tr "Ceph: Default path for image operations in the OpenNebula Ceph frontend."}}
</span>
</label>
<input type="text" name="staging_dir" id="staging_dir" />
</div>
<div class="large-6 columns">
<label for="rbd_format">
{{tr "RBD Format"}}
<span class="tip">
{{tr "By default RBD Format 2 will be used. If RBD_FORMAT=2 is specified then when instantiating non-persistent images the Ceph driver will perform rbd snap instead of rbd copy."}}
</span>
</label>
<input type="text" name="rbd_format" id="rbd_format" />
</div>
</div>
</form>