mirror of
https://github.com/OpenNebula/one.git
synced 2025-04-01 06:50:25 +03:00
Feature: #4474: Add template_creation_tabs to vrouter-templates-tab
This commit is contained in:
parent
c46a14af78
commit
2bbcf9660b
@ -243,6 +243,17 @@ tabs:
|
||||
VirtualRouterTemplate.delete_dialog: true
|
||||
VirtualRouterTemplate.share: true
|
||||
VirtualRouterTemplate.unshare: true
|
||||
template_creation_tabs:
|
||||
general: true
|
||||
storage: true
|
||||
network: true
|
||||
os_booting: true
|
||||
features: true
|
||||
input_output: true
|
||||
context: true
|
||||
scheduling: true
|
||||
hybrid: true
|
||||
other: true
|
||||
instances-top-tab:
|
||||
panel_tabs:
|
||||
actions:
|
||||
|
@ -241,6 +241,17 @@ tabs:
|
||||
VirtualRouterTemplate.delete_dialog: true
|
||||
VirtualRouterTemplate.share: false
|
||||
VirtualRouterTemplate.unshare: false
|
||||
template_creation_tabs:
|
||||
general: true
|
||||
storage: true
|
||||
network: true
|
||||
os_booting: true
|
||||
features: true
|
||||
input_output: true
|
||||
context: true
|
||||
scheduling: true
|
||||
hybrid: true
|
||||
other: true
|
||||
instances-top-tab:
|
||||
panel_tabs:
|
||||
actions:
|
||||
|
@ -242,6 +242,17 @@ tabs:
|
||||
VirtualRouterTemplate.delete_dialog: true
|
||||
VirtualRouterTemplate.share: true
|
||||
VirtualRouterTemplate.unshare: true
|
||||
template_creation_tabs:
|
||||
general: true
|
||||
storage: true
|
||||
network: true
|
||||
os_booting: true
|
||||
features: true
|
||||
input_output: true
|
||||
context: true
|
||||
scheduling: true
|
||||
hybrid: true
|
||||
other: true
|
||||
instances-top-tab:
|
||||
panel_tabs:
|
||||
actions:
|
||||
|
@ -244,6 +244,17 @@ tabs:
|
||||
VirtualRouterTemplate.delete_dialog: true
|
||||
VirtualRouterTemplate.share: true
|
||||
VirtualRouterTemplate.unshare: true
|
||||
template_creation_tabs:
|
||||
general: true
|
||||
storage: true
|
||||
network: true
|
||||
os_booting: true
|
||||
features: true
|
||||
input_output: true
|
||||
context: true
|
||||
scheduling: true
|
||||
hybrid: true
|
||||
other: true
|
||||
instances-top-tab:
|
||||
panel_tabs:
|
||||
actions:
|
||||
|
@ -243,6 +243,17 @@ tabs:
|
||||
VirtualRouterTemplate.delete_dialog: true
|
||||
VirtualRouterTemplate.share: true
|
||||
VirtualRouterTemplate.unshare: true
|
||||
template_creation_tabs:
|
||||
general: true
|
||||
storage: true
|
||||
network: true
|
||||
os_booting: true
|
||||
features: true
|
||||
input_output: true
|
||||
context: true
|
||||
scheduling: true
|
||||
hybrid: true
|
||||
other: true
|
||||
instances-top-tab:
|
||||
panel_tabs:
|
||||
actions:
|
||||
|
@ -86,9 +86,9 @@ define(function(require) {
|
||||
}
|
||||
},
|
||||
|
||||
"isTemplateCreationTabEnabled": function(templateTabName) {
|
||||
"isTemplateCreationTabEnabled": function(tabName, wizardTabName) {
|
||||
if (_config['view']['tabs']['templates-tab']) {
|
||||
var enabled = _config['view']['tabs']['templates-tab']['template_creation_tabs'][templateTabName];
|
||||
var enabled = _config['view']['tabs'][tabName]['template_creation_tabs'][wizardTabName];
|
||||
return enabled;
|
||||
} else {
|
||||
return false;
|
||||
|
@ -48,30 +48,53 @@ define(function(require) {
|
||||
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');
|
||||
|
||||
/*
|
||||
CONSTRUCTOR
|
||||
*/
|
||||
|
||||
function FormPanel() {
|
||||
var create_title;
|
||||
var update_title;
|
||||
|
||||
if (this.resource == "Template"){
|
||||
create_title = Locale.tr("Create VM Template");
|
||||
update_title = Locale.tr("Update VM Template");
|
||||
} else {
|
||||
create_title = Locale.tr("Create Virtual Router VM Template");
|
||||
update_title = Locale.tr("Update Virtual Router VM Template");
|
||||
}
|
||||
|
||||
this.actions = {
|
||||
'create': {
|
||||
'title': Locale.tr("Create VM Template"),
|
||||
'title': create_title,
|
||||
'buttonText': Locale.tr("Create"),
|
||||
'resetButton': true
|
||||
},
|
||||
'update': {
|
||||
'title': Locale.tr("Update VM Template"),
|
||||
'title': update_title,
|
||||
'buttonText': Locale.tr("Update"),
|
||||
'resetButton': false
|
||||
}
|
||||
};
|
||||
|
||||
var that = this;
|
||||
|
||||
var tabId;
|
||||
|
||||
if (this.resource == "Template"){
|
||||
tabId = TEMPLATES_TAB_ID;
|
||||
} else {
|
||||
tabId = VROUTER_TEMPLATES_TAB_ID;
|
||||
}
|
||||
|
||||
that.wizardTabs = [];
|
||||
var wizardTabInstance;
|
||||
$.each(WIZARD_TABS, function(index, wizardTab) {
|
||||
try {
|
||||
wizardTabInstance = new wizardTab({listener: that});
|
||||
wizardTabInstance = new wizardTab({listener: that, tabId: tabId});
|
||||
wizardTabInstance.contentHTML = wizardTabInstance.html();
|
||||
that.wizardTabs.push(wizardTabInstance);
|
||||
} catch (err) {
|
||||
|
@ -46,8 +46,8 @@ define(function(require) {
|
||||
CONSTRUCTOR
|
||||
*/
|
||||
|
||||
function WizardTab() {
|
||||
if (!Config.isTemplateCreationTabEnabled('context')) {
|
||||
function WizardTab(opts) {
|
||||
if (!Config.isTemplateCreationTabEnabled(opts.tabId, 'context')) {
|
||||
throw "Wizard Tab not enabled";
|
||||
}
|
||||
|
||||
|
@ -43,7 +43,11 @@ define(function(require) {
|
||||
CONSTRUCTOR
|
||||
*/
|
||||
|
||||
function WizardTab() {
|
||||
function WizardTab(opts) {
|
||||
if (!Config.isTemplateCreationTabEnabled(opts.tabId, 'general')) {
|
||||
throw "Wizard Tab not enabled";
|
||||
}
|
||||
|
||||
this.wizardTabId = WIZARD_TAB_ID + UniqueId.id();
|
||||
this.icon = 'fa-laptop';
|
||||
this.title = Locale.tr("General");
|
||||
|
@ -44,8 +44,8 @@ define(function(require) {
|
||||
CONSTRUCTOR
|
||||
*/
|
||||
|
||||
function WizardTab() {
|
||||
if (!Config.isTemplateCreationTabEnabled('hybrid')) {
|
||||
function WizardTab(opts) {
|
||||
if (!Config.isTemplateCreationTabEnabled(opts.tabId, 'hybrid')) {
|
||||
throw "Wizard Tab not enabled";
|
||||
}
|
||||
|
||||
|
@ -41,8 +41,8 @@ define(function(require) {
|
||||
CONSTRUCTOR
|
||||
*/
|
||||
|
||||
function WizardTab() {
|
||||
if (!Config.isTemplateCreationTabEnabled('input_output')) {
|
||||
function WizardTab(opts) {
|
||||
if (!Config.isTemplateCreationTabEnabled(opts.tabId, 'input_output')) {
|
||||
throw "Wizard Tab not enabled";
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ define(function(require) {
|
||||
*/
|
||||
|
||||
function WizardTab(opts) {
|
||||
if (!Config.isTemplateCreationTabEnabled('network')) {
|
||||
if (!Config.isTemplateCreationTabEnabled(opts.tabId, 'network')) {
|
||||
throw "Wizard Tab not enabled";
|
||||
}
|
||||
|
||||
|
@ -137,8 +137,8 @@ define(function(require) {
|
||||
CONSTRUCTOR
|
||||
*/
|
||||
|
||||
function WizardTab() {
|
||||
if (!Config.isTemplateCreationTabEnabled('os_booting')) {
|
||||
function WizardTab(opts) {
|
||||
if (!Config.isTemplateCreationTabEnabled(opts.tabId, 'os_booting')) {
|
||||
throw "Wizard Tab not enabled";
|
||||
}
|
||||
|
||||
|
@ -45,8 +45,8 @@ define(function(require) {
|
||||
CONSTRUCTOR
|
||||
*/
|
||||
|
||||
function WizardTab() {
|
||||
if (!Config.isTemplateCreationTabEnabled('other')) {
|
||||
function WizardTab(opts) {
|
||||
if (!Config.isTemplateCreationTabEnabled(opts.tabId, 'other')) {
|
||||
throw "Wizard Tab not enabled";
|
||||
}
|
||||
|
||||
|
@ -45,8 +45,8 @@ define(function(require) {
|
||||
CONSTRUCTOR
|
||||
*/
|
||||
|
||||
function WizardTab() {
|
||||
if (!Config.isTemplateCreationTabEnabled('scheduling')) {
|
||||
function WizardTab(opts) {
|
||||
if (!Config.isTemplateCreationTabEnabled(opts.tabId, 'scheduling')) {
|
||||
throw "Wizard Tab not enabled";
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ define(function(require) {
|
||||
*/
|
||||
|
||||
function WizardTab(opts) {
|
||||
if (!Config.isTemplateCreationTabEnabled('storage')) {
|
||||
if (!Config.isTemplateCreationTabEnabled(opts.tabId, 'storage')) {
|
||||
throw "Wizard Tab not enabled";
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user