From a244fb6d4266de7c8a237e67d3ed5022328b6fc5 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Tue, 24 Apr 2012 17:05:42 -0700 Subject: [PATCH] CS-14385: cloudstack UI - Host page - add "HA Enabled" column which only shows When ha.tag global configuration is not empty. --- ui/scripts/system.js | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/ui/scripts/system.js b/ui/scripts/system.js index 055ee5cc203..168a8cf2ee9 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -5961,6 +5961,22 @@ tabs: { details: { title: 'label.details', + + preFilter: function(args) { + var hiddenFields = []; + $.ajax({ + url: createURL('listConfigurations&name=ha.tag'), + dataType: 'json', + async: false, + success: function(json) { + if(json.listconfigurationsresponse.configuration == null || json.listconfigurationsresponse.configuration[0].value == null || json.listconfigurationsresponse.configuration[0].value.length == 0) { + hiddenFields.push('hahost'); + } + } + }); + return hiddenFields; + }, + fields: [ { name: { label: 'label.name' } @@ -5969,16 +5985,15 @@ id: { label: 'label.id' }, resourcestate: { label: 'label.resource.state' }, state: { label: 'label.state' }, - type: { label: 'label.type' }, - zonename: { label: 'label.zone' }, - podname: { label: 'label.pod' }, - clustername: { label: 'label.cluster' }, - ipaddress: { label: 'label.ip.address' }, - version: { label: 'label.version' }, + type: { label: 'label.type' }, hosttags: { label: 'label.host.tags', isEditable: true }, + hahost: { + label: 'label.ha.enabled', + converter: cloudStack.converters.toBooleanText + }, oscategoryid: { label: 'label.os.preference', isEditable: true, @@ -6000,6 +6015,11 @@ }); } }, + zonename: { label: 'label.zone' }, + podname: { label: 'label.pod' }, + clustername: { label: 'label.cluster' }, + ipaddress: { label: 'label.ip.address' }, + version: { label: 'label.version' }, disconnected: { label: 'label.last.disconnected' } } ],