mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-22 20:54:49 +09:00
Signed-off-by: Jorge Lobo <jlobo@opennebula.io>
This commit is contained in:
1 parent
018bcd2716
commit
a2a307247d
7 files changed
+201
-173
No files matched your search
@@ -271,3 +271,23 @@
|
||||
|
||||
# Number of tries when connecting to fireedge_endpoint
|
||||
:max_waiting_tries: 5
|
||||
|
||||
#support filesystem
|
||||
:support_fs:
|
||||
- cramfs
|
||||
- ext3
|
||||
- fat
|
||||
- msdos
|
||||
- reiserfs
|
||||
- bfs
|
||||
- exfat
|
||||
- ext4
|
||||
- jfs
|
||||
- nilfs2
|
||||
- vfat
|
||||
- btrfs
|
||||
- ext2
|
||||
- f2fs
|
||||
- minix
|
||||
- ntfs
|
||||
- xfs
|
||||
@@ -19,24 +19,24 @@ define(function(require) {
|
||||
DEPENDENCIES
|
||||
*/
|
||||
|
||||
var BaseFormPanel = require('utils/form-panels/form-panel');
|
||||
var Resumable = require('resumable');
|
||||
var Sunstone = require('sunstone');
|
||||
var OpenNebulaError = require('opennebula/error');
|
||||
var Notifier = require('utils/notifier');
|
||||
var Locale = require('utils/locale');
|
||||
var Tips = require('utils/tips');
|
||||
var OpenNebulaDatastore = require('opennebula/datastore');
|
||||
var ResourceSelect = require('utils/resource-select');
|
||||
var CustomTagsTable = require('utils/custom-tags-table');
|
||||
var BrowserInfo = require('utils/browser-info');
|
||||
var Config = require('sunstone-config');
|
||||
var WizardFields = require('utils/wizard-fields');
|
||||
var ProgressBar = require('utils/progress-bar');
|
||||
var Humanize = require('utils/humanize');
|
||||
var BaseFormPanel = require("utils/form-panels/form-panel");
|
||||
var Resumable = require("resumable");
|
||||
var Sunstone = require("sunstone");
|
||||
var OpenNebulaError = require("opennebula/error");
|
||||
var Notifier = require("utils/notifier");
|
||||
var Locale = require("utils/locale");
|
||||
var Tips = require("utils/tips");
|
||||
var OpenNebulaDatastore = require("opennebula/datastore");
|
||||
var ResourceSelect = require("utils/resource-select");
|
||||
var CustomTagsTable = require("utils/custom-tags-table");
|
||||
var BrowserInfo = require("utils/browser-info");
|
||||
var Config = require("sunstone-config");
|
||||
var WizardFields = require("utils/wizard-fields");
|
||||
var ProgressBar = require("utils/progress-bar");
|
||||
var Humanize = require("utils/humanize");
|
||||
|
||||
var TemplateWizardHTML = require('hbs!./create/wizard');
|
||||
var TemplateAdvancedHTML = require('hbs!./create/advanced');
|
||||
var TemplateWizardHTML = require("hbs!./create/wizard");
|
||||
var TemplateAdvancedHTML = require("hbs!./create/advanced");
|
||||
|
||||
/*
|
||||
CONSTANTS
|
||||
@@ -56,10 +56,10 @@ define(function(require) {
|
||||
}
|
||||
|
||||
this.actions = {
|
||||
'create': {
|
||||
'title': title,
|
||||
'buttonText': Locale.tr("Create"),
|
||||
'resetButton': true
|
||||
"create": {
|
||||
"title": title,
|
||||
"buttonText": Locale.tr("Create"),
|
||||
"resetButton": true
|
||||
}
|
||||
};
|
||||
|
||||
@@ -84,9 +84,9 @@ define(function(require) {
|
||||
|
||||
function _htmlWizard() {
|
||||
return TemplateWizardHTML({
|
||||
'formPanelId': this.formPanelId,
|
||||
'customTagsHTML': CustomTagsTable.html(),
|
||||
'images': (this.resource == "Image")
|
||||
"formPanelId": this.formPanelId,
|
||||
"customTagsHTML": CustomTagsTable.html(),
|
||||
"images": (this.resource == "Image")
|
||||
});
|
||||
}
|
||||
|
||||
@@ -95,33 +95,34 @@ define(function(require) {
|
||||
}
|
||||
|
||||
function _onShow(context) {
|
||||
$("#img_driver").val("");
|
||||
$("#img_name", context).focus();
|
||||
|
||||
var ds_id = $('#img_datastore .resource_list_select', context).val();
|
||||
var ds_id_raw = $('#img_datastore_raw .resource_list_select', context).val();
|
||||
var ds_id = $("#img_datastore .resource_list_select", context).val();
|
||||
var ds_id_raw = $("#img_datastore_raw .resource_list_select", context).val();
|
||||
|
||||
var filterValue;
|
||||
|
||||
if (this.resource == "Image"){
|
||||
filterValue = '' + OpenNebulaDatastore.TYPES.IMAGE_DS;
|
||||
filterValue = "" + OpenNebulaDatastore.TYPES.IMAGE_DS;
|
||||
} else {
|
||||
filterValue = '' + OpenNebulaDatastore.TYPES.FILE_DS
|
||||
filterValue = "" + OpenNebulaDatastore.TYPES.FILE_DS;
|
||||
}
|
||||
|
||||
ResourceSelect.insert({
|
||||
context: $('#img_datastore', context),
|
||||
resourceName: 'Datastore',
|
||||
context: $("#img_datastore", context),
|
||||
resourceName: "Datastore",
|
||||
initValue: ds_id,
|
||||
filterKey: 'TYPE',
|
||||
filterKey: "TYPE",
|
||||
filterValue: filterValue,
|
||||
triggerChange: true
|
||||
});
|
||||
|
||||
ResourceSelect.insert({
|
||||
context: $('#img_datastore_raw', context),
|
||||
resourceName: 'Datastore',
|
||||
context: $("#img_datastore_raw", context),
|
||||
resourceName: "Datastore",
|
||||
initValue: ds_id_raw,
|
||||
filterKey: 'TYPE',
|
||||
filterKey: "TYPE",
|
||||
filterValue: filterValue,
|
||||
triggerChange: true
|
||||
});
|
||||
@@ -134,24 +135,24 @@ define(function(require) {
|
||||
var that = this;
|
||||
Tips.setup(context);
|
||||
|
||||
$('select#img_type', context).change(function() {
|
||||
$("select#img_type", context).change(function() {
|
||||
var value = $(this).val();
|
||||
switch (value){
|
||||
case "DATABLOCK":
|
||||
case "OS":
|
||||
$('#datablock_img', context).removeAttr("disabled");
|
||||
$("#datablock_img", context).removeAttr("disabled");
|
||||
break;
|
||||
default:
|
||||
$('#datablock_img', context).attr('disabled', 'disabled');
|
||||
$('#path_image', context).click();
|
||||
$("#datablock_img", context).attr("disabled", "disabled");
|
||||
$("#path_image", context).click();
|
||||
}
|
||||
});
|
||||
if(config["federation_mode"] == "SLAVE"){
|
||||
$("#upload_image").attr("disabled", "disabled");
|
||||
}
|
||||
|
||||
$('#img_datastore', context).off('change', '.resource_list_select');
|
||||
$('#img_datastore', context).on('change', '.resource_list_select', function() {
|
||||
$("#img_datastore", context).off("change", ".resource_list_select");
|
||||
$("#img_datastore", context).on("change", ".resource_list_select", function() {
|
||||
var ds_id = $(this).val();
|
||||
OpenNebulaDatastore.show({
|
||||
data : {
|
||||
@@ -170,8 +171,8 @@ define(function(require) {
|
||||
if (e["NAME"] == mad && !$.isEmptyObject(e["PERSISTENT_ONLY"])) {
|
||||
if (e["PERSISTENT_ONLY"] != undefined &&
|
||||
e["PERSISTENT_ONLY"].toLowerCase() == "yes") {
|
||||
$('#img_persistent', context).prop('disabled', true);
|
||||
$('#img_persistent', context).val("YES");
|
||||
$("#img_persistent", context).prop("disabled", true);
|
||||
$("#img_persistent", context).val("YES");
|
||||
pers_forced = true;
|
||||
return false;
|
||||
}
|
||||
@@ -181,7 +182,7 @@ define(function(require) {
|
||||
}
|
||||
|
||||
if (!pers_forced) {
|
||||
$('#img_persistent', context).prop('disabled', false);
|
||||
$("#img_persistent", context).prop("disabled", false);
|
||||
}
|
||||
|
||||
// Display adequate values in the dialog.
|
||||
@@ -197,9 +198,9 @@ define(function(require) {
|
||||
|
||||
// Fill in the default driver
|
||||
if (tm_mad == "qcow2"){
|
||||
$('select#img_driver',context).val("qcow2");
|
||||
$("select#img_driver",context).val("qcow2");
|
||||
} else {
|
||||
$('select#img_driver',context).val("raw");
|
||||
//$("select#img_driver",context).val("raw");
|
||||
}
|
||||
},
|
||||
error: function(request, error_json, container){
|
||||
@@ -217,46 +218,50 @@ define(function(require) {
|
||||
];
|
||||
|
||||
$(custom_attrs).each(function(_, field) {
|
||||
$('input[name="custom_'+field+'"]',context).parent().hide();
|
||||
$("input[name=\"custom_"+field+"\"]",context).parent().hide();
|
||||
|
||||
$('select#'+field, context).on("change", function() {
|
||||
var field = $(this).attr('name');
|
||||
$("select#"+field, context).on("change", function() {
|
||||
var field = $(this).attr("name");
|
||||
|
||||
if ($(this).val() == "custom"){
|
||||
$('input[name="custom_'+field+'"]',context).parent().show();
|
||||
$('input[name="custom_'+field+'"]',context).attr('required', '');
|
||||
$("input[name=\"custom_"+field+"\"]",context).parent().show();
|
||||
$("input[name=\"custom_"+field+"\"]",context).attr("required", "");
|
||||
} else {
|
||||
$('input[name="custom_'+field+'"]',context).parent().hide();
|
||||
$('input[name="custom_'+field+'"]',context).removeAttr('required');
|
||||
$("input[name=\"custom_"+field+"\"]",context).parent().hide();
|
||||
$("input[name=\"custom_"+field+"\"]",context).removeAttr("required");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#img_path,#img_size,#file-uploader', context).closest('.row').hide();
|
||||
|
||||
$("#img_path,#img_size,#file-uploader", context).closest(".row").hide();
|
||||
$("input[name='src_path']", context).change(function() {
|
||||
var value = $(this).val();
|
||||
switch (value){
|
||||
case "path":
|
||||
$('#img_size,#file-uploader', context).closest('.row').hide();
|
||||
$('#img_path', context).closest('.row').show();
|
||||
|
||||
$('#img_path', context).attr('required', '');
|
||||
$('#img_size', context).removeAttr('required');
|
||||
$("#img_size,#file-uploader", context).closest(".row").hide();
|
||||
$("#img_path", context).closest(".row").show();
|
||||
$("#img_path", context).attr("required", "");
|
||||
$("#img_size", context).removeAttr("required");
|
||||
$(".datablock-input, .upload-input").addClass("hide");
|
||||
$(".path-input").removeClass("hide");
|
||||
$("#img_driver").val("");
|
||||
break;
|
||||
case "datablock":
|
||||
$('#img_path,#file-uploader', context).closest('.row').hide();
|
||||
$('#img_size', context).closest('.row').show();
|
||||
|
||||
$('#img_path', context).removeAttr('required');
|
||||
$('#img_size', context).attr('required', '');
|
||||
$("#img_path,#file-uploader", context).closest(".row").hide();
|
||||
$("#img_size", context).closest(".row").show();
|
||||
$("#img_path", context).removeAttr("required");
|
||||
$("#img_size", context).attr("required", "");
|
||||
$(".path-input, .upload-input").addClass("hide");
|
||||
$(".datablock-input").removeClass("hide");
|
||||
break;
|
||||
case "upload":
|
||||
$('#img_path,#img_size', context).closest('.row').hide();
|
||||
$('#file-uploader', context).closest('.row').show();
|
||||
|
||||
$('#img_path', context).removeAttr('required');
|
||||
$('#img_size', context).removeAttr('required');
|
||||
$("#img_path,#img_size", context).closest(".row").hide();
|
||||
$("#file-uploader", context).closest(".row").show();
|
||||
$("#img_path", context).removeAttr("required");
|
||||
$("#img_size", context).removeAttr("required");
|
||||
$(".path-input, .datablock-input").addClass("hide");
|
||||
$(".upload-input").removeClass("hide");
|
||||
$("#img_driver").val("");
|
||||
break;
|
||||
}
|
||||
});
|
||||
@@ -264,12 +269,12 @@ define(function(require) {
|
||||
$("#img_type", context).change(function() {
|
||||
var value = $(this).val();
|
||||
if(value == "CDROM")
|
||||
$('#img_persistent', context).closest('.row').hide();
|
||||
$("#img_persistent", context).closest(".row").hide();
|
||||
else
|
||||
$('#img_persistent', context).closest('.row').show();
|
||||
$("#img_persistent", context).closest(".row").show();
|
||||
});
|
||||
|
||||
$('#path_image', context).click();
|
||||
$("#path_image", context).click();
|
||||
|
||||
CustomTagsTable.setup(context);
|
||||
|
||||
@@ -277,97 +282,97 @@ define(function(require) {
|
||||
$("#upload_image").attr("disabled", "disabled");
|
||||
} else {
|
||||
that.uploader = new Resumable({
|
||||
target: 'upload_chunk',
|
||||
target: "upload_chunk",
|
||||
chunkSize: 10 * 1024 * 1024,
|
||||
maxFiles: 1,
|
||||
maxFileSize: config['system_config']['max_upload_file_size'],
|
||||
maxFileSize: config["system_config"]["max_upload_file_size"],
|
||||
testChunks: false,
|
||||
query: {
|
||||
csrftoken: csrftoken
|
||||
}
|
||||
});
|
||||
|
||||
that.uploader.assignBrowse($('#file-uploader-input', context));
|
||||
that.uploader.assignBrowse($("#file-uploader-input", context));
|
||||
|
||||
var fileName = '';
|
||||
var fileName = "";
|
||||
var file_input = false;
|
||||
|
||||
that.uploader.on('fileAdded', function(file) {
|
||||
that.uploader.on("fileAdded", function(file) {
|
||||
fileName = file.fileName;
|
||||
file_input = fileName;
|
||||
|
||||
$('#file-uploader-input', context).hide();
|
||||
$("#file-uploader-input", context).hide();
|
||||
$("#file-uploader-label", context).html(file.fileName);
|
||||
$("#file-uploader-label", context).show();
|
||||
$('#close_image', context).show();
|
||||
$("#close_image", context).show();
|
||||
});
|
||||
|
||||
$('#close_image', context).on('click', function(){
|
||||
$("#close_image", context).on("click", function(){
|
||||
$("#file-uploader-label", context).hide();
|
||||
$('#close_image', context).hide();
|
||||
$('#file-uploader-input', context).show();
|
||||
fileName= '';
|
||||
$("#close_image", context).hide();
|
||||
$("#file-uploader-input", context).show();
|
||||
fileName= "";
|
||||
that.uploader.files.length = 0;
|
||||
});
|
||||
var last_time = 0;
|
||||
var old_size = 0;
|
||||
|
||||
that.uploader.on('uploadStart', function() {
|
||||
that.uploader.on("uploadStart", function() {
|
||||
last_time = new Date().getTime();
|
||||
old_size = 0;
|
||||
var myThis = this;
|
||||
if(!(myThis.progress() > 0)){
|
||||
var element = $('#upload_progress_bars').append(
|
||||
'<div id="' + fileName + 'progressBar" class="row" style="margin-bottom:10px">\
|
||||
<div id="' + fileName + '-info" class="medium-2 columns">\
|
||||
' + Locale.tr("Uploading...") + '\
|
||||
var element = $("#upload_progress_bars").append(
|
||||
"<div id=\"" + fileName + "progressBar\" class=\"row\" style=\"margin-bottom:10px\">\
|
||||
<div id=\"" + fileName + "-info\" class=\"medium-2 columns\">\
|
||||
" + Locale.tr("Uploading...") + "\
|
||||
</div>\
|
||||
<div class="medium-10 columns">\
|
||||
<div class="progressbar">'+
|
||||
ProgressBar.html(0, 1, fileName) + '\
|
||||
<div class=\"medium-10 columns\">\
|
||||
<div class=\"progressbar\">"+
|
||||
ProgressBar.html(0, 1, fileName) + "\
|
||||
</div>\
|
||||
<div>\
|
||||
<button id="close_upload_image" class="fas fa-times-circle fas fa-lg close_upload_image"> </button>\
|
||||
<button id="pause_upload_image" class="fas fa-pause fas fa-lg pause_upload_image"> </button>\
|
||||
<button id="play_upload_image" class="fas fa-play fas fa-lg play_upload_image" hidden="true"> </button>\
|
||||
<button id=\"close_upload_image\" class=\"fas fa-times-circle fas fa-lg close_upload_image\"> </button>\
|
||||
<button id=\"pause_upload_image\" class=\"fas fa-pause fas fa-lg pause_upload_image\"> </button>\
|
||||
<button id=\"play_upload_image\" class=\"fas fa-play fas fa-lg play_upload_image\" hidden=\"true\"> </button>\
|
||||
</div>\
|
||||
</div>\
|
||||
<div class="medium-2 columns">\
|
||||
<div id="speed">speed: </div>\
|
||||
<div id="percent_progress">Completed: </div>\
|
||||
<div class=\"medium-2 columns\">\
|
||||
<div id=\"speed\">speed: </div>\
|
||||
<div id=\"percent_progress\">Completed: </div>\
|
||||
</div>\
|
||||
</div>');
|
||||
</div>");
|
||||
}
|
||||
$(".close_upload_image").on('click', function(){
|
||||
$(".close_upload_image").on("click", function(){
|
||||
myThis.cancel();
|
||||
show=0;
|
||||
if(element)
|
||||
element.remove();
|
||||
});
|
||||
$(".pause_upload_image").on('click', function(){
|
||||
$(".pause_upload_image").on("click", function(){
|
||||
myThis.pause();
|
||||
$(".pause_upload_image").hide();
|
||||
$(".play_upload_image").show();
|
||||
});
|
||||
$(".play_upload_image").on('click', function(){
|
||||
$(".play_upload_image").on("click", function(){
|
||||
myThis.upload();
|
||||
$(".play_upload_image").hide();
|
||||
$(".pause_upload_image").show();
|
||||
});
|
||||
});
|
||||
|
||||
that.uploader.on('progress', function() {
|
||||
that.uploader.on("progress", function() {
|
||||
var time = new Date().getTime();
|
||||
var size = this.getSize() * this.progress();
|
||||
if(time - last_time > 2000){
|
||||
size = size - old_size;
|
||||
var speed = size / ((time - last_time));
|
||||
document.getElementById( 'speed' ).textContent = 'speed: ' + Humanize.size(speed) +'s';
|
||||
document.getElementById( "speed" ).textContent = "speed: " + Humanize.size(speed) +"s";
|
||||
last_time = time;
|
||||
old_size = size;
|
||||
}
|
||||
document.getElementById( 'percent_progress' ).textContent = 'Completed: ' + (this.progress().toFixed(3)*100).toFixed(1) +'%';
|
||||
$('div.progressbar', $('div[id="' + fileName + 'progressBar"]')).html(
|
||||
document.getElementById( "percent_progress" ).textContent = "Completed: " + (this.progress().toFixed(3)*100).toFixed(1) +"%";
|
||||
$("div.progressbar", $("div[id=\"" + fileName + "progressBar\"]")).html(
|
||||
ProgressBar.html(this.progress(), 1, fileName) );
|
||||
});
|
||||
}
|
||||
@@ -379,7 +384,7 @@ define(function(require) {
|
||||
var that = this;
|
||||
var upload = false;
|
||||
|
||||
var ds_id = $('#img_datastore .resource_list_select', context).val();
|
||||
var ds_id = $("#img_datastore .resource_list_select", context).val();
|
||||
if (!ds_id) {
|
||||
Sunstone.hideFormPanelLoading(that.tabId);
|
||||
Notifier.notifyError(Locale.tr("Please select a datastore for this image"));
|
||||
@@ -388,57 +393,57 @@ define(function(require) {
|
||||
|
||||
var img_json = {};
|
||||
|
||||
var name = WizardFields.retrieveInput($('#img_name', context));
|
||||
var name = WizardFields.retrieveInput($("#img_name", context));
|
||||
img_json["NAME"] = name;
|
||||
|
||||
var desc = WizardFields.retrieveInput($('#img_desc', context));
|
||||
var desc = WizardFields.retrieveInput($("#img_desc", context));
|
||||
if (desc != undefined && desc.length) {
|
||||
img_json["DESCRIPTION"] = desc;
|
||||
}
|
||||
|
||||
var type = WizardFields.retrieveInput($('#img_type', context));
|
||||
var type = WizardFields.retrieveInput($("#img_type", context));
|
||||
img_json["TYPE"] = type;
|
||||
|
||||
img_json["PERSISTENT"] = $('#img_persistent', context).val();
|
||||
img_json["PERSISTENT"] = $("#img_persistent", context).val();
|
||||
if ( img_json["PERSISTENT"] == "" ){
|
||||
delete img_json["PERSISTENT"]
|
||||
delete img_json["PERSISTENT"];
|
||||
}
|
||||
|
||||
var dev_prefix = WizardFields.retrieveInput($('#img_dev_prefix', context));
|
||||
var dev_prefix = WizardFields.retrieveInput($("#img_dev_prefix", context));
|
||||
if (dev_prefix != undefined && dev_prefix.length) {
|
||||
if (dev_prefix == "custom") {
|
||||
dev_prefix = WizardFields.retrieveInput($('#custom_img_dev_prefix', context));
|
||||
dev_prefix = WizardFields.retrieveInput($("#custom_img_dev_prefix", context));
|
||||
}
|
||||
img_json["DEV_PREFIX"] = dev_prefix;
|
||||
}
|
||||
|
||||
var driver = WizardFields.retrieveInput($('#img_driver', context));
|
||||
var driver = WizardFields.retrieveInput($("#img_driver", context));
|
||||
if (driver != undefined && driver.length) {
|
||||
if (driver == "custom") {
|
||||
driver = WizardFields.retrieveInput($('#custom_img_driver', context));
|
||||
driver = WizardFields.retrieveInput($("#custom_img_driver", context));
|
||||
}
|
||||
img_json["DRIVER"] = driver;
|
||||
img_json["FORMAT"] = driver;
|
||||
}
|
||||
|
||||
var target = WizardFields.retrieveInput($('#img_target', context));
|
||||
var target = WizardFields.retrieveInput($("#img_target", context));
|
||||
if (target)
|
||||
img_json["TARGET"] = target;
|
||||
|
||||
var vcenter_adapter_type = WizardFields.retrieveInput($('#vcenter_adapter_type', context));
|
||||
var vcenter_adapter_type = WizardFields.retrieveInput($("#vcenter_adapter_type", context));
|
||||
if (vcenter_adapter_type) {
|
||||
if (vcenter_adapter_type == "custom") {
|
||||
vcenter_adapter_type = WizardFields.retrieveInput($('#custom_vcenter_adapter_type', context));
|
||||
vcenter_adapter_type = WizardFields.retrieveInput($("#custom_vcenter_adapter_type", context));
|
||||
}
|
||||
img_json["VCENTER_ADAPTER_TYPE"] = vcenter_adapter_type;
|
||||
}
|
||||
|
||||
switch ($('#src_path_select input:checked', context).val()){
|
||||
switch ($("#src_path_select input:checked", context).val()){
|
||||
case "path":
|
||||
path = WizardFields.retrieveInput($('#img_path', context));
|
||||
path = WizardFields.retrieveInput($("#img_path", context));
|
||||
if (path) img_json["PATH"] = path;
|
||||
break;
|
||||
case "datablock":
|
||||
size = WizardFields.retrieveInput($('#img_size', context));
|
||||
size = WizardFields.retrieveInput($("#img_size", context));
|
||||
|
||||
if(size && $(".mb_input_unit", context).val() == "GB"){
|
||||
size = size * 1024;
|
||||
@@ -446,10 +451,10 @@ define(function(require) {
|
||||
}
|
||||
if (size) img_json["SIZE"] = size;
|
||||
|
||||
var vcenter_disk_type = WizardFields.retrieveInput($('#vcenter_disk_type', context));
|
||||
var vcenter_disk_type = WizardFields.retrieveInput($("#vcenter_disk_type", context));
|
||||
if (vcenter_disk_type) {
|
||||
if (vcenter_disk_type == "custom"){
|
||||
vcenter_disk_type = WizardFields.retrieveInput($('#custom_disk_type', context));
|
||||
vcenter_disk_type = WizardFields.retrieveInput($("#custom_disk_type", context));
|
||||
}
|
||||
img_json["VCENTER_DISK_TYPE"] = vcenter_disk_type;
|
||||
}
|
||||
@@ -479,10 +484,10 @@ define(function(require) {
|
||||
Sunstone.resetFormPanel(that.tabId, that.formPanelId);
|
||||
Sunstone.hideFormPanel(that.tabId);
|
||||
|
||||
that.uploader.on('fileSuccess', function(file) {
|
||||
$('div[id="' + file.fileName + '-info"]').text(Locale.tr("Registering in OpenNebula"));
|
||||
that.uploader.on("fileSuccess", function(file) {
|
||||
$("div[id=\"" + file.fileName + "-info\"]").text(Locale.tr("Registering in OpenNebula"));
|
||||
$.ajax({
|
||||
url: 'upload',
|
||||
url: "upload",
|
||||
type: "POST",
|
||||
data: {
|
||||
csrftoken: csrftoken,
|
||||
@@ -492,12 +497,12 @@ define(function(require) {
|
||||
},
|
||||
success: function() {
|
||||
Notifier.notifyMessage("Image uploaded correctly");
|
||||
$('div[id="' + file.fileName + 'progressBar"]').remove();
|
||||
$("div[id=\"" + file.fileName + "progressBar\"]").remove();
|
||||
Sunstone.runAction(that.resource+".refresh");
|
||||
},
|
||||
error: function(response) {
|
||||
Notifier.onError({}, OpenNebulaError(response));
|
||||
$('div[id="' + file.fileName + 'progressBar"]').remove();
|
||||
$("div[id=\"" + file.fileName + "progressBar\"]").remove();
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -511,8 +516,8 @@ define(function(require) {
|
||||
}
|
||||
|
||||
function _submitAdvanced(context) {
|
||||
var template = $('#template', context).val();
|
||||
var ds_id = $('#img_datastore_raw .resource_list_select', context).val();
|
||||
var template = $("#template", context).val();
|
||||
var ds_id = $("#img_datastore_raw .resource_list_select", context).val();
|
||||
|
||||
if (!ds_id) {
|
||||
Notifier.notifyError(Locale.tr("Please select a datastore for this image"));
|
||||
|
||||
@@ -179,16 +179,14 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row not_vcenter">
|
||||
<div class="large-12 columns">
|
||||
<div class="large-12 columns datablock-input">
|
||||
<label for="img_driver">
|
||||
{{tr "Image mapping driver"}}
|
||||
{{tr "Format"}}
|
||||
</label>
|
||||
<select name="img_driver" id="img_driver">
|
||||
<option value=""></option>
|
||||
<option value="" selected="selected">--</option>
|
||||
<option value="raw">raw</option>
|
||||
<option value="bochs">bochs</option>
|
||||
<option value="qcow2">qcow2</option>
|
||||
<option value="qed">qed</option>
|
||||
<option value="custom">custom</option>
|
||||
</select>
|
||||
<div>
|
||||
|
||||
+12
-1
@@ -64,10 +64,21 @@ define(function(require) {
|
||||
FUNCTION DEFINITIONS
|
||||
*/
|
||||
|
||||
function optionsFilesystem(){
|
||||
var rtn = "";
|
||||
if(config && config.system_config && config.system_config.support_fs && Array.isArray(config.system_config.support_fs)){
|
||||
config.system_config.support_fs.forEach(element => {
|
||||
rtn += "<option>"+element+"</option>";
|
||||
});
|
||||
}
|
||||
return rtn;
|
||||
};
|
||||
|
||||
function _html() {
|
||||
return TemplateHTML({
|
||||
"diskTabId": this.diskTabId,
|
||||
"imageTableSelectHTML": this.imageTable.dataTableHTML
|
||||
"imageTableSelectHTML": this.imageTable.dataTableHTML,
|
||||
"pepe": optionsFilesystem()
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
+9
-1
@@ -95,9 +95,17 @@
|
||||
<option value="fs">{{tr "FS"}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="medium-6 columns">
|
||||
<label for="TYPE">
|
||||
{{tr "Filesystem"}}
|
||||
</label>
|
||||
<select class="hypervisor only_kvm" wizard_field="FS" id="TYPE_KVM" name="type">
|
||||
{{{pepe}}}
|
||||
</select>
|
||||
</div>
|
||||
<div class="medium-6 columns">
|
||||
<label for="FORMAT">
|
||||
{{tr "Filesystem format"}}
|
||||
{{tr "Format"}}
|
||||
</label>
|
||||
<select class="hypervisor only_kvm" wizard_field="FORMAT" name="format" id="FORMAT_KVM">
|
||||
<option value="raw" selected="selected">raw</option>
|
||||
|
||||
+6
-21
@@ -7,21 +7,16 @@
|
||||
</label>
|
||||
<input type="text" wizard_field="TARGET" id="TARGET" name="target" placeholder="sdc"/>
|
||||
</div>
|
||||
<div class="medium-6 columns hypervisor only_kvm not_firecracker">
|
||||
<label for="DRIVER">
|
||||
{{tr "Image mapping driver"}}
|
||||
<div class="medium-6 columns hypervisor only_kvm">
|
||||
<label for="READONLY">
|
||||
{{tr "Read-only"}}
|
||||
</label>
|
||||
<select wizard_field="DRIVER" id="DRIVER" name="DRIVER">
|
||||
<select wizard_field="READONLY" id="READONLY" name="READONLY">
|
||||
<option value=""></option>
|
||||
<option value="raw">raw</option>
|
||||
<option value="bochs">bochs</option>
|
||||
<option value="qcow2">qcow2</option>
|
||||
<option value="qed">qed</option>
|
||||
<option value="custom">custom</option>
|
||||
<option value="yes">{{tr "yes"}}</option>
|
||||
<option value="no">{{tr "no"}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="medium-6 columns hypervisor only_kvm not_lxd not_firecracker">
|
||||
<label>
|
||||
{{tr "BUS"}}
|
||||
@@ -37,16 +32,6 @@
|
||||
<input type="text" id="custom_disk_dev_prefix" name="custom_disk_dev_prefix" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="medium-6 columns hypervisor only_kvm">
|
||||
<label for="READONLY">
|
||||
{{tr "Read-only"}}
|
||||
</label>
|
||||
<select wizard_field="READONLY" id="READONLY" name="READONLY">
|
||||
<option value=""></option>
|
||||
<option value="yes">{{tr "yes"}}</option>
|
||||
<option value="no">{{tr "no"}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="medium-6 columns hypervisor only_vcenter not_firecracker">
|
||||
<label for="vcenter_adapter_type">
|
||||
{{tr "Bus adapter controller"}}
|
||||
|
||||
@@ -44,21 +44,22 @@
|
||||
'threshold_high' : '<%= $conf[:threshold_high] %>',
|
||||
},
|
||||
'system_config' : {
|
||||
'support_fs': JSON.parse('<%= $conf[:support_fs] %>'),
|
||||
'paginate': '<%= $conf[:paginate] %>',
|
||||
'marketplace_url' : '<%= $conf[:marketplace_url] %>',
|
||||
'vnc_request_password' : <%= $conf[:vnc_request_password] || false %>,
|
||||
'vnc_proxy_port' : '<%= $vnc.proxy_port %>',
|
||||
'vnc_client_port' : '<%= $conf[:vnc_client_port] %>',
|
||||
'allow_vnc_federation' : '<%= (!$conf[:allow_vnc_federation].nil?)? $conf[:allow_vnc_federation] : "no" %>',
|
||||
'max_upload_file_size' : <%= $conf[:max_upload_file_size] ? $conf[:max_upload_file_size] : "undefined" %>,
|
||||
'leases' : <%= $conf[:leases] ? $conf[:leases].to_json : "null" %>,
|
||||
'mapped_ips' : '<%= $conf[:mapped_ips] ? $conf[:mapped_ips] : false %>',
|
||||
'get_extended_vm_info': '<%= $conf[:get_extended_vm_info] ? $conf[:get_extended_vm_info] : false %>',
|
||||
'autorefresh_wss': '<%= session[:autorefresh_wss] %>',
|
||||
'autorefresh_ip': '<%= $conf[:autorefresh_ip] %>',
|
||||
'autorefresh_port': '<%= $conf[:port] %>',
|
||||
'fireedge_endpoint': '<%= $conf[:fireedge_endpoint] ? $conf[:fireedge_endpoint] : "http://localhost:2616" %>',
|
||||
'max_waiting_tries': '<%= $conf[:max_waiting_tries] ? $conf[:max_waiting_tries] : 5 %>',
|
||||
'marketplace_url' : '<%= $conf[:marketplace_url] %>',
|
||||
'vnc_request_password' : <%= $conf[:vnc_request_password] || false %>,
|
||||
'vnc_proxy_port' : '<%= $vnc.proxy_port %>',
|
||||
'vnc_client_port' : '<%= $conf[:vnc_client_port] %>',
|
||||
'allow_vnc_federation' : '<%= (!$conf[:allow_vnc_federation].nil?)? $conf[:allow_vnc_federation] : "no" %>',
|
||||
'max_upload_file_size' : <%= $conf[:max_upload_file_size] ? $conf[:max_upload_file_size] : "undefined" %>,
|
||||
'leases' : <%= $conf[:leases] ? $conf[:leases].to_json : "null" %>,
|
||||
'mapped_ips' : '<%= $conf[:mapped_ips] ? $conf[:mapped_ips] : false %>',
|
||||
'get_extended_vm_info': '<%= $conf[:get_extended_vm_info] ? $conf[:get_extended_vm_info] : false %>',
|
||||
'autorefresh_wss': '<%= session[:autorefresh_wss] %>',
|
||||
'autorefresh_ip': '<%= $conf[:autorefresh_ip] %>',
|
||||
'autorefresh_port': '<%= $conf[:port] %>',
|
||||
'fireedge_endpoint': '<%= $conf[:fireedge_endpoint] ? $conf[:fireedge_endpoint] : "http://localhost:2616" %>',
|
||||
'max_waiting_tries': '<%= $conf[:max_waiting_tries] ? $conf[:max_waiting_tries] : 5 %>',
|
||||
},
|
||||
'view' : view,
|
||||
'available_views' : available_views,
|
||||
|
||||
Reference in new issue
Block a user