"+
+ "
"+
+ "
"+
+ "
"+
+ "
"+
+ "
"+
+ "
"+
+ "
"+
+ "
"+Locale.tr("Change Cardinality")+" "+
+ "
"+
+ ""+Locale.tr("The cardinality for this role cannot be changed")+" "+
+ "
"+
+ "
"+
+ "
"+
+ "
"+
+ "
" +
+ "× " +
+ " "+
+ "
");
if (max_vms > min_vms) {
$( ".cardinality_slider_div", context).html(RangeSlider.html({
@@ -469,11 +470,11 @@ define(function(require) {
context.on("click", ".provision_change_cardinality_button", function(){
var flow_id = $(".provision_info_flow", context).attr("flow_id");
- var cardinality = $('.uinput-slider-val', context).val();
+ var cardinality = $(".uinput-slider-val", context).val();
OpenNebula.Role.update({
data : {
- id: flow_id + '/role/' + $(this).attr("role_id"),
+ id: flow_id + "/role/" + $(this).attr("role_id"),
extra_param: {
cardinality: cardinality
}
@@ -483,49 +484,49 @@ define(function(require) {
$(".provision_refresh_info", context).trigger("click");
},
error: Notifier.onError
- })
+ });
});
context.on("click", ".provision_delete_confirm_button", function(){
$(".provision_confirm_action:first", context).html(
- '
'+
- '
'+
- '
'+
- '
'+
+ ""+
+ "
"+
+ "
"+
+ ""+
Locale.tr("Be careful, this action will immediately destroy your Service")+
- ' '+
+ " "+
Locale.tr("All the information will be lost!")+
- ' '+
- '
'+
- '
'+
- ''+Locale.tr("Delete")+' '+
- '
'+
- '
'+
- '
' +
- '× ' +
- ' '+
- '
');
+ " "+
+ "
"+
+ "
"+
+ ""+Locale.tr("Delete")+" "+
+ "
"+
+ "
"+
+ "
" +
+ "× " +
+ " "+
+ "
");
});
context.on("click", ".provision_shutdown_confirm_button", function(){
$(".provision_confirm_action:first", context).html(
- '
'+
- '
'+
- '
'+
- '
'+
+ ""+
+ "
"+
+ "
"+
+ ""+
Locale.tr("Be careful, this action will immediately shutdown your Service")+
- ' '+
+ " "+
Locale.tr("All the information will be lost!")+
- ' '+
- '
'+
- '
'+
- ''+Locale.tr("Shutdown")+' '+
- '
'+
- '
'+
- '
' +
- '× ' +
- ' '+
- '
');
+ " "+
+ "
"+
+ "
"+
+ ""+Locale.tr("Shutdown")+" "+
+ "
"+
+ "
"+
+ "
" +
+ "× " +
+ " "+
+ "
");
});
context.on("click", ".provision_recover_button", function(){
@@ -539,7 +540,7 @@ define(function(require) {
update_provision_flow_info(flow_id, context);
},
error: Notifier.onError
- })
+ });
});
context.on("click", ".provision_shutdown_button", function(){
@@ -553,7 +554,7 @@ define(function(require) {
update_provision_flow_info(flow_id, context);
},
error: Notifier.onError
- })
+ });
});
context.on("click", ".provision_delete_button", function(){
@@ -574,7 +575,7 @@ define(function(require) {
Notifier.onError(request, response);
button.removeAttr("disabled");
}
- })
+ });
});
context.on("click", ".provision_refresh_info", function(){
@@ -592,15 +593,15 @@ define(function(require) {
$(".provision_list_flows", context).on("click", ".provision_info_flow_button", function(){
$("a.provision_show_flow_accordion", context).trigger("click");
- var flow_id = $(this).parents(".provision-pricing-table").attr("opennebula_id")
+ var flow_id = $(this).parents(".provision-pricing-table").attr("opennebula_id");
update_provision_flow_info(flow_id, context);
return false;
- })
+ });
}
function get_provision_flow_start_time(data) {
if (data.log) {
- return data.log[0].timestamp
+ return data.log[0].timestamp;
} else {
return null;
}
@@ -620,51 +621,51 @@ define(function(require) {
switch (parseInt(data.state)) {
case OpenNebula.Service.STATES.PENDING:
- state_color = 'deploying';
+ state_color = "deploying";
state_str = Locale.tr("PENDING");
break;
case OpenNebula.Service.STATES.DEPLOYING:
- state_color = 'deploying';
+ state_color = "deploying";
state_str = Locale.tr("DEPLOYING");
break;
case OpenNebula.Service.STATES.UNDEPLOYING:
- state_color = 'powering_off';
+ state_color = "powering_off";
state_str = Locale.tr("UNDEPLOYING");
break;
case OpenNebula.Service.STATES.FAILED_UNDEPLOYING:
- state_color = 'error';
+ state_color = "error";
state_str = Locale.tr("FAILED UNDEPLOYING");
break;
case OpenNebula.Service.STATES.FAILED_DEPLOYING:
- state_color = 'error';
+ state_color = "error";
state_str = Locale.tr("FAILED DEPLOYING");
break;
case OpenNebula.Service.STATES.FAILED_SCALING:
- state_color = 'error';
+ state_color = "error";
state_str = Locale.tr("FAILED SCALING");
break;
case OpenNebula.Service.STATES.WARNING:
- state_color = 'error';
+ state_color = "error";
state_str = Locale.tr("WARNING");
break;
case OpenNebula.Service.STATES.RUNNING:
- state_color = 'running';
+ state_color = "running";
state_str = Locale.tr("RUNNING");
break;
case OpenNebula.Service.STATES.SCALING:
- state_color = 'deploying';
+ state_color = "deploying";
state_str = Locale.tr("SCALING");
break;
case OpenNebula.Service.STATES.COOLDOWN:
- state_color = 'running';
+ state_color = "running";
state_str = Locale.tr("COOLDOWN");
break;
case OpenNebula.Service.STATES.DONE:
- state_color = 'off';
+ state_color = "off";
state_str = Locale.tr("DONE");
break;
default:
- state_color = 'powering_off';
+ state_color = "powering_off";
state_str = Locale.tr("UNKNOWN");
break;
}
@@ -672,6 +673,6 @@ define(function(require) {
return {
color: state_color,
str: state_str
- }
+ };
}
});
diff --git a/src/sunstone/public/app/tabs/provision-tab/templates/list.js b/src/sunstone/public/app/tabs/provision-tab/templates/list.js
index 2bcc2b8494..3350ec5c21 100644
--- a/src/sunstone/public/app/tabs/provision-tab/templates/list.js
+++ b/src/sunstone/public/app/tabs/provision-tab/templates/list.js
@@ -16,24 +16,24 @@
define(function(require) {
// require('foundation.alert');
- var OpenNebula = require('opennebula');
- var Locale = require('utils/locale');
- var Config = require('sunstone-config');
- var Notifier = require('utils/notifier');
- var Humanize = require('utils/humanize');
- var ResourceSelect = require('utils/resource-select');
- var LabelsUtils = require('utils/labels/utils');
- var TemplateUtils = require('utils/template-utils');
+ var OpenNebula = require("opennebula");
+ var Locale = require("utils/locale");
+ var Config = require("sunstone-config");
+ var Notifier = require("utils/notifier");
+ var Humanize = require("utils/humanize");
+ var ResourceSelect = require("utils/resource-select");
+ var LabelsUtils = require("utils/labels/utils");
+ var TemplateUtils = require("utils/template-utils");
- var TemplateTemplatesList = require('hbs!./list');
+ var TemplateTemplatesList = require("hbs!./list");
var _accordionId = 0;
var TEMPLATE_LABELS_COLUMN = 3;
return {
- 'generate': generate_provision_templates_list,
- 'show': show_provision_template_list,
- 'updateDatatable': update_provision_templates_datatable,
+ "generate": generate_provision_templates_list,
+ "show": show_provision_template_list,
+ "updateDatatable": update_provision_templates_datatable,
};
function show_provision_template_list(timeout) {
@@ -46,7 +46,7 @@ define(function(require) {
function generate_provision_templates_list(context, opts) {
context.off();
context.html(html(opts));
- Foundation.reflow(context, 'accordion');
+ Foundation.reflow(context, "accordion");
setup_provision_templates_list(context, opts);
}
@@ -57,23 +57,23 @@ define(function(require) {
create: true,
active: true,
filter: true
- },opts_arg)
+ },opts_arg);
_accordionId += 1;
- return TemplateTemplatesList({'accordionId': _accordionId, 'opts': opts});
+ return TemplateTemplatesList({"accordionId": _accordionId, "opts": opts});
}
function update_provision_templates_datatable(datatable, timeout) {
- datatable.html('
'+
- ''+
- ' '+
- ' '+
- ' '+
- ' '+
- ' '+
- ''+
- ' '+
- '
');
+ datatable.html("
"+
+ ""+
+ " "+
+ " "+
+ " "+
+ " "+
+ " "+
+ ""+
+ " "+
+ "
");
setTimeout( function(){
OpenNebula.Template.list({
@@ -87,31 +87,31 @@ define(function(require) {
});
if (item_list.length == 0) {
- datatable.html('
'+
- '
'+
- ' '+
- ' '+
- ' '+
- '
'+
- '
'+
- '
'+
+ datatable.html(""+
+ ""+
+ " "+
+ " "+
+ " "+
+ " "+
+ " "+
+ ""+
Locale.tr("There are no templates available")+
- ' '+
- '
');
+ " "+
+ "
");
} else {
datatable.fnAddData(item_list);
}
// Labels are inserted only in the new VM wizard
LabelsUtils.clearLabelsFilter(datatable, TEMPLATE_LABELS_COLUMN);
- var context = $('.labels-dropdown', datatable.closest('#provisionVMInstantiateTemplatesRow'));
+ var context = $(".labels-dropdown", datatable.closest("#provisionVMInstantiateTemplatesRow"));
context.html("");
LabelsUtils.insertLabelsMenu({
- 'context': context,
- 'dataTable': datatable,
- 'labelsColumn': TEMPLATE_LABELS_COLUMN,
- 'labelsPath': 'VMTEMPLATE.TEMPLATE.LABELS',
- 'placeholder': Locale.tr("No labels defined")
+ "context": context,
+ "dataTable": datatable,
+ "labelsColumn": TEMPLATE_LABELS_COLUMN,
+ "labelsPath": "VMTEMPLATE.TEMPLATE.LABELS",
+ "placeholder": Locale.tr("No labels defined")
});
},
error: Notifier.onError
@@ -120,9 +120,9 @@ define(function(require) {
}
function setup_provision_templates_list(context, opts) {
- var provision_templates_datatable = $('.provision_templates_table', context).dataTable({
+ var provision_templates_datatable = $(".provision_templates_table", context).dataTable({
"iDisplayLength": 8,
- "sDom" : '<"H">t<"F"lp>',
+ "sDom" : "<\"H\">t<\"F\"lp>",
"aLengthMenu": [[6, 12, 36, 72], [6, 12, 36, 72]],
"aaSorting" : [[0, "desc"]],
"aoColumnDefs": [
@@ -135,22 +135,22 @@ define(function(require) {
],
"fnPreDrawCallback": function (oSettings) {
// create a thumbs container if it doesn't exist. put it in the dataTables_scrollbody div
- if (this.$('tr', {"filter": "applied"} ).length == 0) {
- this.html('
'+
- '
'+
- ' '+
- ' '+
- ' '+
- '
'+
- '
'+
- '
'+
+ if (this.$("tr", {"filter": "applied"} ).length == 0) {
+ this.html(""+
+ ""+
+ " "+
+ " "+
+ " "+
+ " "+
+ " "+
+ ""+
Locale.tr("There are no templates available")+
- ' '+
+ " "+
Locale.tr("Create a template by saving a running Virtual Machine")+
- ' '+
- '
');
+ " "+
+ "
");
} else {
- $(".provision_templates_table", context).html('
');
+ $(".provision_templates_table", context).html("
");
}
return true;
},
@@ -158,74 +158,74 @@ define(function(require) {
var data = aData.VMTEMPLATE;
var actions_html = "";
if (Config.isTabActionEnabled("provision-tab", "Template.chmod")) {
- if (data.UID == config['user_id']) {
+ if (data.UID == config["user_id"]) {
if (data.PERMISSIONS.GROUP_U == "1") {
- actions_html += '
';
- actions_html += '
' + Locale.tr("SHARED") + ' ';
+ actions_html += "
";
+ actions_html += "
" + Locale.tr("SHARED") + " ";
} else {
- actions_html += '
';
+ actions_html += "
";
}
}
}
if (Config.isTabActionEnabled("provision-tab", "Template.delete") && data["PERMISSIONS"]["OWNER_M"] === "1") {
- actions_html += '
';
+ actions_html += "
";
}
var cpu_txt = "";
var mem_txt = "";
if(data.TEMPLATE.CPU){
- cpu_txt = 'x'+TemplateUtils.htmlEncode(data.TEMPLATE.CPU);
+ cpu_txt = "x"+TemplateUtils.htmlEncode(data.TEMPLATE.CPU);
}
if(data.TEMPLATE.MEMORY){
if (data.TEMPLATE.MEMORY > 1000){
- mem_txt = Math.floor(data.TEMPLATE.MEMORY/1024)+'GB';
+ mem_txt = Math.floor(data.TEMPLATE.MEMORY/1024)+"GB";
} else {
- mem_txt = TemplateUtils.htmlEncode(data.TEMPLATE.MEMORY)+'MB';
+ mem_txt = TemplateUtils.htmlEncode(data.TEMPLATE.MEMORY)+"MB";
}
}
- $(".provision_templates_ul", context).append('
'+
- '"+
+ "
");
return nRow;
}
});
- $('.provision_list_templates_search', context).on('input',function(){
+ $(".provision_list_templates_search", context).on("input",function(){
provision_templates_datatable.fnFilter( $(this).val() );
- })
+ });
context.on("click", ".provision_templates_list_refresh_button", function(){
OpenNebula.Action.clear_cache("VMTEMPLATE");
@@ -244,13 +244,13 @@ define(function(require) {
} else {
provision_templates_datatable.fnFilter("", 2);
}
- })
+ });
ResourceSelect.insert({
- context: $('.provision_list_templates_filter', context),
- resourceName: 'User',
+ context: $(".provision_list_templates_filter", context),
+ resourceName: "User",
initValue: (opts.filter_expression ? opts.filter_expression : "-2"),
- extraOptions: '
' + Locale.tr("ALL") + ' ',
+ extraOptions: "
" + Locale.tr("ALL") + " ",
triggerChange: true,
onlyName: true
});
@@ -267,23 +267,23 @@ define(function(require) {
var template_name = $(".provision-title", ul_context).text();
$(".provision_confirm_delete_template_div", context).html(
- '
'+
- '
'+
- '
'+
- '
'+
+ "
"+
+ "
"+
+ "
"+
+ "
"+
Locale.tr("Handle with care! This action will immediately destroy the template")+
- ' "' + template_name + '" ' +
+ " \"" + template_name + "\" " +
Locale.tr("and the image associated.") +
- '
'+
- '
'+
- '
'+
- ''+Locale.tr("Delete")+' '+
- '
'+
- '
'+
- '
' +
- '× ' +
- ' ' +
- '
');
+ ""+
+ "
"+
+ "
"+
+ ""+Locale.tr("Delete")+" "+
+ "
"+
+ "
"+
+ "
" +
+ "× " +
+ " " +
+ "
");
});
context.on("click", ".provision_delete_template_button", function(){
@@ -305,7 +305,7 @@ define(function(require) {
Notifier.onError(request, error_json, container);
$(".provision_templates_list_refresh_button", context).trigger("click");
}
- })
+ });
});
}
@@ -317,23 +317,23 @@ define(function(require) {
var template_name = $(".provision-title", ul_context).text();
$(".provision_confirm_delete_template_div", context).html(
- '
'+
- '
'+
- '
'+
- '
'+
+ "
"+
+ "
"+
+ "
"+
+ "
"+
Locale.tr("The template")+
- ' "' + template_name + '" ' +
+ " \"" + template_name + "\" " +
Locale.tr("and the image associated will be shared and all the users will be able to instantiate new VMs using this template.") +
- '
'+
- '
'+
- '
'+
- ''+Locale.tr("Share template")+' '+
- '
'+
- '
'+
- '
' +
- '× ' +
- ' ' +
- '
');
+ ""+
+ "
"+
+ "
"+
+ ""+Locale.tr("Share template")+" "+
+ "
"+
+ "
"+
+ "
" +
+ "× " +
+ " " +
+ "
");
});
context.on("click", ".provision_chmod_template_button", function(){
@@ -348,15 +348,15 @@ define(function(require) {
data : {
id : template_id,
extra_param: {
- 'group_u': 1,
- 'recursive' : true
+ "group_u": 1,
+ "recursive" : true
}
},
success: function (){
$(".provision_templates_list_refresh_button", context).trigger("click");
},
error: Notifier.onError
- })
+ });
});
context.on("click", ".provision_confirm_unshare_template_button", function(){
@@ -365,23 +365,23 @@ define(function(require) {
var template_name = $(".provision-title", ul_context).first().text();
$(".provision_confirm_delete_template_div", context).html(
- '
'+
- '
'+
- '
'+
- '
'+
+ "
"+
+ "
"+
+ "
"+
+ "
"+
Locale.tr("The template")+
- ' "' + template_name + '" ' +
+ " \"" + template_name + "\" " +
Locale.tr("and the image associated will be unshared and the users will not be able to instantiate new VMs using this template.") +
- '
'+
- '
'+
- '
'+
- ''+Locale.tr("Unshare template")+' '+
- '
'+
- '
'+
- '
' +
- '× ' +
- ' ' +
- '
');
+ ""+
+ "
"+
+ "
"+
+ ""+Locale.tr("Unshare template")+" "+
+ "
"+
+ "
"+
+ "
" +
+ "× " +
+ " " +
+ "
");
});
context.on("click", ".provision_unshare_template_button", function(){
@@ -395,15 +395,15 @@ define(function(require) {
data : {
id : template_id,
extra_param: {
- 'group_u': 0,
- 'recursive' : true
+ "group_u": 0,
+ "recursive" : true
}
},
success: function (){
$(".provision_templates_list_refresh_button", context).trigger("click");
},
error: Notifier.onError
- })
+ });
});
}
@@ -413,16 +413,16 @@ define(function(require) {
}
function get_provision_disk_image(data) {
- var disks = []
+ var disks = [];
if ($.isArray(data.TEMPLATE.DISK))
- disks = data.TEMPLATE.DISK
+ disks = data.TEMPLATE.DISK;
else if (!$.isEmptyObject(data.TEMPLATE.DISK))
- disks = [data.TEMPLATE.DISK]
+ disks = [data.TEMPLATE.DISK];
if (disks.length > 0 && disks[0].IMAGE) {
return disks[0].IMAGE;
} else {
- return '';
+ return "";
}
}
});
diff --git a/src/sunstone/public/app/tabs/provision-tab/vms/list.js b/src/sunstone/public/app/tabs/provision-tab/vms/list.js
index f3c00e3349..ffac447d24 100644
--- a/src/sunstone/public/app/tabs/provision-tab/vms/list.js
+++ b/src/sunstone/public/app/tabs/provision-tab/vms/list.js
@@ -16,37 +16,37 @@
define(function(require) {
// require('foundation.alert');
- var Sunstone = require('sunstone');
- var OpenNebula = require('opennebula');
- var OpenNebulaVM = require('opennebula/vm');
- var Locale = require('utils/locale');
- var Config = require('sunstone-config');
- var Notifier = require('utils/notifier');
- var Humanize = require('utils/humanize');
- var ResourceSelect = require('utils/resource-select');
- var Graphs = require('utils/graphs');
- var TemplateUtils = require('utils/template-utils');
- var StateActions = require('tabs/vms-tab/utils/state-actions');
- var Vnc = require('utils/vnc');
- var Spice = require('utils/spice');
+ var Sunstone = require("sunstone");
+ var OpenNebula = require("opennebula");
+ var OpenNebulaVM = require("opennebula/vm");
+ var Locale = require("utils/locale");
+ var Config = require("sunstone-config");
+ var Notifier = require("utils/notifier");
+ var Humanize = require("utils/humanize");
+ var ResourceSelect = require("utils/resource-select");
+ var Graphs = require("utils/graphs");
+ var TemplateUtils = require("utils/template-utils");
+ var StateActions = require("tabs/vms-tab/utils/state-actions");
+ var Vnc = require("utils/vnc");
+ var Spice = require("utils/spice");
- var TemplateVmsList = require('hbs!./list');
- var TemplateConfirmSaveAsTemplate = require('hbs!./confirm_save_as_template');
- var TemplateConfirmTerminate = require('hbs!./confirm_terminate');
- var TemplateConfirmPoweroff = require('hbs!./confirm_poweroff');
- var TemplateConfirmUndeploy = require('hbs!./confirm_undeploy');
- var TemplateConfirmReboot = require('hbs!./confirm_reboot');
+ var TemplateVmsList = require("hbs!./list");
+ var TemplateConfirmSaveAsTemplate = require("hbs!./confirm_save_as_template");
+ var TemplateConfirmTerminate = require("hbs!./confirm_terminate");
+ var TemplateConfirmPoweroff = require("hbs!./confirm_poweroff");
+ var TemplateConfirmUndeploy = require("hbs!./confirm_undeploy");
+ var TemplateConfirmReboot = require("hbs!./confirm_reboot");
- var TAB_ID = require('../tabId');
+ var TAB_ID = require("../tabId");
var _accordionId = 0;
- var VNC_DIALOG_ID = require('tabs/vms-tab/dialogs/vnc/dialogId');
- var SPICE_DIALOG_ID = require('tabs/vms-tab/dialogs/spice/dialogId');
+ var VNC_DIALOG_ID = require("tabs/vms-tab/dialogs/vnc/dialogId");
+ var SPICE_DIALOG_ID = require("tabs/vms-tab/dialogs/spice/dialogId");
return {
- 'generate': generate_provision_vms_list,
- 'show': show_provision_vm_list,
- 'state': get_provision_vm_state
+ "generate": generate_provision_vms_list,
+ "show": show_provision_vm_list,
+ "state": get_provision_vm_state
};
function show_provision_vm_list(timeout, context) {
@@ -61,10 +61,10 @@ define(function(require) {
context.off();
context.html(html(opts));
- Foundation.reflow(context, 'accordion');
-
+ Foundation.reflow(context, "accordion");
+
if (opts.data) {
- $(".provision_vms_table", context).data("opennebula", opts.data)
+ $(".provision_vms_table", context).data("opennebula", opts.data);
}
setup_provision_vms_list(context, opts);
@@ -77,66 +77,67 @@ define(function(require) {
refresh: true,
create: true,
filter: true
- }, opts_arg)
+ }, opts_arg);
_accordionId += 1;
- return TemplateVmsList({'accordionId': _accordionId, 'opts': opts});
+ return TemplateVmsList({"accordionId": _accordionId, "opts": opts});
}
function fill_provision_vms_datatable(datatable, item_list) {
datatable.fnClearTable(true);
if (item_list.length == 0) {
- datatable.html('
' +
- '
' +
- ' ' +
- ' ' +
- ' ' +
- '
' +
- '
' +
- '
' +
+ datatable.html("" +
+ "" +
+ " " +
+ " " +
+ " " +
+ " " +
+ " " +
+ "" +
Locale.tr("There are no Virtual Machines") +
- ' ' +
- ' ' +
- ' ' +
- '
');
+ " " +
+ "
" +
+ "
" +
+ "
");
} else {
datatable.fnAddData(item_list);
}
}
function update_provision_vms_datatable(datatable, timeout) {
- datatable.html('
' +
- '' +
- ' ' +
- ' ' +
- ' ' +
- ' ' +
- ' ' +
- '' +
- ' ' +
- '
');
+ datatable.html("
" +
+ "" +
+ " " +
+ " " +
+ " " +
+ " " +
+ " " +
+ "" +
+ " " +
+ "
");
- var data = datatable.data('opennebula');
+ var data = datatable.data("opennebula");
if (data) {
- fill_provision_vms_datatable(datatable, data)
+ fill_provision_vms_datatable(datatable, data);
} else {
setTimeout(function() {
+ console.log("i");
OpenNebula.VM.list({
timeout: true,
success: function (request, item_list) {
- fill_provision_vms_datatable(datatable, item_list)
+ fill_provision_vms_datatable(datatable, item_list);
},
error: Notifier.onError
- })
+ });
}, timeout);
}
}
function setup_provision_vms_list(context, opts) {
- var provision_vms_datatable = $('.provision_vms_table', context).dataTable({
+ var provision_vms_datatable = $(".provision_vms_table", context).dataTable({
"iDisplayLength": 6,
"bAutoWidth": false,
- "sDom" : '<"H">t<"F"lp>',
+ "sDom" : "<\"H\">t<\"F\"lp>",
"aLengthMenu": [[6, 12, 36, 72], [6, 12, 36, 72]],
"aaSorting" : [[0, "desc"]],
"aoColumnDefs": [
@@ -150,20 +151,20 @@ define(function(require) {
],
"fnPreDrawCallback": function (oSettings) {
// create a thumbs container if it doesn't exist. put it in the dataTables_scrollbody div
- if (this.$('tr', {"filter": "applied"} ).length == 0) {
- this.html('
'+
- '
'+
- ' '+
- ' '+
- ' '+
- '
'+
- '
'+
- '
'+
+ if (this.$("tr", {"filter": "applied"} ).length == 0) {
+ this.html(""+
+ ""+
+ " "+
+ " "+
+ " "+
+ " "+
+ " "+
+ ""+
Locale.tr("There are no Virtual Machines")+
- ' '+
- '
');
+ " "+
+ "
");
} else {
- $(".provision_vms_table", context).html('
');
+ $(".provision_vms_table", context).html("
");
}
return true;
@@ -179,51 +180,51 @@ define(function(require) {
var monitoring = "";
if(data.MONITORING.GUEST_IP){
- monitoring = '
' + data.MONITORING.GUEST_IP + '';
+ monitoring = "
" + data.MONITORING.GUEST_IP + "";
}
- $(".provision_vms_ul", context).append('
'+
- '"+
+ "
");
return nRow;
}
});
- $('.provision_list_vms_search', context).on('input',function(){
+ $(".provision_list_vms_search", context).on("input",function(){
provision_vms_datatable.fnFilter( $(this).val() );
- })
+ });
context.on("click", ".provision_vms_list_refresh_button", function(){
OpenNebula.Action.clear_cache("VM");
@@ -237,13 +238,13 @@ define(function(require) {
} else {
provision_vms_datatable.fnFilter("", 2);
}
- })
+ });
ResourceSelect.insert({
- context: $('.provision_list_vms_filter', context),
- resourceName: 'User',
+ context: $(".provision_list_vms_filter", context),
+ resourceName: "User",
initValue: (opts.filter_expression ? opts.filter_expression : "-2"),
- extraOptions: '
' + Locale.tr("ALL") + ' ',
+ extraOptions: "
" + Locale.tr("ALL") + " ",
triggerChange: true,
onlyName: true
});
@@ -264,7 +265,7 @@ define(function(require) {
//var tempScrollTop = $(window).scrollTop();
$(".provision_info_vm_name", context).text("");
$(".provision_info_vm_loading", context).show();
- $(".provision_info_vm", context).css('visibility', 'hidden');
+ $(".provision_info_vm", context).css("visibility", "hidden");
OpenNebula.VM.show({
data : {
@@ -274,7 +275,7 @@ define(function(require) {
success: function(request, response){
Sunstone.insertPanels(TAB_ID, response, TAB_ID, $(".provision-sunstone-info", context));
- var data = response.VM
+ var data = response.VM;
var state = get_provision_vm_state(data);
// helper, cleaner code
@@ -341,11 +342,11 @@ define(function(require) {
$(".provision_info_vm_name", context).text(data.NAME);
- if (Config.isTabActionEnabled("provision-tab", 'VM.rename')) {
+ if (Config.isTabActionEnabled("provision-tab", "VM.rename")) {
context.off("click", ".provision_info_vm_rename a");
context.on("click", ".provision_info_vm_rename a", function() {
var valueStr = $(".provision_info_vm_name", context).text();
- $(".provision_info_vm_name", context).html('
');
+ $(".provision_info_vm_name", context).html("
");
});
context.off("change", ".input_edit_value_rename");
@@ -371,45 +372,45 @@ define(function(require) {
}
$(".provision-pricing-table_vm_info", context).html(
- '
'+
- ''+
- ''+
- ' '+
- ' '+
+ ""+
+ ""+
+ ""+
+ " "+
+ " "+
state.str+
- ' '+
- ' '+
- ''+
- ''+
- ' '+
- 'x'+TemplateUtils.htmlEncode(data.TEMPLATE.CPU)+' - '+
+ " "+
+ " "+
+ ""+
+ ""+
+ " "+
+ "x"+TemplateUtils.htmlEncode(data.TEMPLATE.CPU)+" - "+
((data.TEMPLATE.MEMORY > 1000) ?
- (Math.floor(data.TEMPLATE.MEMORY/1024)+'GB') :
- (TemplateUtils.htmlEncode(data.TEMPLATE.MEMORY)+'MB'))+
- ' '+
- ' - '+
- ''+
+ (Math.floor(data.TEMPLATE.MEMORY/1024)+"GB") :
+ (TemplateUtils.htmlEncode(data.TEMPLATE.MEMORY)+"MB"))+
+ " "+
+ " - "+
+ ""+
get_provision_disk_image(data) +
- ' '+
- ' '+
- ''+
- ''+
+ " "+
+ " "+
+ ""+
+ ""+
get_provision_ips(data) +
- ' '+
- ' '+
- ''+
- ''+
- ' '+
+ " "+
+ " "+
+ ""+
+ ""+
+ " "+
data.UNAME+
- ' '+
- ''+
- ' '+
+ " "+
+ ""+
+ " "+
Humanize.prettyTimeAgo(data.STIME)+
- ' - '+
- 'ID: '+
+ " - "+
+ "ID: "+
data.ID+
- ' '+
- ' ');
+ " "+
+ " ");
if (Config.isFeatureEnabled("show_vcenter_info") && data.USER_TEMPLATE.HYPERVISOR === "vcenter"){
var vcenter_info = "";
@@ -435,7 +436,7 @@ define(function(require) {
$(".provision_confirm_action:first", context).html("");
- $(".provision_info_vm", context).css('visibility', 'visible');
+ $(".provision_info_vm", context).css("visibility", "visible");
$(".provision_info_vm_loading", context).hide();
//$(window).scrollTop(tempScrollTop);
@@ -503,9 +504,9 @@ define(function(require) {
);
}
}
- })
+ });
}
- })
+ });
}
if (Config.isTabActionEnabled("provision-tab", "VM.save_as_template")) {
@@ -520,10 +521,10 @@ define(function(require) {
var context = $(".provision_info_vm[vm_id]");
var vm_id = context.attr("vm_id");
- var template_name = $('.provision_snapshot_name', context).val();
- var template_description = $('.provision_snapshot_description', context).val();
+ var template_name = $(".provision_snapshot_name", context).val();
+ var template_description = $(".provision_snapshot_description", context).val();
var persistent =
- ($('input[name=provision_snapshot_radio]:checked').val() == "persistent");
+ ($("input[name=provision_snapshot_radio]:checked").val() == "persistent");
OpenNebula.VM.save_as_template({
data : {
@@ -537,7 +538,7 @@ define(function(require) {
timeout: false,
success: function(request, response){
OpenNebula.Action.clear_cache("VMTEMPLATE");
- Notifier.notifyMessage(Locale.tr("VM Template") + ' ' + request.request.data[1].name + ' ' + Locale.tr("saved successfully"))
+ Notifier.notifyMessage(Locale.tr("VM Template") + " " + request.request.data[1].name + " " + Locale.tr("saved successfully"));
update_provision_vm_info(vm_id, context);
button.removeAttr("disabled");
},
@@ -551,7 +552,7 @@ define(function(require) {
}
button.removeAttr("disabled");
}
- })
+ });
return false;
});
@@ -641,7 +642,7 @@ define(function(require) {
var button = $(this);
button.attr("disabled", "disabled");
var vm_id = $(".provision_info_vm", context).attr("vm_id");
- var terminate_action = $('input[name=provision_terminate_radio]:checked').val()
+ var terminate_action = $("input[name=provision_terminate_radio]:checked").val();
OpenNebula.VM[terminate_action]({
data : {
@@ -655,7 +656,7 @@ define(function(require) {
Notifier.onError(request, response);
button.removeAttr("disabled");
}
- })
+ });
return false;
});
@@ -664,7 +665,7 @@ define(function(require) {
var button = $(this);
button.attr("disabled", "disabled");
var vm_id = $(".provision_info_vm", context).attr("vm_id");
- var poweroff_action = $('input[name=provision_poweroff_radio]:checked').val()
+ var poweroff_action = $("input[name=provision_poweroff_radio]:checked").val();
OpenNebula.VM[poweroff_action]({
data : {
@@ -678,7 +679,7 @@ define(function(require) {
Notifier.onError(request, response);
button.removeAttr("disabled");
}
- })
+ });
return false;
});
@@ -687,7 +688,7 @@ define(function(require) {
var button = $(this);
button.attr("disabled", "disabled");
var vm_id = $(".provision_info_vm", context).attr("vm_id");
- var undeploy_action = $('input[name=provision_undeploy_radio]:checked').val()
+ var undeploy_action = $("input[name=provision_undeploy_radio]:checked").val();
OpenNebula.VM[undeploy_action]({
data : {
@@ -701,7 +702,7 @@ define(function(require) {
Notifier.onError(request, response);
button.removeAttr("disabled");
}
- })
+ });
return false;
});
@@ -711,7 +712,7 @@ define(function(require) {
button.attr("disabled", "disabled");
var vm_id = $(".provision_info_vm", context).attr("vm_id");
- var reboot_action = $('input[name=provision_reboot_radio]:checked').val()
+ var reboot_action = $("input[name=provision_reboot_radio]:checked").val();
OpenNebula.VM[reboot_action]({
data : {
@@ -725,7 +726,7 @@ define(function(require) {
Notifier.onError(request, response);
button.removeAttr("disabled");
}
- })
+ });
return false;
});
@@ -747,7 +748,7 @@ define(function(require) {
Notifier.onError(request, response);
button.removeAttr("disabled");
}
- })
+ });
return false;
});
@@ -777,14 +778,14 @@ define(function(require) {
button.removeAttr("disabled");
} else {
- Notifier.notifyError("The remote console is not enabled for this VM")
+ Notifier.notifyError("The remote console is not enabled for this VM");
}
},
error: function(request, response){
Notifier.onError(request, response);
button.removeAttr("disabled");
}
- })
+ });
return false;
});
@@ -803,10 +804,10 @@ define(function(require) {
$("a.provision_show_vm_accordion", context).trigger("click");
// TODO loading
- var vm_id = $(this).parents(".provision-pricing-table").attr("opennebula_id")
+ var vm_id = $(this).parents(".provision-pricing-table").attr("opennebula_id");
update_provision_vm_info(vm_id, context);
return false;
- })
+ });
}
@@ -827,7 +828,7 @@ define(function(require) {
case OpenNebulaVM.STATES.INIT:
case OpenNebulaVM.STATES.PENDING:
case OpenNebulaVM.STATES.HOLD:
- state_color = 'deploying';
+ state_color = "deploying";
state_str = Locale.tr("DEPLOYING") + " (2/4)";
break;
case OpenNebulaVM.STATES.ACTIVE:
@@ -835,13 +836,13 @@ define(function(require) {
switch (lcm_state) {
case OpenNebulaVM.LCM_STATES.LCM_INIT:
- state_color = 'deploying';
+ state_color = "deploying";
state_str = Locale.tr("DEPLOYING") + " (2/4)";
break;
case OpenNebulaVM.LCM_STATES.PROLOG:
case OpenNebulaVM.LCM_STATES.PROLOG_RESUME:
case OpenNebulaVM.LCM_STATES.PROLOG_UNDEPLOY:
- state_color = 'deploying';
+ state_color = "deploying";
state_str = Locale.tr("DEPLOYING") + " (3/4)";
break;
case OpenNebulaVM.LCM_STATES.BOOT:
@@ -850,7 +851,7 @@ define(function(require) {
case OpenNebulaVM.LCM_STATES.BOOT_SUSPENDED:
case OpenNebulaVM.LCM_STATES.BOOT_STOPPED:
case OpenNebulaVM.LCM_STATES.BOOT_UNDEPLOY:
- state_color = 'deploying';
+ state_color = "deploying";
state_str = Locale.tr("DEPLOYING") + " (4/4)";
break;
case OpenNebulaVM.LCM_STATES.RUNNING:
@@ -872,7 +873,7 @@ define(function(require) {
case OpenNebulaVM.LCM_STATES.DISK_RESIZE:
case OpenNebulaVM.LCM_STATES.DISK_RESIZE_POWEROFF:
case OpenNebulaVM.LCM_STATES.DISK_RESIZE_UNDEPLOYED:
- state_color = 'running';
+ state_color = "running";
state_str = Locale.tr("RUNNING");
break;
case OpenNebulaVM.LCM_STATES.HOTPLUG:
@@ -882,7 +883,7 @@ define(function(require) {
case OpenNebulaVM.LCM_STATES.HOTPLUG_SAVEAS_SUSPENDED:
case OpenNebulaVM.LCM_STATES.HOTPLUG_PROLOG_POWEROFF:
case OpenNebulaVM.LCM_STATES.HOTPLUG_EPILOG_POWEROFF:
- state_color = 'deploying';
+ state_color = "deploying";
state_str = Locale.tr("SAVING IMAGE");
break;
case OpenNebulaVM.LCM_STATES.FAILURE:
@@ -900,7 +901,7 @@ define(function(require) {
case OpenNebulaVM.LCM_STATES.PROLOG_RESUME_FAILURE:
case OpenNebulaVM.LCM_STATES.PROLOG_UNDEPLOY_FAILURE:
case OpenNebulaVM.LCM_STATES.PROLOG_MIGRATE_UNKNOWN_FAILURE:
- state_color = 'error';
+ state_color = "error";
state_str = Locale.tr("ERROR");
break;
case OpenNebulaVM.LCM_STATES.SAVE_STOP:
@@ -915,15 +916,15 @@ define(function(require) {
case OpenNebulaVM.LCM_STATES.SHUTDOWN_UNDEPLOY:
case OpenNebulaVM.LCM_STATES.CLEANUP_RESUBMIT:
case OpenNebulaVM.LCM_STATES.CLEANUP_DELETE:
- state_color = 'powering_off';
+ state_color = "powering_off";
state_str = Locale.tr("POWERING OFF");
break;
case OpenNebulaVM.LCM_STATES.UNKNOWN:
- state_color = 'powering_off';
+ state_color = "powering_off";
state_str = Locale.tr("UNKNOWN");
break;
default:
- state_color = 'powering_off';
+ state_color = "powering_off";
state_str = Locale.tr("UNKNOWN");
break;
}
@@ -933,28 +934,28 @@ define(function(require) {
case OpenNebulaVM.STATES.SUSPENDED:
case OpenNebulaVM.STATES.POWEROFF:
case OpenNebulaVM.STATES.DONE:
- state_color = 'off';
+ state_color = "off";
state_str = Locale.tr("OFF");
break;
case OpenNebulaVM.STATES.UNDEPLOYED:
- state_color = 'undeployed';
+ state_color = "undeployed";
state_str = Locale.tr("UNDEPLOYED");
break;
case OpenNebulaVM.STATES.CLONING:
- state_color = 'deploying';
+ state_color = "deploying";
state_str = Locale.tr("DEPLOYING") + " (1/4)";
break;
case OpenNebulaVM.STATES.CLONING_FAILURE:
- state_color = 'error';
+ state_color = "error";
state_str = Locale.tr("ERROR");
break;
default:
- state_color = 'powering_off';
+ state_color = "powering_off";
state_str = Locale.tr("UNKNOWN");
break;
}
@@ -962,25 +963,25 @@ define(function(require) {
return {
color: state_color,
str: state_str
- }
+ };
}
function get_provision_disk_image(data) {
- var disks = []
+ var disks = [];
if ($.isArray(data.TEMPLATE.DISK))
- disks = data.TEMPLATE.DISK
+ disks = data.TEMPLATE.DISK;
else if (!$.isEmptyObject(data.TEMPLATE.DISK))
- disks = [data.TEMPLATE.DISK]
+ disks = [data.TEMPLATE.DISK];
if (disks.length > 0) {
- return disks[0].IMAGE != undefined ? disks[0].IMAGE : '';
+ return disks[0].IMAGE != undefined ? disks[0].IMAGE : "";
} else {
- return '';
+ return "";
}
}
function get_provision_ips(data) {
- return '
' + OpenNebula.VM.ipsStr(data, ', ');
+ return "
" + OpenNebula.VM.ipsStr(data, ", ");
}
// @params
@@ -999,30 +1000,30 @@ define(function(require) {
switch (state) {
case "READY":
case "USED":
- state_color = 'running';
+ state_color = "running";
state_str = Locale.tr("READY");
break;
case "DISABLED":
case "USED_PERS":
- state_color = 'off';
+ state_color = "off";
state_str = Locale.tr("OFF");
break;
case "LOCKED":
case "CLONE":
case "INIT":
- state_color = 'deploying';
+ state_color = "deploying";
state_str = Locale.tr("DEPLOYING") + " (1/3)";
break;
case "ERROR":
- state_color = 'error';
+ state_color = "error";
state_str = Locale.tr("ERROR");
break;
case "DELETE":
- state_color = 'error';
+ state_color = "error";
state_str = Locale.tr("DELETING");
break;
default:
- state_color = 'powering_off';
+ state_color = "powering_off";
state_str = Locale.tr("UNKNOWN");
break;
}
@@ -1030,6 +1031,6 @@ define(function(require) {
return {
color: state_color,
str: state_str
- }
+ };
}
});
diff --git a/src/sunstone/public/app/tabs/templates-tab/dialogs/clone.js b/src/sunstone/public/app/tabs/templates-tab/dialogs/clone.js
index b2e81b3869..d8cbec136a 100644
--- a/src/sunstone/public/app/tabs/templates-tab/dialogs/clone.js
+++ b/src/sunstone/public/app/tabs/templates-tab/dialogs/clone.js
@@ -19,17 +19,17 @@ define(function(require) {
DEPENDENCIES
*/
- var BaseDialog = require('utils/dialogs/dialog');
- var TemplateHTML = require('hbs!./clone/html');
- var Sunstone = require('sunstone');
- var Notifier = require('utils/notifier');
- var OpenNebulaTemplate = require('opennebula/template');
+ var BaseDialog = require("utils/dialogs/dialog");
+ var TemplateHTML = require("hbs!./clone/html");
+ var Sunstone = require("sunstone");
+ var Notifier = require("utils/notifier");
+ var OpenNebulaTemplate = require("opennebula/template");
/*
CONSTANTS
*/
- var DIALOG_ID = require('./clone/dialogId');
+ var DIALOG_ID = require("./clone/dialogId");
/*
CONSTRUCTOR
@@ -57,7 +57,7 @@ define(function(require) {
function _html() {
return TemplateHTML({
- 'dialogId': this.dialogId
+ "dialogId": this.dialogId
});
}
@@ -70,15 +70,15 @@ define(function(require) {
function _setup(context) {
var that = this;
- $('#' + DIALOG_ID + 'Form', context).submit(function(e) {
+ $("#" + DIALOG_ID + "Form", context).submit(function(e) {
e.preventDefault();
return false;
});
- $('#' + DIALOG_ID + 'Form', context).on("click", "button.custom_submit", function() {
- if(!$('#' + DIALOG_ID + 'Form', context)[0].checkValidity()){
+ $("#" + DIALOG_ID + "Form", context).on("click", "button.custom_submit", function() {
+ if(!$("#" + DIALOG_ID + "Form", context)[0].checkValidity()){
if ($(this).val() == that.resource+".clone_recursive"){
- $('#' + DIALOG_ID + 'Form button[type="submit"]', context).click();
+ $("#" + DIALOG_ID + "Form button[type=\"submit\"]", context).click();
return true;
} else {
return true;
@@ -86,7 +86,7 @@ define(function(require) {
}
var extra_info;
- var name = $('#' + DIALOG_ID + 'Form input[name="name"]').val();
+ var name = $("#" + DIALOG_ID + "Form input[name=\"name\"]").val();
var sel_elems = Sunstone.getDataTable(that.tabId).elements();
if (sel_elems.length > 1) {
@@ -98,13 +98,14 @@ define(function(require) {
}
} else {
extra_info = name;
- Sunstone.runAction($(this).val(), sel_elems[0], extra_info)
+ Sunstone.runAction($(this).val(), sel_elems[0], extra_info);
}
Sunstone.getDialog(DIALOG_ID).hide();
Sunstone.getDialog(DIALOG_ID).reset();
setTimeout(function() {
Sunstone.runAction(that.resource+'.refresh');
+ Sunstone.runAction(that.resource+".refresh");
}, 1500);
return false;
@@ -120,13 +121,13 @@ define(function(require) {
//show different text depending on how many elements are selected
if (sel_elems.length > 1) {
- $('.clone_one', context).hide();
- $('.clone_several', context).show();
- $('input[name="name"]',context).val('Copy of ');
+ $(".clone_one", context).hide();
+ $(".clone_several", context).show();
+ $("input[name=\"name\"]",context).val("Copy of ");
} else {
- $('.clone_one', context).show();
- $('.clone_several', context).hide();
- $('input[name="name"]', context).val('Copy of ' + sel_elems[0].name);
+ $(".clone_one", context).show();
+ $(".clone_several", context).hide();
+ $("input[name=\"name\"]", context).val("Copy of " + sel_elems[0].name);
};
$("input[name='name']", context).focus();
diff --git a/src/sunstone/public/app/tabs/templates-tab/form-panels/create-common.js b/src/sunstone/public/app/tabs/templates-tab/form-panels/create-common.js
index 5692c9d182..65fb3b8d31 100644
--- a/src/sunstone/public/app/tabs/templates-tab/form-panels/create-common.js
+++ b/src/sunstone/public/app/tabs/templates-tab/form-panels/create-common.js
@@ -18,41 +18,41 @@ define(function(require) {
/*
DEPENDENCIES
*/
- var Notifier = require('utils/notifier');
- var BaseFormPanel = require('utils/form-panels/form-panel');
- var Sunstone = require('sunstone');
- var Locale = require('utils/locale');
- var Tips = require('utils/tips');
- var TemplateUtils = require('utils/template-utils');
- var WizardFields = require('utils/wizard-fields');
+ var Notifier = require("utils/notifier");
+ var BaseFormPanel = require("utils/form-panels/form-panel");
+ var Sunstone = require("sunstone");
+ var Locale = require("utils/locale");
+ var Tips = require("utils/tips");
+ var TemplateUtils = require("utils/template-utils");
+ var WizardFields = require("utils/wizard-fields");
/*
TEMPLATES
*/
- 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
*/
var WIZARD_TABS = [
- require('./create/wizard-tabs/general'),
- require('./create/wizard-tabs/storage'),
- require('./create/wizard-tabs/network'),
- require('./create/wizard-tabs/os'),
- require('./create/wizard-tabs/io'),
- require('./create/wizard-tabs/actions'),
- require('./create/wizard-tabs/context'),
- require('./create/wizard-tabs/scheduling'),
- require('./create/wizard-tabs/hybrid'),
- require('./create/wizard-tabs/vmgroup'),
- require('./create/wizard-tabs/other')
- ]
+ require("./create/wizard-tabs/general"),
+ require("./create/wizard-tabs/storage"),
+ require("./create/wizard-tabs/network"),
+ require("./create/wizard-tabs/os"),
+ require("./create/wizard-tabs/io"),
+ require("./create/wizard-tabs/actions"),
+ require("./create/wizard-tabs/context"),
+ require("./create/wizard-tabs/scheduling"),
+ require("./create/wizard-tabs/hybrid"),
+ require("./create/wizard-tabs/vmgroup"),
+ require("./create/wizard-tabs/other")
+ ];
- var TEMPLATES_TAB_ID = require('tabs/templates-tab/tabId');
- var VROUTER_TEMPLATES_TAB_ID = require('tabs/vrouter-templates-tab/tabId');
+ var TEMPLATES_TAB_ID = require("tabs/templates-tab/tabId");
+ var VROUTER_TEMPLATES_TAB_ID = require("tabs/vrouter-templates-tab/tabId");
/*
CONSTRUCTOR
@@ -71,15 +71,15 @@ define(function(require) {
}
this.actions = {
- 'create': {
- 'title': create_title,
- 'buttonText': Locale.tr("Create"),
- 'resetButton': true
+ "create": {
+ "title": create_title,
+ "buttonText": Locale.tr("Create"),
+ "resetButton": true
},
- 'update': {
- 'title': update_title,
- 'buttonText': Locale.tr("Update"),
- 'resetButton': false
+ "update": {
+ "title": update_title,
+ "buttonText": Locale.tr("Update"),
+ "resetButton": false
}
};
@@ -103,7 +103,7 @@ define(function(require) {
} catch (err) {
console.log(err);
}
- })
+ });
BaseFormPanel.call(this);
}
@@ -129,8 +129,8 @@ define(function(require) {
function _htmlWizard() {
return TemplateWizardHTML({
- 'formPanelId': this.formPanelId,
- 'wizardTabs': this.wizardTabs
+ "formPanelId": this.formPanelId,
+ "wizardTabs": this.wizardTabs
});
}
@@ -140,26 +140,26 @@ define(function(require) {
function _setup(context) {
$.each(this.wizardTabs, function(index, wizardTab) {
- wizardTab.setup($('#' + wizardTab.wizardTabId, context));
+ wizardTab.setup($("#" + wizardTab.wizardTabId, context));
});
- Foundation.reflow(context, 'tabs');
- Foundation.reflow(context, 'tooltip');
+ Foundation.reflow(context, "tabs");
+ Foundation.reflow(context, "tooltip");
}
function _onShow(context) {
var that = this;
- $('a[href="#'+ that.wizardTabs[0].wizardTabId +'"]', context).trigger("click");
+ $("a[href=\"#"+ that.wizardTabs[0].wizardTabId +"\"]", context).trigger("click");
$.each(that.wizardTabs, function(index, wizardTab) {
- wizardTab.onShow($('#' + wizardTab.wizardTabId, context), that);
+ wizardTab.onShow($("#" + wizardTab.wizardTabId, context), that);
});
}
function _retrieve(context) {
- var templateJSON = {}
+ var templateJSON = {};
$.each(this.wizardTabs, function(index, wizardTab) {
- $.extend(true, templateJSON, wizardTab.retrieve($('#' + wizardTab.wizardTabId, context)));
+ $.extend(true, templateJSON, wizardTab.retrieve($("#" + wizardTab.wizardTabId, context)));
var a = templateJSON;
});
@@ -168,8 +168,8 @@ define(function(require) {
// part of an array, and it is filled in different tabs, the $.extend deep
// merge can't work. We define an auxiliary attribute for it.
- if (templateJSON['PUBLIC_CLOUD'] == undefined) {
- templateJSON['PUBLIC_CLOUD'] = [];
+ if (templateJSON["PUBLIC_CLOUD"] == undefined) {
+ templateJSON["PUBLIC_CLOUD"] = [];
}
// PCI with TYPE=NIC is not defined in the 'other' tab. Because it is
@@ -187,11 +187,11 @@ define(function(require) {
}
if (templateJSON["NIC_PCI"] != undefined) {
- if (templateJSON['PCI'] == undefined) {
- templateJSON['PCI'] = [];
+ if (templateJSON["PCI"] == undefined) {
+ templateJSON["PCI"] = [];
}
- templateJSON['PCI'] = templateJSON['PCI'].concat(templateJSON["NIC_PCI"]);
+ templateJSON["PCI"] = templateJSON["PCI"].concat(templateJSON["NIC_PCI"]);
delete templateJSON["NIC_PCI"];
}
@@ -203,7 +203,7 @@ define(function(require) {
var templateJSON = this.retrieve(context);
if (this.action == "create") {
- Sunstone.runAction(this.resource+".create", {'vmtemplate': templateJSON});
+ Sunstone.runAction(this.resource+".create", {"vmtemplate": templateJSON});
return false;
} else if (this.action == "update") {
Sunstone.runAction(this.resource+".update", this.resourceId, TemplateUtils.templateToString(templateJSON));
@@ -212,7 +212,7 @@ define(function(require) {
}
function _submitAdvanced(context) {
- var templateStr = $('textarea#template', context).val();
+ var templateStr = $("textarea#template", context).val();
if (this.action == "create") {
Sunstone.runAction(this.resource+".create", {"vmtemplate": {"template_raw": templateStr}});
@@ -237,10 +237,10 @@ define(function(require) {
WizardFields.fillInput($("#NAME", context), element.NAME);
// Populates the Avanced mode Tab
- $('#template', context).val(TemplateUtils.templateToString(templateJSON));
+ $("#template", context).val(TemplateUtils.templateToString(templateJSON));
$.each(this.wizardTabs, function(index, wizardTab) {
- wizardTab.fill($('#' + wizardTab.wizardTabId, context), templateJSON);
+ wizardTab.fill($("#" + wizardTab.wizardTabId, context), templateJSON);
});
// After all tabs have been filled, perform a notify
@@ -265,7 +265,7 @@ define(function(require) {
$.each(that.wizardTabs, function(index, wizardTab) {
if (wizardTab.notify != undefined){
- wizardTab.notify($('#' + wizardTab.wizardTabId, context), templateJSON);
+ wizardTab.notify($("#" + wizardTab.wizardTabId, context), templateJSON);
}
});
diff --git a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/actions.js b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/actions.js
index 3ba22fa860..4ccf024e0a 100644
--- a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/actions.js
+++ b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/actions.js
@@ -19,29 +19,29 @@ define(function(require) {
DEPENDENCIES
*/
- var Config = require('sunstone-config');
- var ScheduleActions = require('utils/schedule_action');
- var Locale = require('utils/locale');
- var Tips = require('utils/tips');
- var WizardFields = require('utils/wizard-fields');
- var UniqueId = require('utils/unique-id');
- var Humanize = require('utils/humanize');
- var TemplateUtils = require('utils/template-utils');
- var Actions = require('utils/actions');
+ var Config = require("sunstone-config");
+ var ScheduleActions = require("utils/schedule_action");
+ var Locale = require("utils/locale");
+ var Tips = require("utils/tips");
+ var WizardFields = require("utils/wizard-fields");
+ var UniqueId = require("utils/unique-id");
+ var Humanize = require("utils/humanize");
+ var TemplateUtils = require("utils/template-utils");
+ var Actions = require("utils/actions");
- var TemplateHTML = require('hbs!./actions/html');
+ var TemplateHTML = require("hbs!./actions/html");
/*
CONSTANTS
*/
- var WIZARD_TAB_ID = require('./actions/wizardTabId');
+ var WIZARD_TAB_ID = require("./actions/wizardTabId");
/*
CONSTRUCTOR
*/
function WizardTab(opts) {
- if (!Config.isTemplateCreationTabEnabled(opts.tabId, 'actions')) {
+ if (!Config.isTemplateCreationTabEnabled(opts.tabId, "actions")) {
throw "Wizard Tab not enabled";
}
@@ -61,7 +61,7 @@ define(function(require) {
function _html() {
return TemplateHTML({
- 'table_sched_actions': ScheduleActions.htmlTable("temp")
+ "table_sched_actions": ScheduleActions.htmlTable("temp")
});
}
@@ -72,16 +72,17 @@ define(function(require) {
var that = this;
var actions = ["terminate", "terminate-hard", "hold", "release", "stop", "suspend", "resume", "reboot", "reboot-hard", "poweroff", "poweroff-hard", "undeploy", "undeploy-hard", "snapshot-create"];
- context.off('click', '#add_scheduling_temp_action');
- context.on('click', '#add_scheduling_temp_action', function() {
+ context.off("click", "#add_scheduling_temp_action");
+ context.on("click", "#add_scheduling_temp_action", function() {
$("#add_scheduling_temp_action", context).attr("disabled", "disabled");
ScheduleActions.htmlNewAction(actions, context, "temp");
- ScheduleActions.setup(context)
+ ScheduleActions.setup(context);
return false;
});
context.off("click", "#add_temp_action_json");
context.on("click" , "#add_temp_action_json", function(){
+ $(".wickedpicker").hide();
var sched_action = ScheduleActions.retrieveNewAction(context);
if (sched_action != false) {
$("#sched_temp_actions_body").append(ScheduleActions.fromJSONtoActionsTable(sched_action));
@@ -91,20 +92,20 @@ define(function(require) {
context.off("click", ".remove_action_x");
context.on("click", ".remove_action_x", function () {
- $(this).parents('tr').remove();
+ $(this).parents("tr").remove();
});
}
function _retrieve(context) {
var templateJSON = {};
- templateJSON['SCHED_ACTION'] = ScheduleActions.retrieve(context);
+ templateJSON["SCHED_ACTION"] = ScheduleActions.retrieve(context);
return templateJSON;
}
function _fill(context, templateJSON) {
var actions = ScheduleActions.fromJSONtoActionsTable(templateJSON.SCHED_ACTION);
$("#sched_temp_actions_body").append(actions);
- delete templateJSON['SCHED_ACTION'];
+ delete templateJSON["SCHED_ACTION"];
}
});
diff --git a/src/sunstone/public/app/tabs/users-tab/panels/groups.js b/src/sunstone/public/app/tabs/users-tab/panels/groups.js
index 4625c44285..6c42b4fb8e 100644
--- a/src/sunstone/public/app/tabs/users-tab/panels/groups.js
+++ b/src/sunstone/public/app/tabs/users-tab/panels/groups.js
@@ -19,23 +19,23 @@ define(function(require) {
DEPENDENCIES
*/
- var Locale = require('utils/locale');
- var GroupsTable = require('tabs/groups-tab/datatable');
- var TemplateChgrpTr = require('hbs!./info/chgrp-tr');
- var ResourceSelect = require('utils/resource-select');
- var Sunstone = require('sunstone');
+ var Locale = require("utils/locale");
+ var GroupsTable = require("tabs/groups-tab/datatable");
+ var TemplateChgrpTr = require("hbs!./info/chgrp-tr");
+ var ResourceSelect = require("utils/resource-select");
+ var Sunstone = require("sunstone");
/*
TEMPLATES
*/
- var TemplateHTML = require('hbs!./groups/html');
+ var TemplateHTML = require("hbs!./groups/html");
/*
CONSTANTS
*/
- var PANEL_ID = require('./groups/panelId');
+ var PANEL_ID = require("./groups/panelId");
var GROUPS_TABLE_ID = PANEL_ID + "GroupsTable";
var RESOURCE = "User";
var XML_ROOT = "USER";
@@ -65,7 +65,7 @@ define(function(require) {
function _html() {
var groups;
- var groupTrHTML = TemplateChgrpTr({'element': this.element});
+ var groupTrHTML = TemplateChgrpTr({"element": this.element});
if (this.element.GROUPS !== undefined && this.element.GROUPS.ID !== undefined) {
if ($.isArray(this.element.GROUPS.ID)) {
groups = this.element.GROUPS.ID;
@@ -82,21 +82,21 @@ define(function(require) {
selectOptions: {
read_only: true,
fixed_ids: this.groups
- }
+ }
};
this.groupsTable = new GroupsTable(GROUPS_TABLE_ID, opts);
- this.groupsTableEdit = new GroupsTable('user_groups_edit', {
+ this.groupsTableEdit = new GroupsTable("user_groups_edit", {
info: false,
select: true,
selectOptions: {
- 'multiple_choice': true
+ "multiple_choice": true
}
});
return TemplateHTML({
- 'groupsTableHTML': this.groupsTable.dataTableHTML,
- 'groupsTableEditHTML': this.groupsTableEdit.dataTableHTML,
- 'element': this.element
+ "groupsTableHTML": this.groupsTable.dataTableHTML,
+ "groupsTableEditHTML": this.groupsTableEdit.dataTableHTML,
+ "element": this.element
});
}
@@ -113,8 +113,8 @@ define(function(require) {
context.off("click", "#update_group");
context.on("click", "#update_group", function() {
ResourceSelect.insert({
- context: $('#choose_primary_grp', context),
- resourceName: 'Group',
+ context: $("#choose_primary_grp", context),
+ resourceName: "Group",
callback : function(response){
$("#choose_primary_grp").html(response[0].outerHTML);
$(".resource_list_select option[elem_id=" + that.element.GID + "]").prop("selected", true);
@@ -132,7 +132,7 @@ define(function(require) {
$("#submit-group").hide();
});
- $('#Form_change_second_grp').submit(function() {
+ $("#Form_change_second_grp").submit(function() {
var selectPrimaryGrp = $("#choose_primary_grp .resource_list_select").val();
var selectedGroupsList = that.groupsTableEdit.retrieveResourceTableSelect();
@@ -142,13 +142,13 @@ define(function(require) {
$.each(selectedGroupsList, function(index, groupId) {
if ($.inArray(groupId, that.groups) === -1) {
- Sunstone.runAction('User.addgroup', [that.element.ID], groupId);
+ Sunstone.runAction("User.addgroup", [that.element.ID], groupId);
}
});
$.each(that.groups, function(index, groupId) {
if ($.inArray(groupId, selectedGroupsList) === -1) {
- Sunstone.runAction('User.delgroup', [that.element.ID], groupId);
+ Sunstone.runAction("User.delgroup", [that.element.ID], groupId);
}
});
@@ -156,6 +156,7 @@ define(function(require) {
$(".show_labels").show();
setTimeout(function() {
Sunstone.runAction('User.refresh');
+ Sunstone.runAction("User.refresh");
}, 1500);
return false;
diff --git a/src/sunstone/public/app/utils/dialogs/clusters.js b/src/sunstone/public/app/utils/dialogs/clusters.js
index afbf5e7e37..02a9169b0b 100644
--- a/src/sunstone/public/app/utils/dialogs/clusters.js
+++ b/src/sunstone/public/app/utils/dialogs/clusters.js
@@ -19,25 +19,25 @@ define(function(require) {
DEPENDENCIES
*/
- var BaseDialog = require('utils/dialogs/dialog');
- var ClustersTable = require('tabs/clusters-tab/datatable');
- var Sunstone = require('sunstone');
+ var BaseDialog = require("utils/dialogs/dialog");
+ var ClustersTable = require("tabs/clusters-tab/datatable");
+ var Sunstone = require("sunstone");
var TemplateUtils = require("utils/template-utils");
/*
TEMPLATES
*/
- var TemplateHTML = require('hbs!./clusters/html');
+ var TemplateHTML = require("hbs!./clusters/html");
/*
CONSTANTS
*/
- var DIALOG_ID = require('./clusters/dialogId');
- var DATASTORES_TAB_ID = require('tabs/datastores-tab/tabId');
- var VNETS_TAB_ID = require('tabs/vnets-tab/tabId');
- var VNTEMPLATE_TAB_ID = require('tabs/vnets-templates-tab/tabId');
+ var DIALOG_ID = require("./clusters/dialogId");
+ var DATASTORES_TAB_ID = require("tabs/datastores-tab/tabId");
+ var VNETS_TAB_ID = require("tabs/vnets-tab/tabId");
+ var VNTEMPLATE_TAB_ID = require("tabs/vnets-templates-tab/tabId");
/*
CONSTRUCTOR
@@ -64,15 +64,15 @@ define(function(require) {
*/
function _html() {
- this.clustersTable = new ClustersTable('clusters-'+this.dialogId, {
+ this.clustersTable = new ClustersTable("clusters-"+this.dialogId, {
info: false,
select: true,
- selectOptions: {'multiple_choice': true}
+ selectOptions: {"multiple_choice": true}
});
return TemplateHTML({
- 'dialogId': this.dialogId,
- 'clustersTableHTML': this.clustersTable.dataTableHTML
+ "dialogId": this.dialogId,
+ "clustersTableHTML": this.clustersTable.dataTableHTML
});
}
@@ -80,7 +80,7 @@ define(function(require) {
var that = this;
that.clustersTable.initialize();
- $('#' + DIALOG_ID + 'Form', dialog).submit(function() {
+ $("#" + DIALOG_ID + "Form", dialog).submit(function() {
var selectedClustersList = that.clustersTable.retrieveResourceTableSelect();
if ( that.only_update_template != undefined && that.only_update_template != true) {
@@ -88,9 +88,9 @@ define(function(require) {
$.each(selectedClustersList, function(index, clusterId) {
if ($.inArray(clusterId, that.originalClusterIds) === -1) {
if(that.resource == "datastore"){
- Sunstone.runAction('Cluster.adddatastore', clusterId, that.element.ID);
+ Sunstone.runAction("Cluster.adddatastore", clusterId, that.element.ID);
} else {
- Sunstone.runAction('Cluster.addvnet', clusterId, that.element.ID);
+ Sunstone.runAction("Cluster.addvnet", clusterId, that.element.ID);
}
}
});
@@ -98,21 +98,22 @@ define(function(require) {
$.each(that.originalClusterIds, function(index, clusterId) {
if ($.inArray(clusterId, selectedClustersList) === -1) {
if(that.resource == "datastore"){
- Sunstone.runAction('Cluster.deldatastore', clusterId, that.element.ID);
+ Sunstone.runAction("Cluster.deldatastore", clusterId, that.element.ID);
} else {
- Sunstone.runAction('Cluster.delvnet', clusterId, that.element.ID);
+ Sunstone.runAction("Cluster.delvnet", clusterId, that.element.ID);
}
}
});
} else {
that.element.TEMPLATE.CLUSTER = selectedClustersList.join(",");
- Sunstone.runAction(that.resource_name+".update", that.element.ID, TemplateUtils.templateToString(that.element.TEMPLATE))
+ Sunstone.runAction(that.resource_name+".update", that.element.ID, TemplateUtils.templateToString(that.element.TEMPLATE));
}
Sunstone.getDialog(DIALOG_ID).hide();
Sunstone.getDialog(DIALOG_ID).reset();
setTimeout(function() {
+ console.log("n");
Sunstone.runAction(that.resource_name+".refresh");
}, 1500);
diff --git a/src/sunstone/public/app/utils/schedule_action.js b/src/sunstone/public/app/utils/schedule_action.js
index cf0db9461b..67c27c39d0 100644
--- a/src/sunstone/public/app/utils/schedule_action.js
+++ b/src/sunstone/public/app/utils/schedule_action.js
@@ -34,6 +34,17 @@ define(function (require) {
function _htmlNewAction(actions, context, res) {
var options = "";
+ var clearEmpySpaces = function(e){
+ var value = e.val().replace(/\s/g, "");
+ e.val(value);
+ };
+ var options_date_picker = {
+ title: Locale.tr("Hour"),
+ twentyFour: "true",
+ timeSeparator: ":",
+ beforeShow: clearEmpySpaces,
+ now: "12:30"
+ };
var that = this;
$.each(actions, function (key, action) {
var actionAux = action.replace("-", "_");
@@ -41,10 +52,12 @@ define(function (require) {
options += "
" + Locale.tr(action) + " ";
}
});
- $("#scheduling_" + res + "_actions_table tbody", context).append(TemplateHTML({
+ var schedule = $("#scheduling_" + res + "_actions_table tbody", context).append(TemplateHTML({
"actions": options,
"res": that.res
- })).find("#relative_time", context).on("click", function (e) {
+ }));
+ schedule.find("#time_input",context).on("click",function(e){e.stopPropagation();}).wickedpicker(options_date_picker);
+ schedule.find("#relative_time", context).on("click", function (e) {
$("#schedule_type", context).prop("checked", false);
if ($(this).is(":checked")) {
$("#no_relative_time_form, .periodic", context).addClass("hide");
diff --git a/src/sunstone/public/app/utils/schedule_action/html.hbs b/src/sunstone/public/app/utils/schedule_action/html.hbs
index ced1ff6d0e..468983de01 100644
--- a/src/sunstone/public/app/utils/schedule_action/html.hbs
+++ b/src/sunstone/public/app/utils/schedule_action/html.hbs
@@ -44,7 +44,7 @@ the License for the specific language governing permissions and }} {{! limitatio
-
+
diff --git a/src/sunstone/public/bower.json b/src/sunstone/public/bower.json
index 3e1465fb94..5077753f9b 100644
--- a/src/sunstone/public/bower.json
+++ b/src/sunstone/public/bower.json
@@ -17,7 +17,8 @@
"datatables": "1.10.12",
"navigo": "2.1.1",
"sprintf": "1.0.3",
- "jquery-ui": "^1.12.1"
+ "jquery-ui": "^1.12.1",
+ "wickedpicker": "git://github.com/ericjgagnon/wickedpicker#dd2cce3"
},
"authors": [
"Daniel Molina ",
@@ -35,5 +36,6 @@
"bower_components",
"test",
"tests"
- ]
+ ],
+ "main": ""
}
diff --git a/src/sunstone/views/index.erb b/src/sunstone/views/index.erb
index 31e59db25c..f02bae908c 100644
--- a/src/sunstone/views/index.erb
+++ b/src/sunstone/views/index.erb
@@ -67,9 +67,11 @@
<% if $conf[:env] == 'dev' %>
+
<% else %>
+
<% end %>