1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-04-01 06:50:25 +03:00

Bug #4526: Fix VM updateconf

This commit is contained in:
Carlos Martín 2016-06-08 15:10:53 +02:00
parent 6b44f5f47a
commit 1e68754d86
3 changed files with 14 additions and 9 deletions

View File

@ -87,12 +87,13 @@ define(function(require) {
},
"isTemplateCreationTabEnabled": function(tabName, wizardTabName) {
if (_config['view']['tabs']['templates-tab']) {
var enabled = _config['view']['tabs'][tabName]['template_creation_tabs'][wizardTabName];
return enabled;
} else {
return false;
var enabled = false;
if (_config['view']['tabs'][tabName] && _config['view']['tabs'][tabName]['template_creation_tabs']) {
enabled = _config['view']['tabs'][tabName]['template_creation_tabs'][wizardTabName];
}
return (enabled == true);
},
"dashboardWidgets": function(perRow) {

View File

@ -38,6 +38,7 @@ define(function(require) {
var FORM_PANEL_ID = require('./updateconf/formPanelId');
var TAB_ID = require('../tabId');
var TEMPLATE_TAB_ID = require('tabs/templates-tab/tabId');
var WIZARD_TABS = [
require('tabs/templates-tab/form-panels/create/wizard-tabs/os'),
require('tabs/templates-tab/form-panels/create/wizard-tabs/io'),
@ -65,7 +66,8 @@ define(function(require) {
var wizardTabInstance;
$.each(WIZARD_TABS, function(index, wizardTab) {
try {
wizardTabInstance = new wizardTab();
// Search enabled tabs for template creation in yaml view files
wizardTabInstance = new wizardTab({tabId: TEMPLATE_TAB_ID});
wizardTabInstance.contentHTML = wizardTabInstance.html();
that.wizardTabs.push(wizardTabInstance);
} catch (err) {
@ -143,9 +145,11 @@ define(function(require) {
return false;
}
function _fill(context, elementId, templateJSON) {
function _fill(context, element) {
this.setHeader(element);
this.resourceId = elementId;
this.resourceId = element.ID;
var templateJSON = element.TEMPLATE;
// Populates the Avanced mode Tab
$('#template', context).val(

View File

@ -97,7 +97,7 @@ define(function(require) {
Sunstone.showFormPanel(TAB_ID, UPDATECONF_FORM_ID, "updateconf",
function(formPanelInstance, context) {
formPanelInstance.fill(context, that.element.ID, that.element.TEMPLATE);
formPanelInstance.fill(context, that.element);
});
return false;