").appendTo($("#"+tableID+"_ul"));
- $(".provision-pricing-table", li).data("opennebula", aData);
- }
- function initializeTemplateCards(context, tableID) {
- // create a thumbs container if it doesn't exist. put it in the dataTables_scrollbody div
- if (context.$("tr", {"filter": "applied"} ).length == 0) {
- context.html("
").appendTo($("#provision_customize_flow_template"));
-
- context.data("opennebula", role);
-
- var template_id = role.vm_template;
- var role_html_id = "#provision_create_flow_role_"+index;
-
- OpenNebula.Template.show({
- data : {
- id: template_id,
- extended: true
- },
- success: function(request,template_json){
- var role_context = $(role_html_id);
-
- generate_cardinality_selector(
- $(".provision_cardinality_selector", context),
- role,
- template_json);
-
- if (template_json.VMTEMPLATE.TEMPLATE.USER_INPUTS) {
- UserInputs.vmTemplateInsert(
- $(".provision_custom_attributes_selector", role_context),
- template_json,
- {text_header: " "+Locale.tr("Custom Attributes")});
-
- } else {
- $(".provision_custom_attributes_selector", role_context).html("");
- }
- }
- });
-
-
- });
-
- return false;
- }
- });
-
- tab.on("click", "#provision_create_flow .provision-pricing-table.only-one" , function(){
- if ($(this).hasClass("selected")){
- //$(this).removeClass("selected");
- } else {
- $(".provision-pricing-table", $(this).parents(".dataTable")).removeClass("selected");
- $(this).addClass("selected");
- }
-
- return false;
- });
-
- $("#provision_create_flow").submit(function(){
- var context = $(this);
- var flow_name = $("#flow_name", context).val();
- var template_id = $(".provision_select_flow_template .selected", context).attr("opennebula_id");
-
- if (!template_id) {
- $(".alert-box-error", context).fadeIn().html(Locale.tr("You must select at least a template configuration"));
- return false;
- }
-
- var extra_info = ServiceUtils.getExtraInfo(context, Config.isFeatureEnabled("show_vnet_instantiate_flow"));
-
- $(".provision_create_flow_role", context).each(function(){
- var role_template = $(this).data("opennebula");
- var cardinality = WizardFields.retrieve( $(".provision_cardinality_selector", $(this)) )["cardinality"];
- var temp_inputs = WizardFields.retrieve($(".provision_custom_attributes_selector", $(this)));
- var vm_template_contents = TemplateUtils.stringToTemplate(role_template.vm_template_contents);
-
- $.each(temp_inputs, function(inputName, inputValue) {
- if (Array.isArray(inputValue)) {
- delete temp_inputs[inputName];
- temp_inputs[inputName] = inputValue.join(",");
- }
-
- // removes duplicated inputs in context
- delete vm_template_contents[inputName];
- });
-
- extra_info.merge_template.roles.push($.extend(role_template, {
- cardinality: cardinality,
- user_inputs_values: temp_inputs,
- vm_template_contents: TemplateUtils.templateToString(vm_template_contents),
- }));
- });
-
- if (flow_name) {
- extra_info.merge_template.name = flow_name;
- }
-
- Sunstone.runAction("Provision.Flow.instantiate", template_id, extra_info);
- return false;
- });
-
- $(".provision_create_flow_button").on("click", function(){
- show_provision_create_flow();
- });
-
- Foundation.reflow($("#provision_create_flow"));
+ ProvisionFlows.setup();
}
});
}
diff --git a/src/sunstone/public/app/tabs/provision-tab/content.hbs b/src/sunstone/public/app/tabs/provision-tab/content.hbs
index 302d0c6036..7ff7fdc13f 100644
--- a/src/sunstone/public/app/tabs/provision-tab/content.hbs
+++ b/src/sunstone/public/app/tabs/provision-tab/content.hbs
@@ -17,7 +17,7 @@
{{!provision_user_info}}
-{{> tabs/provision-tab/vms/create}}
+{{> tabs/provision-tab/vms/html/create}}
{{#isProvisionTabEnabled "provision-tab" "templates"}}
@@ -25,6 +25,6 @@
{{/isProvisionTabEnabled}}
{{#isProvisionTabEnabled "provision-tab" "flows"}}
-{{> tabs/provision-tab/flows/create}}
+{{> tabs/provision-tab/flows/html/create}}
{{/isProvisionTabEnabled}}
diff --git a/src/sunstone/public/app/tabs/provision-tab/dashboard/dashboard.js b/src/sunstone/public/app/tabs/provision-tab/dashboard/dashboard.js
new file mode 100644
index 0000000000..54dd9103c2
--- /dev/null
+++ b/src/sunstone/public/app/tabs/provision-tab/dashboard/dashboard.js
@@ -0,0 +1,381 @@
+/* -------------------------------------------------------------------------- */
+/* Copyright 2002-2021, OpenNebula Project, OpenNebula Systems */
+/* */
+/* Licensed under the Apache License, Version 2.0 (the "License"); you may */
+/* not use this file except in compliance with the License. You may obtain */
+/* a copy of the License at */
+/* */
+/* http://www.apache.org/licenses/LICENSE-2.0 */
+/* */
+/* Unless required by applicable law or agreed to in writing, software */
+/* distributed under the License is distributed on an "AS IS" BASIS, */
+/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
+/* See the License for the specific language governing permissions and */
+/* limitations under the License. */
+/* -------------------------------------------------------------------------- */
+
+define(function(require) {
+ var Accounting = require("utils/accounting");
+ var Config = require("sunstone-config");
+ var Notifier = require("utils/notifier");
+ var OpenNebula = require("opennebula");
+ var ProvisionFlowsList = require("../flows/list");
+ var ProvisionTemplatesList = require("../templates/list");
+ var ProvisionVmsList = require("../vms/list");
+ var QuotaDefaults = require("utils/quotas/quota-defaults");
+ var QuotaWidgets = require("utils/quotas/quota-widgets");
+ var Sunstone = require("sunstone");
+
+ // Templates
+ var TemplateDashboardGroupQuotas = require("hbs!./html/group-quotas");
+ var TemplateDashboardGroupVms = require("hbs!./html/group-vms");
+ var TemplateDashboardQuotas = require("hbs!./html/quotas");
+ var TemplateDashboardVms = require("hbs!./html/vms");
+
+ // Constants
+ var TAB_ID = require("../tabId");
+
+ var _actions = {
+ "setup": _setup
+ }
+
+ /**************************************************************************/
+ // Functions
+ /**************************************************************************/
+
+ function get_dashboard_count(item_list, all=true){
+ var total = 0;
+ var running = 0;
+ var off = 0;
+ var error = 0;
+ var deploying = 0;
+ $.each(item_list, function(index, vm){
+ if (all || vm.VM.UID == config["user_id"]) {
+ var state = ProvisionVmsList.state(vm.VM);
+ total = total + 1;
+ switch (state.color) {
+ case "deploying":
+ deploying = deploying + 1;
+ break;
+ case "error":
+ error = error + 1;
+ break;
+ case "running":
+ running = running + 1;
+ break;
+ case "powering_off":
+ off = off + 1;
+ break;
+ case "off":
+ off = off + 1;
+ break;
+ default:
+ break;
+ }
+ }
+ });
+
+ return {
+ "total": total,
+ "running": running,
+ "off": off,
+ "error": error,
+ "deploying": deploying
+ }
+ }
+
+ function diferentsGroups(item_list = []){
+ var groups = [];
+ var rtn = groups.length;
+ if(Array.isArray(item_list)){
+ var finderElements = function (element){
+ if(element && element.VM && element.VM.GNAME && !groups.includes(element.VM.GNAME)){
+ groups.push(element.VM.GNAME);
+ }
+ }
+ item_list.map(finderElements);
+ rtn = groups.length;
+ }
+ return rtn;
+ };
+
+ function configure_dashboard_vms(){
+ if (Config.provision.dashboard.isEnabled("vms")) {
+ $("#provision_dashboard").append(TemplateDashboardVms());
+ if(!Config.isFeatureEnabled("cloud_vm_create")){
+ $(".provision_create_vm_button").hide();
+ }
+ OpenNebula.VM.list({
+ timeout: true,
+ success: function (request, item_list){
+ var total = 0;
+ var running = 0;
+ var off = 0;
+ var error = 0;
+ var deploying = 0;
+
+ var counts = get_dashboard_count(item_list, false);
+ var context = $("#provision_vms_dashboard");
+ $("#provision_dashboard_owner", context).html(counts.total);
+ $("#provision_dashboard_group", context).html(diferentsGroups(item_list));
+ $("#provision_dashboard_running", context).html(counts.running);
+ $("#provision_dashboard_off", context).html(counts.off);
+ $("#provision_dashboard_error", context).html(counts.error);
+ $("#provision_dashboard_deploying", context).html(counts.deploying);
+ },
+ error: Notifier.onError
+ });
+ }
+ }
+
+ function configure_dashboard_groupvms(){
+ if (Config.provision.dashboard.isEnabled("groupvms")) {
+ $("#provision_dashboard").append(TemplateDashboardGroupVms());
+ var start_time = Math.floor(new Date().getTime() / 1000);
+ var options = {
+ "start_time": start_time - 604800, // ms to s: 604800 = 7 days = 7*24*60*60
+ "end_time": -1 // Today
+ };
+
+ OpenNebula.VM.accounting({
+ success: function(req, response){
+ var context = $("#provision_group_vms_dashboard");
+ Accounting.fillAccounting(context, req, response, false);
+ },
+ error: Notifier.onError,
+ data: options
+ });
+
+ OpenNebula.VM.list({
+ timeout: true,
+ success: function (request, item_list){
+ var counts = get_dashboard_count(item_list);
+ var context = $("#provision_group_vms_dashboard");
+ $("#provision_dashboard_group_total", context).html(counts.total);
+ $("#provision_dashboard_group_running", context).html(counts.running);
+ $("#provision_dashboard_group_off", context).html(counts.off);
+ $("#provision_dashboard_group_error", context).html(counts.error);
+ $("#provision_dashboard_group_deploying", context).html(counts.deploying);
+ },
+ error: Notifier.onError
+ });
+ }
+ }
+
+ function dashboard_quotas_running_vms(default_user_quotas, user){
+ if(default_user_quotas.VM_QUOTA.VM.RUNNING_VMS){
+ var vms = QuotaWidgets.quotaInfo(
+ user.VM_QUOTA.VM.RUNNING_VMS_USED,
+ user.VM_QUOTA.VM.RUNNING_VMS,
+ default_user_quotas.VM_QUOTA.VM.RUNNING_VMS);
+ $("#provision_dashboard_rvms_percentage").html(vms["percentage"]);
+ $("#provision_dashboard_rvms_str").html(vms["str"]);
+ $("#provision_dashboard_rvms_meter").val(vms["percentage"]);
+ }
+ }
+
+ function dashboard_quotas_memory(default_user_quotas, user){
+ if(default_user_quotas.VM_QUOTA.VM.MEMORY){
+ var memory = QuotaWidgets.quotaMBInfo(
+ user.VM_QUOTA.VM.MEMORY_USED,
+ user.VM_QUOTA.VM.MEMORY,
+ default_user_quotas.VM_QUOTA.VM.MEMORY);
+ $("#provision_dashboard_memory_percentage").html(memory["percentage"]);
+ $("#provision_dashboard_memory_str").html(memory["str"]);
+ $("#provision_dashboard_memory_meter").val(memory["percentage"]);
+ }
+ }
+
+ function dashboard_quotas_cpu(default_user_quotas, user){
+ if(default_user_quotas.VM_QUOTA.VM.CPU){
+ var cpu = QuotaWidgets.quotaFloatInfo(
+ user.VM_QUOTA.VM.CPU_USED,
+ user.VM_QUOTA.VM.CPU,
+ default_user_quotas.VM_QUOTA.VM.CPU);
+ $("#provision_dashboard_cpu_percentage").html(cpu["percentage"]);
+ $("#provision_dashboard_cpu_str").html(cpu["str"]);
+ $("#provision_dashboard_cpu_meter").val(cpu["percentage"]);
+ }
+ }
+
+ function dashboard_quotas_system_disk(default_user_quotas, user){
+ if(default_user_quotas.VM_QUOTA.VM.SYSTEM_DISK_SIZE){
+ var systemDisk = QuotaWidgets.quotaInfo(
+ user.VM_QUOTA.VM.SYSTEM_DISK_SIZE_USED,
+ user.VM_QUOTA.VM.SYSTEM_DISK_SIZE,
+ default_user_quotas.VM_QUOTA.VM.SYSTEM_DISK_SIZE);
+ $("#provision_dashboard_system_disk_percentage").html(systemDisk["percentage"]);
+ $("#provision_dashboard_system_disk_str").html(systemDisk["str"]);
+ $("#provision_dashboard_system_disk_meter").val(systemDisk["percentage"]);
+ }
+ }
+
+ function dashboard_quotas_ip_leases(user){
+ if(
+ user &&
+ user.NETWORK_QUOTA &&
+ user.NETWORK_QUOTA.NETWORK
+ ){
+ var used = 0;
+ var size = 0;
+ var nets = user.NETWORK_QUOTA.NETWORK;
+ if(Array.isArray(nets)){
+ nets.map(function(network){
+ if(network.LEASES_USED){
+ used = used+parseInt(network.LEASES_USED,10);
+ }
+ if(network.LEASES){
+ size = size+parseInt(network.LEASES,10);
+ }
+ });
+ var ipLeases = QuotaWidgets.quotaInfo(used, size);
+ }else{
+ used = parseInt(nets.LEASES_USED,10);
+ size = parseInt(nets.LEASES,10);
+ }
+ var ipLeases = QuotaWidgets.quotaInfo(used, size);
+ $("#provision_dashboard_ips_percentage").html(ipLeases["percentage"]);
+ $("#provision_dashboard_ips_str").html(ipLeases["str"]);
+ $("#provision_dashboard_ips_meter").val(ipLeases["percentage"]);
+ }
+ }
+
+ function dashboard_quotas_datastores(user){
+ if(
+ user &&
+ user.DATASTORE_QUOTA &&
+ user.DATASTORE_QUOTA.DATASTORE &&
+ user.DATASTORE_QUOTA.DATASTORE.SIZE &&
+ user.DATASTORE_QUOTA.DATASTORE.SIZE_USED
+ ){
+ var datastore = QuotaWidgets.quotaInfo(
+ user.DATASTORE_QUOTA.DATASTORE.SIZE_USED,
+ user.DATASTORE_QUOTA.DATASTORE.SIZE);
+ $("#provision_dashboard_datastore_percentage").html(datastore["percentage"]);
+ $("#provision_dashboard_datastore_str").html(datastore["str"]);
+ $("#provision_dashboard_datastore_meter").val(datastore["percentage"]);
+ }
+ }
+
+ function configure_dashboard_quotas(){
+ if (Config.provision.dashboard.isEnabled("quotas")) {
+ $("#provision_dashboard").append(TemplateDashboardQuotas());
+ var that = this;
+ OpenNebula.User.show({
+ data : {
+ id: "-1"
+ },
+ success: function(request,user_json){
+ var user = user_json.USER;
+ that.user = user;
+ QuotaWidgets.initEmptyQuotas(user);
+ if (user && user.VM_QUOTA && !$.isEmptyObject(user.VM_QUOTA)){
+ $("#provision_quotas_dashboard").show();
+ var default_user_quotas = QuotaDefaults.default_quotas(user.DEFAULT_USER_QUOTAS);
+
+ if(
+ default_user_quotas &&
+ default_user_quotas.VM_QUOTA &&
+ default_user_quotas.VM_QUOTA.VM
+ ){
+ //running VMS
+ dashboard_quotas_running_vms(default_user_quotas, user);
+ //MEMORY
+ dashboard_quotas_memory(default_user_quotas, user);
+ //CPU
+ dashboard_quotas_cpu(default_user_quotas, user);
+ //SYSTEM DISK
+ dashboard_quotas_system_disk(default_user_quotas, user);
+ }
+
+ //IP LEASES
+ dashboard_quotas_ip_leases(user);
+ //DATASTORE
+ dashboard_quotas_datastores(user);
+ } else {
+ $("#provision_quotas_dashboard").hide();
+ }
+ }
+ });
+ }
+ }
+
+ function configure_dashboard_groupquotas(){
+ if (Config.provision.dashboard.isEnabled("groupquotas")) {
+ $("#provision_dashboard").append(TemplateDashboardGroupQuotas());
+ OpenNebula.Group.show({
+ data : {
+ id: "-1"
+ },
+ success: function(request,group_json){
+ var group = group_json.GROUP;
+ QuotaWidgets.initEmptyQuotas(group);
+ if (group && group.VM_QUOTA && !$.isEmptyObject(group.VM_QUOTA)){
+ var default_group_quotas = QuotaDefaults.default_quotas(group.DEFAULT_GROUP_QUOTAS);
+ var vms = QuotaWidgets.quotaInfo(
+ group.VM_QUOTA.VM.RUNNING_VMS_USED,
+ group.VM_QUOTA.VM.RUNNING_VMS,
+ default_group_quotas.VM_QUOTA.VM.VMS);
+ $("#provision_dashboard_group_rvms_percentage").html(vms["percentage"]);
+ $("#provision_dashboard_group_rvms_str").html(vms["str"]);
+ $("#provision_dashboard_group_rvms_meter").val(vms["percentage"]);
+ var memory = QuotaWidgets.quotaMBInfo(
+ group.VM_QUOTA.VM.MEMORY_USED,
+ group.VM_QUOTA.VM.MEMORY,
+ default_group_quotas.VM_QUOTA.VM.MEMORY);
+ $("#provision_dashboard_group_memory_percentage").html(memory["percentage"]);
+ $("#provision_dashboard_group_memory_str").html(memory["str"]);
+ $("#provision_dashboard_group_memory_meter").val(memory["percentage"]);
+ var cpu = QuotaWidgets.quotaFloatInfo(
+ group.VM_QUOTA.VM.CPU_USED,
+ group.VM_QUOTA.VM.CPU,
+ default_group_quotas.VM_QUOTA.VM.CPU);
+ $("#provision_dashboard_group_cpu_percentage").html(cpu["percentage"]);
+ $("#provision_dashboard_group_cpu_str").html(cpu["str"]);
+ $("#provision_dashboard_group_cpu_meter").val(cpu["percentage"]);
+ }
+ }
+ });
+ }
+ }
+
+ function show_provision_dashboard() {
+ $(".section_content").hide();
+ $("#provision_dashboard").fadeIn();
+ $("#provision_dashboard").html("");
+ configure_dashboard_vms();
+ configure_dashboard_groupvms();
+ configure_dashboard_quotas();
+ configure_dashboard_groupquotas();
+ }
+
+ function _setup(){
+ $(".configuration").on("click", function(){
+ $("li", ".provision-header").removeClass("active");
+ });
+ show_provision_dashboard();
+ $(".provision-header").on("click", "a", function(){
+ Sunstone.showTab(TAB_ID);
+ $("li", ".provision-header").removeClass("active");
+ $(this).closest("li").addClass("active");
+ });
+ $(document).on("click", ".provision_dashboard_button", function(){
+ OpenNebula.Action.clear_cache("VM");
+ show_provision_dashboard();
+ });
+ $(document).on("click", ".provision_vms_list_button", function(){
+ OpenNebula.Action.clear_cache("VM");
+ ProvisionVmsList.show(0);
+ });
+ $(document).on("click", ".provision_templates_list_button", function(){
+ OpenNebula.Action.clear_cache("VMTEMPLATE");
+ ProvisionTemplatesList.show(0);
+ });
+ $(document).on("click", ".provision_flows_list_button", function(){
+ OpenNebula.Action.clear_cache("SERVICE");
+ ProvisionFlowsList.show(0);
+ });
+ }
+
+ return _actions;
+})
\ No newline at end of file
diff --git a/src/sunstone/public/app/tabs/provision-tab/dashboard/empty-graphs.hbs b/src/sunstone/public/app/tabs/provision-tab/dashboard/html/empty-graphs.hbs
similarity index 100%
rename from src/sunstone/public/app/tabs/provision-tab/dashboard/empty-graphs.hbs
rename to src/sunstone/public/app/tabs/provision-tab/dashboard/html/empty-graphs.hbs
diff --git a/src/sunstone/public/app/tabs/provision-tab/dashboard/empty-quota.hbs b/src/sunstone/public/app/tabs/provision-tab/dashboard/html/empty-quota.hbs
similarity index 100%
rename from src/sunstone/public/app/tabs/provision-tab/dashboard/empty-quota.hbs
rename to src/sunstone/public/app/tabs/provision-tab/dashboard/html/empty-quota.hbs
diff --git a/src/sunstone/public/app/tabs/provision-tab/dashboard/group-quotas.hbs b/src/sunstone/public/app/tabs/provision-tab/dashboard/html/group-quotas.hbs
similarity index 100%
rename from src/sunstone/public/app/tabs/provision-tab/dashboard/group-quotas.hbs
rename to src/sunstone/public/app/tabs/provision-tab/dashboard/html/group-quotas.hbs
diff --git a/src/sunstone/public/app/tabs/provision-tab/dashboard/group-vms.hbs b/src/sunstone/public/app/tabs/provision-tab/dashboard/html/group-vms.hbs
similarity index 100%
rename from src/sunstone/public/app/tabs/provision-tab/dashboard/group-vms.hbs
rename to src/sunstone/public/app/tabs/provision-tab/dashboard/html/group-vms.hbs
diff --git a/src/sunstone/public/app/tabs/provision-tab/dashboard/quotas.hbs b/src/sunstone/public/app/tabs/provision-tab/dashboard/html/quotas.hbs
similarity index 100%
rename from src/sunstone/public/app/tabs/provision-tab/dashboard/quotas.hbs
rename to src/sunstone/public/app/tabs/provision-tab/dashboard/html/quotas.hbs
diff --git a/src/sunstone/public/app/tabs/provision-tab/dashboard/vms.hbs b/src/sunstone/public/app/tabs/provision-tab/dashboard/html/vms.hbs
similarity index 100%
rename from src/sunstone/public/app/tabs/provision-tab/dashboard/vms.hbs
rename to src/sunstone/public/app/tabs/provision-tab/dashboard/html/vms.hbs
diff --git a/src/sunstone/public/app/tabs/provision-tab/flows/flows.js b/src/sunstone/public/app/tabs/provision-tab/flows/flows.js
new file mode 100644
index 0000000000..fe25da32fc
--- /dev/null
+++ b/src/sunstone/public/app/tabs/provision-tab/flows/flows.js
@@ -0,0 +1,356 @@
+/* -------------------------------------------------------------------------- */
+/* Copyright 2002-2021, OpenNebula Project, OpenNebula Systems */
+/* */
+/* Licensed under the Apache License, Version 2.0 (the "License"); you may */
+/* not use this file except in compliance with the License. You may obtain */
+/* a copy of the License at */
+/* */
+/* http://www.apache.org/licenses/LICENSE-2.0 */
+/* */
+/* Unless required by applicable law or agreed to in writing, software */
+/* distributed under the License is distributed on an "AS IS" BASIS, */
+/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
+/* See the License for the specific language governing permissions and */
+/* limitations under the License. */
+/* -------------------------------------------------------------------------- */
+
+define(function(require) {
+ var Config = require("sunstone-config");
+ var LabelsUtils = require("utils/labels/utils");
+ var Locale = require("utils/locale");
+ var Notifier = require("utils/notifier");
+ var OpenNebula = require("opennebula");
+ var ProvisionFlowsList = require("./list");
+ var RangeSlider = require("utils/range-slider");
+ var ServiceUtils = require("utils/service-utils");
+ var Sunstone = require("sunstone");
+ var TemplateUtils = require("utils/template-utils");
+ var UserInputs = require("utils/user-inputs");
+ var WizardFields = require("utils/wizard-fields");
+
+ // Templates
+ var TemplateFlowCardinality = require("hbs!./html/cardinality");
+ var TemplateFlowDatatable = require("hbs!./html/templates_datatable");
+ var TemplateFlowRoleItem = require("hbs!./html/role_item");
+ var TemplateFlowPricingTable = require("hbs!./html/pricing_table");
+ var TemplateFlowCreateRole = require("hbs!./html/create_role");
+
+
+ // Constants
+ var TAB_ID = require("../tabId");
+ var FLOW_TEMPLATE_LABELS_COLUMN = 2;
+
+ var _actions = {
+ "setup": _setup
+ }
+
+ /**************************************************************************/
+ // Functions
+ /**************************************************************************/
+
+ function generate_cardinality_selector(context, role_template, template_json) {
+ context.off();
+ var min_vms = (role_template.min_vms||1);
+ var max_vms = (role_template.max_vms||20);
+ var cost = OpenNebula.Template.cost(template_json);
+ var has_cost = (cost != 0) && Config.isFeatureEnabled("showback");
+
+ context.html(TemplateFlowCardinality());
+
+ if (has_cost) {
+ $(".provision_create_service_cost_div", context).show();
+ $(".provision_create_service_cost_div", context).data("cost", cost);
+ var cost_value = cost*parseInt(role_template.cardinality);
+ $(".cost_value", context).html(cost_value.toFixed(2));
+ _calculateFlowCost();
+ } else {
+ $(".provision_create_service_cost_div", context).hide();
+ }
+
+ if (max_vms > min_vms) {
+ $( ".cardinality_slider_div", context).html(
+ RangeSlider.html({
+ min: min_vms,
+ max: max_vms,
+ max_value: max_vms,
+ initial: role_template.cardinality,
+ label: Locale.tr("Number of VMs for Role")+" "+role_template.name,
+ name: "cardinality"
+ })
+ );
+ $( ".cardinality_slider_div", context).show();
+ $( ".cardinality_no_slider_div", context).hide();
+ $( ".cardinality_slider_div", context).off("input");
+
+ if (has_cost) {
+ $( ".cardinality_slider_div", context).on("input", "input", function() {
+ var cost_value = $(".provision_create_service_cost_div", context).data("cost")*$(this).val();
+ $(".cost_value", context).html(cost_value.toFixed(2));
+ _calculateFlowCost();
+ });
+ }
+ } else {
+ $( ".cardinality_slider_div", context).hide();
+ $( ".cardinality_no_slider_div", context).show();
+ }
+ }
+
+ function _calculateFlowCost(){
+ var context = $("#provision_create_flow");
+ var total = 0;
+ $.each($(".provision_create_service_cost_div .cost_value", context), function(){
+ total += parseFloat($(this).text());
+ });
+ if (total != 0 && Config.isFeatureEnabled("showback")) {
+ $(".total_cost_div", context).show();
+ $(".total_cost_div .cost_value", context).text( (total).toFixed(2) );
+ }
+ }
+
+ function show_provision_create_flow(provision_flow_templates_datatable) {
+ update_provision_flow_templates_datatable(provision_flow_templates_datatable);
+ var context = $("#provision_create_flow");
+ $("#provision_customize_flow_template", context).hide();
+ $("#provision_customize_flow_template", context).html("");
+ $(".provision_network_selector", context).html("");
+ $(".provision_vmgroup_selector", context).html("");
+ $(".provision_add_vmgroup", context).show();
+ $(".provision_vmgroup", context).hide();
+ $(".provision_custom_attributes_selector", context).html("");
+ $(".provision_accordion_flow_template .selected_template", context).hide();
+ $(".provision_accordion_flow_template .select_template", context).show();
+ $("li:not(.is-active) a[href='#provision_dd_flow_template']", context).trigger("click");
+ $(".total_cost_div", context).hide();
+ $(".alert-box-error", context).hide();
+ $(".section_content").hide();
+ $("#provision_create_flow").fadeIn();
+ }
+
+ function update_provision_flow_templates_datatable(datatable, timeout) {
+ datatable.html(TemplateFlowDatatable({empty:false}));
+ setTimeout( function(){
+ OpenNebula.ServiceTemplate.list({
+ timeout: true,
+ success: function (request, item_list){
+ datatable.fnClearTable(true);
+ if (item_list.length == 0) {
+ datatable.html(TemplateFlowDatatable({empty:true}));
+ } else {
+ datatable.fnAddData(item_list);
+ }
+ LabelsUtils.clearLabelsFilter(datatable, FLOW_TEMPLATE_LABELS_COLUMN);
+ var context = $(".labels-dropdown", datatable.closest("#provisionFlowInstantiateTemplatesRow"));
+ context.html("");
+ LabelsUtils.insertLabelsMenu({
+ "context": context,
+ "dataTable": datatable,
+ "labelsColumn": FLOW_TEMPLATE_LABELS_COLUMN,
+ "labelsPath": "DOCUMENT.TEMPLATE.LABELS",
+ "placeholder": Locale.tr("No labels defined")
+ });
+ },
+ error: Notifier.onError
+ });
+ }, timeout);
+ }
+
+ function _setup(){
+ var provision_flow_templates_datatable = $("#provision_flow_templates_table").dataTable({
+ "iDisplayLength": 6,
+ "bAutoWidth": false,
+ "sDom" : "<\"H\">t<\"F\"lp>",
+ "aLengthMenu": Sunstone.getPaginate(),
+ "aaSorting" : [[1, "asc"]],
+ "aoColumnDefs": [
+ { "bVisible": false, "aTargets": ["all"]}
+ ],
+ "aoColumns": [
+ { "mDataProp": "DOCUMENT.ID" },
+ { "mDataProp": "DOCUMENT.NAME" },
+ { "mDataProp": "DOCUMENT.TEMPLATE.LABELS", "sDefaultContent" : "-" }
+ ],
+ "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(TemplateFlowDatatable({empty:true}));
+ } else {
+ $("#provision_flow_templates_table").html(
+ "");
+ }
+
+ return true;
+ },
+ "fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
+ var data = aData.DOCUMENT;
+ var body = data.TEMPLATE.BODY;
+ var roles_li = "";
+
+ if (body.roles) {
+ $.each(body.roles, function(index, role) {
+ roles_li += TemplateFlowRoleItem({
+ "name": role.name,
+ "cardinality": role.cardinality
+ });
+ });
+ }
+
+ var li = $(TemplateFlowPricingTable({
+ "id": data.ID,
+ "roles_list": roles_li,
+ "name": TemplateUtils.htmlEncode(data.NAME),
+ "description": TemplateUtils.htmlEncode(data.TEMPLATE.DESCRIPTION) || ""
+ })).appendTo($("#provision_flow_templates_ul"));
+
+ $(".provision-pricing-table", li).data("opennebula", aData);
+
+ return nRow;
+ }
+ });
+
+ var tab = $("#"+TAB_ID);
+ // TODO check if active
+ ProvisionFlowsList.generate($(".provision_flows_list_section"), {active: true});
+
+ $("#provision_create_flow_template_search").on("input",function(){
+ provision_flow_templates_datatable.fnFilter( $(this).val() );
+ });
+
+ $("#provision_create_flow_template_refresh_button").click(function(){
+ OpenNebula.Action.clear_cache("SERVICE_TEMPLATE");
+ update_provision_flow_templates_datatable(provision_flow_templates_datatable);
+ });
+
+ tab.off("click", ".provision_select_flow_template .provision-pricing-table.only-one")
+ .on("click", ".provision_select_flow_template .provision-pricing-table.only-one" , function(){
+ var context = $("#provision_create_flow");
+
+ if (!$(this).hasClass("selected")){
+ $("#provision_customize_flow_template").show();
+ $("#provision_customize_flow_template").html("");
+
+ var data = $(this).data("opennebula");
+ var body = data.DOCUMENT.TEMPLATE.BODY;
+
+ $("#provision_create_flow .total_cost_div").hide();
+
+ $(".provision_accordion_flow_template .selected_template").show();
+ $(".provision_accordion_flow_template .select_template").hide();
+ $(".provision_accordion_flow_template .selected_template_name").html(TemplateUtils.htmlEncode(data.DOCUMENT.NAME));
+ $(".provision_accordion_flow_template .selected_template_logo").html(" ");
+ $(".provision_accordion_flow_template a").first().trigger("click");
+
+ var context = $("#provision_create_flow");
+
+ if (body.custom_attrs || body.networks) {
+ UserInputs.serviceTemplateInsert(
+ $(".provision_network_selector", context),
+ data,
+ { select_networks: Config.isFeatureEnabled("show_vnet_instantiate_flow") }
+ );
+ } else {
+ $(".provision_network_selector", context).html("");
+ $(".provision_custom_attributes_selector", context).html("");
+ }
+
+ $.each(body.roles, function(index, role){
+ var context = $(TemplateFlowCreateRole({
+ "index": index,
+ "name": TemplateUtils.htmlEncode(role.name)
+ })).appendTo($("#provision_customize_flow_template"));
+
+ context.data("opennebula", role);
+
+ var template_id = role.vm_template;
+ var role_html_id = "#provision_create_flow_role_"+index;
+
+ OpenNebula.Template.show({
+ data : {
+ id: template_id,
+ extended: true
+ },
+ success: function(request,template_json){
+ var role_context = $(role_html_id);
+
+ generate_cardinality_selector(
+ $(".provision_cardinality_selector", context),
+ role,
+ template_json);
+
+ if (template_json.VMTEMPLATE.TEMPLATE.USER_INPUTS) {
+ UserInputs.vmTemplateInsert(
+ $(".provision_custom_attributes_selector", role_context),
+ template_json,
+ {text_header: " "+Locale.tr("Custom Attributes")});
+
+ } else {
+ $(".provision_custom_attributes_selector", role_context).html("");
+ }
+ }
+ });
+ });
+
+ return false;
+ }
+ });
+
+ tab.on("click", "#provision_create_flow .provision-pricing-table.only-one" , function(){
+ if (!$(this).hasClass("selected")){
+ $(".provision-pricing-table", $(this).parents(".dataTable")).removeClass("selected");
+ $(this).addClass("selected");
+ }
+
+ return false;
+ });
+
+ $("#provision_create_flow").submit(function(){
+ var context = $(this);
+ var flow_name = $("#flow_name", context).val();
+ var template_id = $(".provision_select_flow_template .selected", context).attr("opennebula_id");
+
+ if (!template_id) {
+ $(".alert-box-error", context).fadeIn().html(Locale.tr("You must select at least a template configuration"));
+ return false;
+ }
+
+ var extra_info = ServiceUtils.getExtraInfo(context, Config.isFeatureEnabled("show_vnet_instantiate_flow"));
+
+ $(".provision_create_flow_role", context).each(function(){
+ var role_template = $(this).data("opennebula");
+ var cardinality = WizardFields.retrieve( $(".provision_cardinality_selector", $(this)) )["cardinality"];
+ var temp_inputs = WizardFields.retrieve($(".provision_custom_attributes_selector", $(this)));
+ var vm_template_contents = TemplateUtils.stringToTemplate(role_template.vm_template_contents);
+
+ $.each(temp_inputs, function(inputName, inputValue) {
+ if (Array.isArray(inputValue)) {
+ delete temp_inputs[inputName];
+ temp_inputs[inputName] = inputValue.join(",");
+ }
+
+ // removes duplicated inputs in context
+ delete vm_template_contents[inputName];
+ });
+
+ extra_info.merge_template.roles.push($.extend(role_template, {
+ cardinality: cardinality,
+ user_inputs_values: temp_inputs,
+ vm_template_contents: TemplateUtils.templateToString(vm_template_contents),
+ }));
+ });
+
+ if (flow_name) {
+ extra_info.merge_template.name = flow_name;
+ }
+
+ Sunstone.runAction("Provision.Flow.instantiate", template_id, extra_info);
+ return false;
+ });
+
+ $(".provision_create_flow_button").on("click", function(){
+ show_provision_create_flow(provision_flow_templates_datatable);
+ });
+
+ Foundation.reflow($("#provision_create_flow"));
+ }
+
+ return _actions;
+});
\ No newline at end of file
diff --git a/src/sunstone/public/app/tabs/provision-tab/flows/html/cardinality.hbs b/src/sunstone/public/app/tabs/provision-tab/flows/html/cardinality.hbs
new file mode 100644
index 0000000000..6f380b9425
--- /dev/null
+++ b/src/sunstone/public/app/tabs/provision-tab/flows/html/cardinality.hbs
@@ -0,0 +1,32 @@
+{{! -------------------------------------------------------------------------- }}
+{{! Copyright 2002-2021, OpenNebula Project, OpenNebula Systems }}
+{{! }}
+{{! Licensed under the Apache License, Version 2.0 (the "License"); you may }}
+{{! not use this file except in compliance with the License. You may obtain }}
+{{! a copy of the License at }}
+{{! }}
+{{! http://www.apache.org/licenses/LICENSE-2.0 }}
+{{! }}
+{{! Unless required by applicable law or agreed to in writing, software }}
+{{! distributed under the License is distributed on an "AS IS" BASIS, }}
+{{! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. }}
+{{! See the License for the specific language governing permissions and }}
+{{! limitations under the License. }}
+{{! -------------------------------------------------------------------------- }}
+
+
\ No newline at end of file
diff --git a/src/sunstone/public/app/tabs/provision-tab/flows/create.hbs b/src/sunstone/public/app/tabs/provision-tab/flows/html/create.hbs
similarity index 100%
rename from src/sunstone/public/app/tabs/provision-tab/flows/create.hbs
rename to src/sunstone/public/app/tabs/provision-tab/flows/html/create.hbs
diff --git a/src/sunstone/public/app/tabs/provision-tab/flows/html/create_role.hbs b/src/sunstone/public/app/tabs/provision-tab/flows/html/create_role.hbs
new file mode 100644
index 0000000000..e2bfe656c0
--- /dev/null
+++ b/src/sunstone/public/app/tabs/provision-tab/flows/html/create_role.hbs
@@ -0,0 +1,30 @@
+{{! -------------------------------------------------------------------------- }}
+{{! Copyright 2002-2021, OpenNebula Project, OpenNebula Systems }}
+{{! }}
+{{! Licensed under the Apache License, Version 2.0 (the "License"); you may }}
+{{! not use this file except in compliance with the License. You may obtain }}
+{{! a copy of the License at }}
+{{! }}
+{{! http://www.apache.org/licenses/LICENSE-2.0 }}
+{{! }}
+{{! Unless required by applicable law or agreed to in writing, software }}
+{{! distributed under the License is distributed on an "AS IS" BASIS, }}
+{{! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. }}
+{{! See the License for the specific language governing permissions and }}
+{{! limitations under the License. }}
+{{! -------------------------------------------------------------------------- }}
+
+
+
+
+ {{name}}
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/sunstone/public/app/tabs/provision-tab/flows/info.hbs b/src/sunstone/public/app/tabs/provision-tab/flows/html/info.hbs
similarity index 100%
rename from src/sunstone/public/app/tabs/provision-tab/flows/info.hbs
rename to src/sunstone/public/app/tabs/provision-tab/flows/html/info.hbs
diff --git a/src/sunstone/public/app/tabs/provision-tab/flows/list.hbs b/src/sunstone/public/app/tabs/provision-tab/flows/html/list.hbs
similarity index 99%
rename from src/sunstone/public/app/tabs/provision-tab/flows/list.hbs
rename to src/sunstone/public/app/tabs/provision-tab/flows/html/list.hbs
index 6969678eed..82214fc766 100644
--- a/src/sunstone/public/app/tabs/provision-tab/flows/list.hbs
+++ b/src/sunstone/public/app/tabs/provision-tab/flows/html/list.hbs
@@ -57,6 +57,6 @@
-
{{> tabs/provision-tab/flows/info}}
+
{{> tabs/provision-tab/flows/html/info}}
\ No newline at end of file
diff --git a/src/sunstone/public/app/tabs/provision-tab/flows/html/pricing_table.hbs b/src/sunstone/public/app/tabs/provision-tab/flows/html/pricing_table.hbs
new file mode 100644
index 0000000000..40a3690018
--- /dev/null
+++ b/src/sunstone/public/app/tabs/provision-tab/flows/html/pricing_table.hbs
@@ -0,0 +1,27 @@
+{{! -------------------------------------------------------------------------- }}
+{{! Copyright 2002-2021, OpenNebula Project, OpenNebula Systems }}
+{{! }}
+{{! Licensed under the Apache License, Version 2.0 (the "License"); you may }}
+{{! not use this file except in compliance with the License. You may obtain }}
+{{! a copy of the License at }}
+{{! }}
+{{! http://www.apache.org/licenses/LICENSE-2.0 }}
+{{! }}
+{{! Unless required by applicable law or agreed to in writing, software }}
+{{! distributed under the License is distributed on an "AS IS" BASIS, }}
+{{! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. }}
+{{! See the License for the specific language governing permissions and }}
+{{! limitations under the License. }}
+{{! -------------------------------------------------------------------------- }}
+
+
\ No newline at end of file
diff --git a/src/sunstone/public/app/tabs/provision-tab/flows/html/role_item.hbs b/src/sunstone/public/app/tabs/provision-tab/flows/html/role_item.hbs
new file mode 100644
index 0000000000..dbe9688a57
--- /dev/null
+++ b/src/sunstone/public/app/tabs/provision-tab/flows/html/role_item.hbs
@@ -0,0 +1,21 @@
+{{! -------------------------------------------------------------------------- }}
+{{! Copyright 2002-2021, OpenNebula Project, OpenNebula Systems }}
+{{! }}
+{{! Licensed under the Apache License, Version 2.0 (the "License"); you may }}
+{{! not use this file except in compliance with the License. You may obtain }}
+{{! a copy of the License at }}
+{{! }}
+{{! http://www.apache.org/licenses/LICENSE-2.0 }}
+{{! }}
+{{! Unless required by applicable law or agreed to in writing, software }}
+{{! distributed under the License is distributed on an "AS IS" BASIS, }}
+{{! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. }}
+{{! See the License for the specific language governing permissions and }}
+{{! limitations under the License. }}
+{{! -------------------------------------------------------------------------- }}
+
+
+
+ {{name}}
+ {{cardinality}} VMs
+
\ No newline at end of file
diff --git a/src/sunstone/public/app/tabs/provision-tab/flows/html/templates_datatable.hbs b/src/sunstone/public/app/tabs/provision-tab/flows/html/templates_datatable.hbs
new file mode 100644
index 0000000000..bbedca8e85
--- /dev/null
+++ b/src/sunstone/public/app/tabs/provision-tab/flows/html/templates_datatable.hbs
@@ -0,0 +1,29 @@
+{{! -------------------------------------------------------------------------- }}
+{{! Copyright 2002-2021, OpenNebula Project, OpenNebula Systems }}
+{{! }}
+{{! Licensed under the Apache License, Version 2.0 (the "License"); you may }}
+{{! not use this file except in compliance with the License. You may obtain }}
+{{! a copy of the License at }}
+{{! }}
+{{! http://www.apache.org/licenses/LICENSE-2.0 }}
+{{! }}
+{{! Unless required by applicable law or agreed to in writing, software }}
+{{! distributed under the License is distributed on an "AS IS" BASIS, }}
+{{! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. }}
+{{! See the License for the specific language governing permissions and }}
+{{! limitations under the License. }}
+{{! -------------------------------------------------------------------------- }}
+
+
\ No newline at end of file
diff --git a/src/sunstone/public/app/tabs/provision-tab/flows/list.js b/src/sunstone/public/app/tabs/provision-tab/flows/list.js
index a40e687cf9..c748263ec0 100644
--- a/src/sunstone/public/app/tabs/provision-tab/flows/list.js
+++ b/src/sunstone/public/app/tabs/provision-tab/flows/list.js
@@ -25,7 +25,7 @@ define(function(require) {
var Sunstone = require("sunstone");
var TemplateUtils = require("utils/template-utils");
- var TemplateFlowsList = require("hbs!./list");
+ var TemplateFlowsList = require("hbs!./html/list");
var _accordionId = 0;
diff --git a/src/sunstone/public/app/tabs/provision-tab/vms/html/boot_row.hbs b/src/sunstone/public/app/tabs/provision-tab/vms/html/boot_row.hbs
new file mode 100644
index 0000000000..542dcaedb7
--- /dev/null
+++ b/src/sunstone/public/app/tabs/provision-tab/vms/html/boot_row.hbs
@@ -0,0 +1,40 @@
+{{! -------------------------------------------------------------------------- }}
+{{! Copyright 2002-2021, OpenNebula Project, OpenNebula Systems }}
+{{! }}
+{{! Licensed under the Apache License, Version 2.0 (the "License"); you may }}
+{{! not use this file except in compliance with the License. You may obtain }}
+{{! a copy of the License at }}
+{{! }}
+{{! http://www.apache.org/licenses/LICENSE-2.0 }}
+{{! }}
+{{! Unless required by applicable law or agreed to in writing, software }}
+{{! distributed under the License is distributed on an "AS IS" BASIS, }}
+{{! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. }}
+{{! See the License for the specific language governing permissions and }}
+{{! limitations under the License. }}
+{{! -------------------------------------------------------------------------- }}
+
+{{#if empty}}
+
+
{{tr "Disks and NICs will appear here"}}
+
+{{else}}
+
+
+
{{value}}
+
+
+
+
+
+
+
+
+{{/if}}
\ No newline at end of file
diff --git a/src/sunstone/public/app/tabs/provision-tab/vms/html/capacity.hbs b/src/sunstone/public/app/tabs/provision-tab/vms/html/capacity.hbs
new file mode 100644
index 0000000000..109ea949b9
--- /dev/null
+++ b/src/sunstone/public/app/tabs/provision-tab/vms/html/capacity.hbs
@@ -0,0 +1,27 @@
+{{! -------------------------------------------------------------------------- }}
+{{! Copyright 2002-2021, OpenNebula Project, OpenNebula Systems }}
+{{! }}
+{{! Licensed under the Apache License, Version 2.0 (the "License"); you may }}
+{{! not use this file except in compliance with the License. You may obtain }}
+{{! a copy of the License at }}
+{{! }}
+{{! http://www.apache.org/licenses/LICENSE-2.0 }}
+{{! }}
+{{! Unless required by applicable law or agreed to in writing, software }}
+{{! distributed under the License is distributed on an "AS IS" BASIS, }}
+{{! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. }}
+{{! See the License for the specific language governing permissions and }}
+{{! limitations under the License. }}
+{{! -------------------------------------------------------------------------- }}
+
+
\ No newline at end of file
diff --git a/src/sunstone/public/app/tabs/provision-tab/vms/confirm_poweroff.hbs b/src/sunstone/public/app/tabs/provision-tab/vms/html/confirm_poweroff.hbs
similarity index 100%
rename from src/sunstone/public/app/tabs/provision-tab/vms/confirm_poweroff.hbs
rename to src/sunstone/public/app/tabs/provision-tab/vms/html/confirm_poweroff.hbs
diff --git a/src/sunstone/public/app/tabs/provision-tab/vms/confirm_reboot.hbs b/src/sunstone/public/app/tabs/provision-tab/vms/html/confirm_reboot.hbs
similarity index 100%
rename from src/sunstone/public/app/tabs/provision-tab/vms/confirm_reboot.hbs
rename to src/sunstone/public/app/tabs/provision-tab/vms/html/confirm_reboot.hbs
diff --git a/src/sunstone/public/app/tabs/provision-tab/vms/confirm_save_as_template.hbs b/src/sunstone/public/app/tabs/provision-tab/vms/html/confirm_save_as_template.hbs
similarity index 100%
rename from src/sunstone/public/app/tabs/provision-tab/vms/confirm_save_as_template.hbs
rename to src/sunstone/public/app/tabs/provision-tab/vms/html/confirm_save_as_template.hbs
diff --git a/src/sunstone/public/app/tabs/provision-tab/vms/confirm_terminate.hbs b/src/sunstone/public/app/tabs/provision-tab/vms/html/confirm_terminate.hbs
similarity index 100%
rename from src/sunstone/public/app/tabs/provision-tab/vms/confirm_terminate.hbs
rename to src/sunstone/public/app/tabs/provision-tab/vms/html/confirm_terminate.hbs
diff --git a/src/sunstone/public/app/tabs/provision-tab/vms/confirm_undeploy.hbs b/src/sunstone/public/app/tabs/provision-tab/vms/html/confirm_undeploy.hbs
similarity index 100%
rename from src/sunstone/public/app/tabs/provision-tab/vms/confirm_undeploy.hbs
rename to src/sunstone/public/app/tabs/provision-tab/vms/html/confirm_undeploy.hbs
diff --git a/src/sunstone/public/app/tabs/provision-tab/vms/create.hbs b/src/sunstone/public/app/tabs/provision-tab/vms/html/create.hbs
similarity index 100%
rename from src/sunstone/public/app/tabs/provision-tab/vms/create.hbs
rename to src/sunstone/public/app/tabs/provision-tab/vms/html/create.hbs
diff --git a/src/sunstone/public/app/tabs/provision-tab/vms/info.hbs b/src/sunstone/public/app/tabs/provision-tab/vms/html/info.hbs
similarity index 100%
rename from src/sunstone/public/app/tabs/provision-tab/vms/info.hbs
rename to src/sunstone/public/app/tabs/provision-tab/vms/html/info.hbs
diff --git a/src/sunstone/public/app/tabs/provision-tab/vms/list.hbs b/src/sunstone/public/app/tabs/provision-tab/vms/html/list.hbs
similarity index 97%
rename from src/sunstone/public/app/tabs/provision-tab/vms/list.hbs
rename to src/sunstone/public/app/tabs/provision-tab/vms/html/list.hbs
index e679074142..07973da902 100644
--- a/src/sunstone/public/app/tabs/provision-tab/vms/list.hbs
+++ b/src/sunstone/public/app/tabs/provision-tab/vms/html/list.hbs
@@ -63,6 +63,6 @@
-
{{> tabs/provision-tab/vms/info}}
+
{{> tabs/provision-tab/vms/html/info}}
\ No newline at end of file
diff --git a/src/sunstone/public/app/tabs/provision-tab/vms/html/logo.hbs b/src/sunstone/public/app/tabs/provision-tab/vms/html/logo.hbs
new file mode 100644
index 0000000000..5fba8afbeb
--- /dev/null
+++ b/src/sunstone/public/app/tabs/provision-tab/vms/html/logo.hbs
@@ -0,0 +1,23 @@
+{{! -------------------------------------------------------------------------- }}
+{{! Copyright 2002-2021, OpenNebula Project, OpenNebula Systems }}
+{{! }}
+{{! Licensed under the Apache License, Version 2.0 (the "License"); you may }}
+{{! not use this file except in compliance with the License. You may obtain }}
+{{! a copy of the License at }}
+{{! }}
+{{! http://www.apache.org/licenses/LICENSE-2.0 }}
+{{! }}
+{{! Unless required by applicable law or agreed to in writing, software }}
+{{! distributed under the License is distributed on an "AS IS" BASIS, }}
+{{! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. }}
+{{! See the License for the specific language governing permissions and }}
+{{! limitations under the License. }}
+{{! -------------------------------------------------------------------------- }}
+
+
+ {{#if img }}
+
+ {{else}}
+
+ {{/if}}
+
\ No newline at end of file
diff --git a/src/sunstone/public/app/tabs/provision-tab/vms/html/template_card.hbs b/src/sunstone/public/app/tabs/provision-tab/vms/html/template_card.hbs
new file mode 100644
index 0000000000..2e915f7c3f
--- /dev/null
+++ b/src/sunstone/public/app/tabs/provision-tab/vms/html/template_card.hbs
@@ -0,0 +1,47 @@
+{{! -------------------------------------------------------------------------- }}
+{{! Copyright 2002-2021, OpenNebula Project, OpenNebula Systems }}
+{{! }}
+{{! Licensed under the Apache License, Version 2.0 (the "License"); you may }}
+{{! not use this file except in compliance with the License. You may obtain }}
+{{! a copy of the License at }}
+{{! }}
+{{! http://www.apache.org/licenses/LICENSE-2.0 }}
+{{! }}
+{{! Unless required by applicable law or agreed to in writing, software }}
+{{! distributed under the License is distributed on an "AS IS" BASIS, }}
+{{! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. }}
+{{! See the License for the specific language governing permissions and }}
+{{! limitations under the License. }}
+{{! -------------------------------------------------------------------------- }}
+
+{{#if instantiate}}
+ {{#if tableID}}
+
+ {{else}}
+
+
+
+
+
+
+
+ {{tr "There are no templates available"}}
+