Skip to content

Commit 36ec16e

Browse files
author
Jessica Wang
committed
CLOUDSTACK-6852: UI - modules - (1) add new shared function addExtraPropertiesIfDrModuleIncluded(). (2) add DR fields to Instances detailView.
1 parent ea196a4 commit 36ec16e

2 files changed

Lines changed: 29 additions & 0 deletions

File tree

ui/scripts/instances.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1878,6 +1878,9 @@
18781878
jsonObj.xenserverToolsVersion61plus = false;
18791879
}
18801880

1881+
//if DR module is included
1882+
addExtraPropertiesIfDrModuleIncluded(jsonObj, "UserVM");
1883+
18811884
args.response.success({
18821885
actionFilter: vmActionfilter,
18831886
data: jsonObj

ui/scripts/sharedFunctions.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1175,6 +1175,32 @@ function listViewDataProvider(args, data, options) {
11751175
return data;
11761176
}
11771177

1178+
var addExtraPropertiesIfDrModuleIncluded = function(jsonObj, resourceType) {
1179+
if (drModuleIncluded) {
1180+
$.ajax({
1181+
url: createURL("listResourceDetails"),
1182+
data: {
1183+
resourceid: jsonObj.id,
1184+
resourcetype: resourceType
1185+
},
1186+
async: false,
1187+
success: function(json) {
1188+
var drFieldNameArray = [];
1189+
var resourcedetails = json.listresourcedetailsresponse.resourcedetail;
1190+
if (resourcedetails != undefined) {
1191+
for (var i = 0; i < resourcedetails.length; i++) {
1192+
if (resourcedetails[i].key.indexOf("DR_") > -1) {
1193+
drFieldNameArray.push(resourcedetails[i].key);
1194+
jsonObj[resourcedetails[i].key] = resourcedetails[i].value;
1195+
}
1196+
}
1197+
}
1198+
jsonObj["drFieldNameArray"] = drFieldNameArray;
1199+
}
1200+
});
1201+
}
1202+
}
1203+
11781204
//used by infrastructure page and network page
11791205
var addExtraPropertiesToGuestNetworkObject = function(jsonObj) {
11801206
jsonObj.networkdomaintext = jsonObj.networkdomain;

0 commit comments

Comments
 (0)