From 5396dfa55c343a146667b7148a66864ef6093cc2 Mon Sep 17 00:00:00 2001 From: Pranav Saxena Date: Wed, 3 Jul 2013 17:22:35 +0530 Subject: [PATCH] CLOUDSTACK-2760: Agent status for SSVM and CPVM --- ui/scripts/system.js | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/ui/scripts/system.js b/ui/scripts/system.js index 496f5858d28..e00cb7696e8 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -7026,7 +7026,30 @@ url: createURL('listSystemVms' + searchByArgs), data: { page: args.page, pageSize: pageSize, listAll: true }, success: function (json) { - args.response.success({ data: json.listsystemvmsresponse.systemvm }); + var items = json.listsystemvmsresponse.systemvm; + if(items != null){ + $.ajax({ + url:createURL("listHosts&listAll=true" ), + async:false, + success:function(json){ + + var hostObj = json.listhostsresponse.host; + + $(hostObj).each(function(index){ + + $.extend(items[index],{agentstate:hostObj[index].state}); + + }); + args.response.success({ data:items}); + }, + error:function(json){ + args.response.error(parseXMLHttpResponse(json)); + + } + }); + } + + // args.response.success({ data: json.listsystemvmsresponse.systemvm }); }, error: function (json) { args.response.error(parseXMLHttpResponse(json)); @@ -7689,7 +7712,7 @@ }, zonename: { label: 'label.zone' }, state: { - label: 'label.status', + label: 'VM state', converter: function(str) { // For localization return str; @@ -7700,7 +7723,17 @@ 'Error': 'off', 'Destroyed': 'off' } + }, + + agentstate:{ + label:'Agent State', + indicator:{ + 'Up':'on', + 'Down':'off' + } } + + }, dataProvider: function(args) { var array1 = [];