diff --git a/src/sunstone/public/app/tabs/marketplaceapps-tab/actions.js b/src/sunstone/public/app/tabs/marketplaceapps-tab/actions.js index 4793e9a167..530c033d1f 100644 --- a/src/sunstone/public/app/tabs/marketplaceapps-tab/actions.js +++ b/src/sunstone/public/app/tabs/marketplaceapps-tab/actions.js @@ -36,7 +36,19 @@ define(function(require) { "MarketPlaceApp.export_dialog" : { type: "custom", call: function() { - Sunstone.showFormPanel(TAB_ID, EXPORT_DIALOG_ID, "export"); + var selected_nodes = Sunstone.getDataTable(TAB_ID).elements(); + if (selected_nodes.length != 1) { + Notifier.notifyMessage("Please select one (and just one) app to export."); + return false; + } + + var resourceId = "" + selected_nodes[0]; + + Sunstone.resetFormPanel(TAB_ID, EXPORT_DIALOG_ID); + Sunstone.showFormPanel(TAB_ID, EXPORT_DIALOG_ID, "export", + function(formPanelInstance, context) { + formPanelInstance.setResourceId(context, resourceId); + }); } }, "MarketPlaceApp.export" : { diff --git a/src/sunstone/public/app/tabs/marketplaceapps-tab/form-panels/export.js b/src/sunstone/public/app/tabs/marketplaceapps-tab/form-panels/export.js index 875b01da34..05e72367af 100644 --- a/src/sunstone/public/app/tabs/marketplaceapps-tab/form-panels/export.js +++ b/src/sunstone/public/app/tabs/marketplaceapps-tab/form-panels/export.js @@ -73,6 +73,7 @@ define(function(require) { FormPanel.prototype.constructor = FormPanel; FormPanel.prototype.htmlWizard = _htmlWizard; FormPanel.prototype.submitWizard = _submitWizard; + FormPanel.prototype.setResourceId = _setResourceId; FormPanel.prototype.onShow = _onShow; FormPanel.prototype.setup = _setup; @@ -105,6 +106,9 @@ define(function(require) { this.datastoresTable.idInput().attr('required', ''); } + function _setResourceId(context, resourceId) { + this.resourceId = resourceId; + } function _submitWizard(context) { var marketPlaceAppObj = { @@ -112,7 +116,7 @@ define(function(require) { "dsid" : this.datastoresTable.idInput().val() }; - Sunstone.runAction("MarketPlaceApp.export", Sunstone.getDataTable(TAB_ID).elements(), marketPlaceAppObj); + Sunstone.runAction("MarketPlaceApp.export", [this.resourceId], marketPlaceAppObj); return false; } }); 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 f890cd796a..3a67cb32f8 100644 --- a/src/sunstone/public/app/tabs/provision-tab/templates/list.js +++ b/src/sunstone/public/app/tabs/provision-tab/templates/list.js @@ -94,7 +94,13 @@ define(function(require) { datatable.fnAddData(item_list); LabelsUtils.clearLabelsFilter(datatable, TEMPLATE_LABELS_COLUMN); var context = $('.labels-dropdown', datatable.closest('.content')); - LabelsUtils.insertLabelsMenu(context, datatable, TEMPLATE_LABELS_COLUMN, "VMTEMPLATE.TEMPLATE.LABELS"); + LabelsUtils.insertLabelsMenu({ + 'context': context, + 'dataTable': datatable, + 'labelsColumn': TEMPLATE_LABELS_COLUMN, + 'labelsPath': 'VMTEMPLATE.TEMPLATE.LABELS', + 'placeholder': Locale.tr("No labels defined") + }); } }, error: Notifier.onError diff --git a/src/sunstone/public/app/tabs/vms-tab/buttons.js b/src/sunstone/public/app/tabs/vms-tab/buttons.js index 0eec3bae20..06d61e7179 100644 --- a/src/sunstone/public/app/tabs/vms-tab/buttons.js +++ b/src/sunstone/public/app/tabs/vms-tab/buttons.js @@ -58,7 +58,7 @@ define(function(require) { }, "VM.migrate_live" : { type: "action", - text: Locale.tr("Migrate") + ' live', + text: Locale.tr("Migrate") + ' ' + Locale.tr("live") + '', tip: Locale.tr("This will live-migrate the selected VMs to the chosen host"), layout: "vmsplanification_buttons", custom_classes : "state-dependent" @@ -107,7 +107,7 @@ define(function(require) { }, "VM.reboot_hard" : { type: "action", - text: Locale.tr("Reboot") + ' hard', + text: Locale.tr("Reboot") + ' ' + Locale.tr("hard") + '', layout: "vmsrepeat_buttons", tip: Locale.tr("This will perform a hard reboot on selected VMs"), custom_classes : "state-dependent" @@ -121,7 +121,7 @@ define(function(require) { }, "VM.poweroff_hard" : { type: "action", - text: Locale.tr("Power Off") + ' hard', + text: Locale.tr("Power Off") + ' ' + Locale.tr("hard") + '', layout: "vmspause_buttons", tip: Locale.tr("This will send a forced power off signal to running VMs. They can be resumed later."), custom_classes : "state-dependent" @@ -135,7 +135,7 @@ define(function(require) { }, "VM.undeploy_hard" : { type: "action", - text: Locale.tr("Undeploy") + ' hard', + text: Locale.tr("Undeploy") + ' ' + Locale.tr("hard") + '', layout: "vmsstop_buttons", tip: Locale.tr("Shuts down the given VM. The VM is saved in the system Datastore."), custom_classes : "state-dependent" @@ -149,7 +149,7 @@ define(function(require) { }, "VM.shutdown_hard" : { type: "confirm", - text: Locale.tr("Shutdown") + ' hard', + text: Locale.tr("Shutdown") + ' ' + Locale.tr("hard") + '', layout: "vmsdelete_buttons", tip: Locale.tr("This will initiate the shutdown-hard (forced) process in the selected VMs"), custom_classes : "state-dependent" @@ -164,7 +164,7 @@ define(function(require) { }, "VM.delete_recreate" : { type: "confirm", - text: Locale.tr("Delete") + ' recreate', + text: Locale.tr("Delete") + ' ' + Locale.tr("recreate") + '', layout: "vmsrepeat_buttons", tip: Locale.tr("This will delete and recreate VMs to PENDING state"), custom_classes : "state-dependent" diff --git a/src/sunstone/public/app/tabs/vms-tab/panels/info.js b/src/sunstone/public/app/tabs/vms-tab/panels/info.js index f8d893b2bb..785db6f686 100644 --- a/src/sunstone/public/app/tabs/vms-tab/panels/info.js +++ b/src/sunstone/public/app/tabs/vms-tab/panels/info.js @@ -77,7 +77,20 @@ define(function(require) { var deployId = (typeof(this.element.DEPLOY_ID) == "object" ? "--" : this.element.DEPLOY_ID); var resched = (parseInt(this.element.RESCHED) ? Locale.tr("yes") : Locale.tr("no")) - var templateTableHTML = TemplateTable.html(this.element.USER_TEMPLATE, RESOURCE, Locale.tr("Attributes")); + + // Get rid of the unwanted (for show) SCHED_* keys + var that = this; + var strippedTemplate = {}; + var unshownValues = {}; + $.each(that.element.USER_TEMPLATE, function(key, value) { + if (!key.match(/^SCHED_*/)) { + strippedTemplate[key] = value; + } else { + unshownValues[key] = value; + } + }) + + var templateTableHTML = TemplateTable.html(strippedTemplate, RESOURCE, Locale.tr("Attributes"), unshownValues); var monitoring = $.extend({}, this.element.MONITORING); delete monitoring.CPU; diff --git a/src/sunstone/public/app/tabs/vnets-topology-tab.js b/src/sunstone/public/app/tabs/vnets-topology-tab.js index b26a5e6dba..ffed3068a1 100644 --- a/src/sunstone/public/app/tabs/vnets-topology-tab.js +++ b/src/sunstone/public/app/tabs/vnets-topology-tab.js @@ -25,6 +25,7 @@ define(function(require) { var Vis = require('vis'); var TemplateDashboard = require('hbs!./vnets-topology-tab/html'); + var TemplateEmptyTable = require('hbs!utils/tab-datatable/empty-table'); var _network; var _vnetList; @@ -120,26 +121,32 @@ define(function(require) { var i = 0; function _getVNet(index){ - var vnetId = item_list[index].VNET.ID; + var element = item_list[index]; + if (element !== undefined) { + var vnetId = element.VNET.ID; - OpenNebula.Network.show({ - data : { - id: vnetId - }, - timeout:true, - success: function(request,info){ - vnetList.push(info); + OpenNebula.Network.show({ + data : { + id: vnetId + }, + timeout:true, + success: function(request,info){ + vnetList.push(info); - i += 1; - if (i == item_list.length){ - _vnetList = vnetList; - _doTopology(); - } else { - _getVNet(i); - } - }, - error: Notifier.onError - }); + i += 1; + if (i == item_list.length){ + _vnetList = vnetList; + _doTopology(); + } else { + _getVNet(i); + } + }, + error: Notifier.onError + }); + } else { + _vnetList = vnetList; + $('#visgraph').html(TemplateEmptyTable()); + } } _getVNet(i); diff --git a/src/sunstone/public/app/tabs/vnets-topology-tab/html.hbs b/src/sunstone/public/app/tabs/vnets-topology-tab/html.hbs index 459145a70f..63e8396c17 100644 --- a/src/sunstone/public/app/tabs/vnets-topology-tab/html.hbs +++ b/src/sunstone/public/app/tabs/vnets-topology-tab/html.hbs @@ -14,4 +14,5 @@ {{! limitations under the License. }} {{! -------------------------------------------------------------------------- }} -
+