mirror of
				https://github.com/apache/cloudstack.git
				synced 2025-11-04 00:02:37 +01:00 
			
		
		
		
	CLOUDSTACK-3700: The dedication process should be listed as a step through zone wizard
This commit is contained in:
		
							parent
							
								
									cc99a83d71
								
							
						
					
					
						commit
						06d897498b
					
				@ -1343,6 +1343,7 @@ message.creating.primary.storage=Creating primary storage
 | 
			
		||||
message.creating.secondary.storage=Creating secondary storage
 | 
			
		||||
message.creating.zone=Creating zone
 | 
			
		||||
message.decline.invitation=Are you sure you want to decline this project invitation?
 | 
			
		||||
message.dedicate.zone=Dedicating zone
 | 
			
		||||
message.delete.account=Please confirm that you want to delete this account.
 | 
			
		||||
message.delete.affinity.group=Please confirm that you would like to remove this affinity group.
 | 
			
		||||
message.delete.gateway=Please confirm you want to delete the gateway
 | 
			
		||||
 | 
			
		||||
@ -1310,6 +1310,7 @@ dictionary = {
 | 
			
		||||
'message.creating.secondary.storage': '<fmt:message key="message.creating.secondary.storage" />',
 | 
			
		||||
'message.creating.zone': '<fmt:message key="message.creating.zone" />',
 | 
			
		||||
'message.decline.invitation': '<fmt:message key="message.decline.invitation" />',
 | 
			
		||||
'message.dedicate.zone': '<fmt:message key="message.dedicate.zone" />',
 | 
			
		||||
'message.delete.account': '<fmt:message key="message.delete.account" />',
 | 
			
		||||
'message.delete.affinity.group': '<fmt:message key="message.delete.affinity.group" />',
 | 
			
		||||
'message.delete.gateway': '<fmt:message key="message.delete.gateway" />',
 | 
			
		||||
 | 
			
		||||
@ -2099,33 +2099,33 @@
 | 
			
		||||
                                })
 | 
			
		||||
                            });
 | 
			
		||||
 | 
			
		||||
                            dedicatedZoneId = json.createzoneresponse.zone.id;
 | 
			
		||||
                            //EXPLICIT ZONE DEDICATION
 | 
			
		||||
                            if (args.data.pluginFrom == null && args.data.zone.ispublic != null) {
 | 
			
		||||
                                var array2 = [];
 | 
			
		||||
                                if (args.data.zone.domain != null)
 | 
			
		||||
                                    array2.push("&domainid=" + args.data.zone.domain);
 | 
			
		||||
                                if (args.data.zone.accountId != "")
 | 
			
		||||
                                    array2.push("&account=" + todb(args.data.zone.accountId));
 | 
			
		||||
                            // dedicatedZoneId = json.createzoneresponse.zone.id;
 | 
			
		||||
                            // //EXPLICIT ZONE DEDICATION
 | 
			
		||||
                            // if (args.data.pluginFrom == null && args.data.zone.ispublic != null) {
 | 
			
		||||
                            //     var array2 = [];
 | 
			
		||||
                            //     if (args.data.zone.domain != null)
 | 
			
		||||
                            //         array2.push("&domainid=" + args.data.zone.domain);
 | 
			
		||||
                            //     if (args.data.zone.accountId != "")
 | 
			
		||||
                            //         array2.push("&account=" + todb(args.data.zone.accountId));
 | 
			
		||||
 | 
			
		||||
                                if (dedicatedZoneId != null) {
 | 
			
		||||
                                    $.ajax({
 | 
			
		||||
                                        url: createURL("dedicateZone&ZoneId=" + dedicatedZoneId + array2.join("")),
 | 
			
		||||
                                        dataType: "json",
 | 
			
		||||
                                        success: function(json) {
 | 
			
		||||
                                            var dedicatedObj = json.dedicatezoneresponse.jobid;
 | 
			
		||||
                                            //args.response.success({ data: $.extend(item, dedicatedObj)});
 | 
			
		||||
                            //     if (dedicatedZoneId != null) {
 | 
			
		||||
                            //         $.ajax({
 | 
			
		||||
                            //             url: createURL("dedicateZone&ZoneId=" + dedicatedZoneId + array2.join("")),
 | 
			
		||||
                            //             dataType: "json",
 | 
			
		||||
                            //             success: function(json) {
 | 
			
		||||
                            //                 var dedicatedObj = json.dedicatezoneresponse.jobid;
 | 
			
		||||
                            //                 //args.response.success({ data: $.extend(item, dedicatedObj)});
 | 
			
		||||
 | 
			
		||||
                                        },
 | 
			
		||||
                            //             },
 | 
			
		||||
 | 
			
		||||
                                        error: function(json) {
 | 
			
		||||
                            //             error: function(json) {
 | 
			
		||||
 | 
			
		||||
                                            args.response.error(parseXMLHttpResponse(XMLHttpResponse));
 | 
			
		||||
                                        }
 | 
			
		||||
                                    });
 | 
			
		||||
                            //                 args.response.error(parseXMLHttpResponse(XMLHttpResponse));
 | 
			
		||||
                            //             }
 | 
			
		||||
                            //         });
 | 
			
		||||
 | 
			
		||||
                                }
 | 
			
		||||
                            }
 | 
			
		||||
                            //     }
 | 
			
		||||
                            // }
 | 
			
		||||
 | 
			
		||||
                        },
 | 
			
		||||
                        error: function(XMLHttpResponse) {
 | 
			
		||||
@ -4027,10 +4027,21 @@
 | 
			
		||||
                },
 | 
			
		||||
 | 
			
		||||
                addSecondaryStorage: function(args) {
 | 
			
		||||
 | 
			
		||||
                    var dedicatedZone = (args.data.pluginFrom == null && args.data.zone.ispublic != null);
 | 
			
		||||
 | 
			
		||||
                	if (args.data.secondaryStorage.provider == '') {
 | 
			
		||||
                		 complete({
 | 
			
		||||
 | 
			
		||||
                        if (dedicatedZone) {
 | 
			
		||||
                            stepFns.dedicateZone({
 | 
			
		||||
                                data: args.data
 | 
			
		||||
                            });
 | 
			
		||||
                        } else {
 | 
			
		||||
                            complete({
 | 
			
		||||
                                data: args.data
 | 
			
		||||
                            })
 | 
			
		||||
                        }
 | 
			
		||||
 | 
			
		||||
                        return; //skip addSecondaryStorage if provider dropdown is blank
 | 
			
		||||
                	}
 | 
			
		||||
                	
 | 
			
		||||
@ -4059,11 +4070,21 @@
 | 
			
		||||
                            url: createURL('addImageStore'),
 | 
			
		||||
                            data: data,
 | 
			
		||||
                            success: function(json) {
 | 
			
		||||
                                
 | 
			
		||||
                                if (dedicatedZone) {
 | 
			
		||||
                                    stepFns.dedicateZone({
 | 
			
		||||
                                        data: $.extend(args.data, {                                               
 | 
			
		||||
                                            returnedSecondaryStorage: json.addimagestoreresponse.secondarystorage
 | 
			
		||||
                                        })
 | 
			
		||||
                                    })
 | 
			
		||||
                                } else {
 | 
			
		||||
                                    complete({
 | 
			
		||||
                                        data: $.extend(args.data, {
 | 
			
		||||
                                            returnedSecondaryStorage: json.addimagestoreresponse.secondarystorage
 | 
			
		||||
                                        })
 | 
			
		||||
                                    });
 | 
			
		||||
                                }
 | 
			
		||||
 | 
			
		||||
                            },
 | 
			
		||||
                            error: function(XMLHttpResponse) {
 | 
			
		||||
                                var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
 | 
			
		||||
@ -4111,11 +4132,20 @@
 | 
			
		||||
                            url: createURL('addImageStore'),
 | 
			
		||||
                            data: data,
 | 
			
		||||
                            success: function(json) {
 | 
			
		||||
                                if (dedicatedZone) {
 | 
			
		||||
                                    stepFns.dedicateZone({
 | 
			
		||||
                                        data: $.extend(args.data, {                                               
 | 
			
		||||
                                            returnedSecondaryStorage: json.addimagestoreresponse.secondarystorage
 | 
			
		||||
                                        })
 | 
			
		||||
                                    })
 | 
			
		||||
                                } else {
 | 
			
		||||
                                    complete({
 | 
			
		||||
                                        data: $.extend(args.data, {
 | 
			
		||||
                                            returnedSecondaryStorage: json.addimagestoreresponse.secondarystorage
 | 
			
		||||
                                        })
 | 
			
		||||
                                    });
 | 
			
		||||
                                }
 | 
			
		||||
                                
 | 
			
		||||
                            },
 | 
			
		||||
                            error: function(XMLHttpResponse) {
 | 
			
		||||
                                var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
 | 
			
		||||
@ -4179,11 +4209,19 @@
 | 
			
		||||
                            url: createURL('addImageStore'),
 | 
			
		||||
                            data: data,
 | 
			
		||||
                            success: function(json) {
 | 
			
		||||
                                if (dedicatedZone) {
 | 
			
		||||
                                    stepFns.dedicateZone({
 | 
			
		||||
                                        data: $.extend(args.data, {                                               
 | 
			
		||||
                                            returnedSecondaryStorage: json.addimagestoreresponse.secondarystorage
 | 
			
		||||
                                        })
 | 
			
		||||
                                    })
 | 
			
		||||
                                } else {
 | 
			
		||||
                                    complete({
 | 
			
		||||
                                        data: $.extend(args.data, {
 | 
			
		||||
                                            returnedSecondaryStorage: json.addimagestoreresponse.secondarystorage
 | 
			
		||||
                                        })
 | 
			
		||||
                                    });
 | 
			
		||||
                                }
 | 
			
		||||
                            },
 | 
			
		||||
                            error: function(XMLHttpResponse) {
 | 
			
		||||
                                var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
 | 
			
		||||
@ -4194,6 +4232,61 @@
 | 
			
		||||
                            }
 | 
			
		||||
                        });
 | 
			
		||||
                    }
 | 
			
		||||
                },
 | 
			
		||||
                dedicateZone: function(args) {
 | 
			
		||||
 | 
			
		||||
                    if(args.data.pluginFrom == null && args.data.zone.ispublic != null) {
 | 
			
		||||
                        var dedicatedZoneId = args.data.returnedZone.id;
 | 
			
		||||
                	    message(dictionary['message.dedicate.zone']);
 | 
			
		||||
 | 
			
		||||
                        var array2 = [];
 | 
			
		||||
                        if (args.data.zone.domain != null)
 | 
			
		||||
                            array2.push("&domainid=" + args.data.zone.domain);
 | 
			
		||||
                        if (args.data.zone.accountId != "")
 | 
			
		||||
                            array2.push("&account=" + todb(args.data.zone.accountId));
 | 
			
		||||
 | 
			
		||||
                        if (dedicatedZoneId != null) {
 | 
			
		||||
                            $.ajax({
 | 
			
		||||
                                url: createURL("dedicateZone&ZoneId=" + dedicatedZoneId + array2.join("")),
 | 
			
		||||
                                dataType: "json",
 | 
			
		||||
                                success: function(json) {
 | 
			
		||||
                                    var jobId = json.dedicatezoneresponse.jobid;
 | 
			
		||||
                                    var dedicatedZoneIntervalId = setInterval(function() {
 | 
			
		||||
                                        $.ajax({
 | 
			
		||||
                                            url: createURL("queryAsyncJobResult&jobid=" + jobId),
 | 
			
		||||
                                            dataType: "json",
 | 
			
		||||
                                            success: function(json) {
 | 
			
		||||
                                                if (json.queryasyncjobresultresponse.jobstatus == 0) { // not complete
 | 
			
		||||
                                                    return;
 | 
			
		||||
                                                } else {
 | 
			
		||||
                                                    clearInterval(dedicatedZoneIntervalId);
 | 
			
		||||
                                                    if(json.queryasyncjobresultresponse.jobstatus == 1) { // successed
 | 
			
		||||
                                                        complete({
 | 
			
		||||
                                                            data: $.extend(args.data, {
 | 
			
		||||
                                                                returnedDedicateZone: json.queryasyncjobresultresponse.jobresult
 | 
			
		||||
                                                            })
 | 
			
		||||
                                                        });
 | 
			
		||||
                                                    } else if(json.queryasyncjobresultresponse.jobstatus == 2) { // failed
 | 
			
		||||
                                                        error('addZone', json.queryasyncjobresultresponse.jobresult.errortext, {
 | 
			
		||||
                                                            fn: 'dedicateZone',
 | 
			
		||||
                                                            args: args
 | 
			
		||||
                                                        })
 | 
			
		||||
                                                    }
 | 
			
		||||
                                                }
 | 
			
		||||
                                                
 | 
			
		||||
                                            }
 | 
			
		||||
                                        });
 | 
			
		||||
                                    }, g_queryAsyncJobResultInterval);
 | 
			
		||||
                                }
 | 
			
		||||
                            });
 | 
			
		||||
 | 
			
		||||
                        }
 | 
			
		||||
                    } else {
 | 
			
		||||
                        complete({
 | 
			
		||||
                            data: args.data
 | 
			
		||||
                        });
 | 
			
		||||
                    }
 | 
			
		||||
                    
 | 
			
		||||
                }
 | 
			
		||||
            };
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user