mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-13 12:58:17 +03:00
parent
b5cd91901d
commit
0b3b527434
@ -145,8 +145,10 @@ define(function(require) {
|
||||
|
||||
RenameTr.setup(TAB_ID, RESOURCE, this.element.ID, context);
|
||||
ClusterTr.setup(RESOURCE, this.element.ID, this.element.CLUSTER_ID, context);
|
||||
TemplateTable.setup(this.strippedTemplate, RESOURCE, this.element.ID, context, this.unshownTemplate);
|
||||
TemplateTableVcenter.setup(this.strippedTemplateVcenter, RESOURCE, this.element.ID, context, this.unshownTemplate, false);
|
||||
|
||||
TemplateTable.setup(this.strippedTemplate, RESOURCE, this.element.ID, context, this.unshownTemplate, this.strippedTemplateVcenter);
|
||||
TemplateTableVcenter.setup(this.strippedTemplateVcenter, RESOURCE, this.element.ID, context, this.unshownTemplate, this.strippedTemplate);
|
||||
|
||||
PermissionsTable.setup(TAB_ID, RESOURCE, this.element, context);
|
||||
|
||||
if($.isEmptyObject(this.strippedTemplateVcenter)){
|
||||
|
@ -24,6 +24,7 @@ define(function(require) {
|
||||
var RenameTr = require('utils/panel/rename-tr');
|
||||
var PermissionsTable = require('utils/panel/permissions-table');
|
||||
var TemplateTable = require('utils/panel/template-table');
|
||||
var TemplateTableVcenter = require('utils/panel/template-table');
|
||||
var OpenNebula = require('opennebula');
|
||||
var Sunstone = require('sunstone');
|
||||
var Config = require('sunstone-config');
|
||||
@ -107,8 +108,8 @@ define(function(require) {
|
||||
});
|
||||
|
||||
var templateTableHTML = TemplateTable.html(strippedTemplate, RESOURCE, Locale.tr("Attributes"), true);
|
||||
var templateTableVcenterHTML = TemplateTable.html(strippedTemplateVcenter, RESOURCE, Locale.tr("vCenter information"), false);
|
||||
|
||||
var templateTableVcenterHTML = TemplateTableVcenter.html(strippedTemplateVcenter, RESOURCE, Locale.tr("Vcenter information"), false);
|
||||
|
||||
var monitoring = $.extend({}, this.element.MONITORING);
|
||||
delete monitoring.CPU;
|
||||
@ -164,6 +165,7 @@ define(function(require) {
|
||||
$('.vcenter', context).hide();
|
||||
}
|
||||
|
||||
TemplateTable.setup(strippedTemplate, RESOURCE, this.element.ID, context, unshownValues);
|
||||
TemplateTable.setup(strippedTemplate, RESOURCE, this.element.ID, context, unshownValues, strippedTemplateVcenter);
|
||||
TemplateTableVcenter.setup(strippedTemplateVcenter, RESOURCE, this.element.ID, context, unshownValues, strippedTemplate);
|
||||
}
|
||||
});
|
||||
|
@ -65,7 +65,9 @@ define(function(require) {
|
||||
have been deleted from the templateJSON param. Whithout this, a template
|
||||
update would permanently delete the missing values from OpenNebula
|
||||
*/
|
||||
var _setup = function(templateJSON, resourceType, resourceId, context, unshownValues, modify=true) {
|
||||
|
||||
var _setup = function(templateJSON, resourceType, resourceId, context, unshownValues, templateJSON_Others) {
|
||||
|
||||
// Remove previous listeners
|
||||
context.off("keypress", "#new_key");
|
||||
context.off("keypress", "#new_value");
|
||||
@ -84,9 +86,12 @@ define(function(require) {
|
||||
context.on("click", '#button_add_value', function() {
|
||||
new_value = $('#new_value', $(this).parent().parent()).val();
|
||||
new_key = $('#new_key', $(this).parent().parent()).val();
|
||||
if (modify && !templateJSON[new_key]){
|
||||
|
||||
if (!templateJSON[new_key]){
|
||||
if (new_key != "") {
|
||||
var templateJSON_bk = $.extend({}, templateJSON);
|
||||
templateJSON = $.extend({}, templateJSON_Others, templateJSON);
|
||||
var templateJSON_bk = $.extend({},templateJSON);
|
||||
|
||||
if (templateJSON[$.trim(new_key)] && (templateJSON[$.trim(new_key)] instanceof Array)) {
|
||||
templateJSON[$.trim(new_key)].push($.trim(new_value));
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user