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; |                                             jsonObj.xenserverToolsVersion61plus = false; | ||||||
|                                     } |                                     } | ||||||
|                                                                         |                                                                         | ||||||
|                                     //if DR module is included                                   
 |                                     if (isModuleIncluded("dr")) { | ||||||
|                                     addExtraPropertiesIfDrModuleIncluded(jsonObj, "UserVM"); |                                         cloudStack.dr.sharedFunctions.addExtraProperties(jsonObj, "UserVM"); | ||||||
|  |                                     }                                     | ||||||
|                                                                          |                                                                          | ||||||
|                                     args.response.success({ |                                     args.response.success({ | ||||||
|                                         actionFilter: vmActionfilter, |                                         actionFilter: vmActionfilter, | ||||||
|  | |||||||
| @ -1384,8 +1384,9 @@ | |||||||
|                                             var jsonObj = json.listnetworksresponse.network[0]; |                                             var jsonObj = json.listnetworksresponse.network[0]; | ||||||
|                                             addExtraPropertiesToGuestNetworkObject(jsonObj); |                                             addExtraPropertiesToGuestNetworkObject(jsonObj); | ||||||
|                                               |                                               | ||||||
|                                             //if DR module is included                                   
 |                                             if (isModuleIncluded("dr")) { | ||||||
|                                             addExtraPropertiesIfDrModuleIncluded(jsonObj, "Network");                                                             |                                                 cloudStack.dr.sharedFunctions.addExtraProperties(jsonObj, "Network");  | ||||||
|  |                                             } | ||||||
|                                                                                       |                                                                                       | ||||||
|                                             args.response.success({ |                                             args.response.success({ | ||||||
|                                                 actionFilter: cloudStack.actionFilter.guestNetwork, |                                                 actionFilter: cloudStack.actionFilter.guestNetwork, | ||||||
|  | |||||||
| @ -1173,32 +1173,6 @@ function listViewDataProvider(args, data, options) { | |||||||
|     return data; |     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
 | //used by infrastructure page and network page
 | ||||||
| var addExtraPropertiesToGuestNetworkObject = function(jsonObj) { | var addExtraPropertiesToGuestNetworkObject = function(jsonObj) { | ||||||
|     jsonObj.networkdomaintext = jsonObj.networkdomain; |     jsonObj.networkdomaintext = jsonObj.networkdomain; | ||||||
|  | |||||||
| @ -1502,8 +1502,9 @@ | |||||||
|                                         success: function(json) { |                                         success: function(json) { | ||||||
|                                             var jsonObj = json.listvolumesresponse.volume[0]; |                                             var jsonObj = json.listvolumesresponse.volume[0]; | ||||||
|                                              |                                              | ||||||
|                                             //if DR module is included                                   
 |                                             if (isModuleIncluded("dr")) { | ||||||
|                                             addExtraPropertiesIfDrModuleIncluded(jsonObj, "Volume"); |                                                 cloudStack.dr.sharedFunctions.addExtraProperties(jsonObj, "Volume"); | ||||||
|  |                                             }                                             | ||||||
|                                              |                                              | ||||||
|                                             args.response.success({ |                                             args.response.success({ | ||||||
|                                                 actionFilter: volumeActionfilter, |                                                 actionFilter: volumeActionfilter, | ||||||
|  | |||||||
| @ -1955,8 +1955,9 @@ | |||||||
|                                                             selectedGuestNetworkObj = json.listnetworksresponse.network[0]; |                                                             selectedGuestNetworkObj = json.listnetworksresponse.network[0]; | ||||||
|                                                             addExtraPropertiesToGuestNetworkObject(selectedGuestNetworkObj); |                                                             addExtraPropertiesToGuestNetworkObject(selectedGuestNetworkObj); | ||||||
|                                                                                                                          |                                                                                                                          | ||||||
|                                                             //if DR module is included                                   
 |                                                             if (isModuleIncluded("dr")) { | ||||||
|                                                             addExtraPropertiesIfDrModuleIncluded(selectedGuestNetworkObj, "Network");                                                             |                                                                 cloudStack.dr.sharedFunctions.addExtraProperties(selectedGuestNetworkObj, "Network");   | ||||||
|  |                                                             } | ||||||
|                                                              |                                                              | ||||||
|                                                             args.response.success({ |                                                             args.response.success({ | ||||||
|                                                                 actionFilter: cloudStack.actionFilter.guestNetwork, |                                                                 actionFilter: cloudStack.actionFilter.guestNetwork, | ||||||
| @ -7595,8 +7596,9 @@ | |||||||
|                                                         //override default error handling: cloudStack.dialog.notice({ message: parseXMLHttpResponse(XMLHttpResponse)});
 |                                                         //override default error handling: cloudStack.dialog.notice({ message: parseXMLHttpResponse(XMLHttpResponse)});
 | ||||||
|                                                     }); |                                                     }); | ||||||
|                                                      |                                                      | ||||||
|                                                     //if DR module is included                                   
 |                                                     if (isModuleIncluded("dr")) { | ||||||
|                                                     addExtraPropertiesIfDrModuleIncluded(selectedZoneObj, "Zone"); |                                                         cloudStack.dr.sharedFunctions.addExtraProperties(selectedZoneObj, "Zone"); | ||||||
|  |                                                     } | ||||||
|                                                      |                                                      | ||||||
|                                                     args.response.success({ |                                                     args.response.success({ | ||||||
|                                                         actionFilter: zoneActionfilter, |                                                         actionFilter: zoneActionfilter, | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user