mirror of
				https://github.com/apache/cloudstack.git
				synced 2025-10-26 08:42:29 +01:00 
			
		
		
		
	UI - modules - replace addExtraPropertiesIfDrModuleIncluded() with cloudStack.dr.sharedFunctions.addExtraProperties().
This commit is contained in:
		
							parent
							
								
									3acebf230c
								
							
						
					
					
						commit
						3a3a3902b7
					
				| @ -1878,8 +1878,9 @@ | ||||
|                                             jsonObj.xenserverToolsVersion61plus = false; | ||||
|                                     } | ||||
|                                                                         | ||||
|                                     //if DR module is included                                   
 | ||||
|                                     addExtraPropertiesIfDrModuleIncluded(jsonObj, "UserVM"); | ||||
|                                     if (isModuleIncluded("dr")) { | ||||
|                                         cloudStack.dr.sharedFunctions.addExtraProperties(jsonObj, "UserVM"); | ||||
|                                     }                                     | ||||
|                                                                          | ||||
|                                     args.response.success({ | ||||
|                                         actionFilter: vmActionfilter, | ||||
|  | ||||
| @ -1384,8 +1384,9 @@ | ||||
|                                             var jsonObj = json.listnetworksresponse.network[0]; | ||||
|                                             addExtraPropertiesToGuestNetworkObject(jsonObj); | ||||
|                                               | ||||
|                                             //if DR module is included                                   
 | ||||
|                                             addExtraPropertiesIfDrModuleIncluded(jsonObj, "Network");                                                             | ||||
|                                             if (isModuleIncluded("dr")) { | ||||
|                                                 cloudStack.dr.sharedFunctions.addExtraProperties(jsonObj, "Network");  | ||||
|                                             } | ||||
|                                                                                       | ||||
|                                             args.response.success({ | ||||
|                                                 actionFilter: cloudStack.actionFilter.guestNetwork, | ||||
|  | ||||
| @ -1173,32 +1173,6 @@ function listViewDataProvider(args, data, options) { | ||||
|     return data; | ||||
| } | ||||
| 
 | ||||
| var addExtraPropertiesIfDrModuleIncluded = function(jsonObj, resourceType) {       | ||||
|     if (isModuleIncluded("dr")) { | ||||
|         $.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; | ||||
|  | ||||
| @ -1502,8 +1502,9 @@ | ||||
|                                         success: function(json) { | ||||
|                                             var jsonObj = json.listvolumesresponse.volume[0]; | ||||
|                                              | ||||
|                                             //if DR module is included                                   
 | ||||
|                                             addExtraPropertiesIfDrModuleIncluded(jsonObj, "Volume"); | ||||
|                                             if (isModuleIncluded("dr")) { | ||||
|                                                 cloudStack.dr.sharedFunctions.addExtraProperties(jsonObj, "Volume"); | ||||
|                                             }                                             | ||||
|                                              | ||||
|                                             args.response.success({ | ||||
|                                                 actionFilter: volumeActionfilter, | ||||
|  | ||||
| @ -1955,8 +1955,9 @@ | ||||
|                                                             selectedGuestNetworkObj = json.listnetworksresponse.network[0]; | ||||
|                                                             addExtraPropertiesToGuestNetworkObject(selectedGuestNetworkObj); | ||||
|                                                                                                                          | ||||
|                                                             //if DR module is included                                   
 | ||||
|                                                             addExtraPropertiesIfDrModuleIncluded(selectedGuestNetworkObj, "Network");                                                             | ||||
|                                                             if (isModuleIncluded("dr")) { | ||||
|                                                                 cloudStack.dr.sharedFunctions.addExtraProperties(selectedGuestNetworkObj, "Network");   | ||||
|                                                             } | ||||
|                                                              | ||||
|                                                             args.response.success({ | ||||
|                                                                 actionFilter: cloudStack.actionFilter.guestNetwork, | ||||
| @ -7595,8 +7596,9 @@ | ||||
|                                                         //override default error handling: cloudStack.dialog.notice({ message: parseXMLHttpResponse(XMLHttpResponse)});
 | ||||
|                                                     }); | ||||
|                                                      | ||||
|                                                     //if DR module is included                                   
 | ||||
|                                                     addExtraPropertiesIfDrModuleIncluded(selectedZoneObj, "Zone"); | ||||
|                                                     if (isModuleIncluded("dr")) { | ||||
|                                                         cloudStack.dr.sharedFunctions.addExtraProperties(selectedZoneObj, "Zone"); | ||||
|                                                     } | ||||
|                                                      | ||||
|                                                     args.response.success({ | ||||
|                                                         actionFilter: zoneActionfilter, | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user