CLOUDSTACK-6852: UI - modules - (1) add new shared function addExtraPropertiesIfDrModuleIncluded(). (2) add DR fields to Instances detailView.

This commit is contained in:
Jessica Wang 2014-06-06 15:15:11 -07:00
parent ea196a4ffc
commit 36ec16e4f5
2 changed files with 29 additions and 0 deletions

View File

@ -1878,6 +1878,9 @@
jsonObj.xenserverToolsVersion61plus = false;
}
//if DR module is included
addExtraPropertiesIfDrModuleIncluded(jsonObj, "UserVM");
args.response.success({
actionFilter: vmActionfilter,
data: jsonObj

View File

@ -1175,6 +1175,32 @@ function listViewDataProvider(args, data, options) {
return data;
}
var addExtraPropertiesIfDrModuleIncluded = function(jsonObj, resourceType) {
if (drModuleIncluded) {
$.ajax({
url: createURL("listResourceDetails"),
data: {
resourceid: jsonObj.id,
resourcetype: resourceType
},
async: false,
success: function(json) {
var drFieldNameArray = [];
var resourcedetails = json.listresourcedetailsresponse.resourcedetail;
if (resourcedetails != undefined) {
for (var i = 0; i < resourcedetails.length; i++) {
if (resourcedetails[i].key.indexOf("DR_") > -1) {
drFieldNameArray.push(resourcedetails[i].key);
jsonObj[resourcedetails[i].key] = resourcedetails[i].value;
}
}
}
jsonObj["drFieldNameArray"] = drFieldNameArray;
}
});
}
}
//used by infrastructure page and network page
var addExtraPropertiesToGuestNetworkObject = function(jsonObj) {
jsonObj.networkdomaintext = jsonObj.networkdomain;