From 0d7d345339a9b3c034de9b979c3a33a3301cb8e5 Mon Sep 17 00:00:00 2001 From: Isaac Chiang Date: Fri, 5 Jul 2013 18:21:34 +0800 Subject: [PATCH] CLOUDSTACK-3230: UI add cluster remains in processing state --- ui/scripts/system.js | 48 ++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/ui/scripts/system.js b/ui/scripts/system.js index 70b4f8d6195..dd971edbb5f 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -10373,36 +10373,36 @@ //EXPLICIT DEDICATION var array2 = []; - if(args.$form.find('.form-item[rel=isDedicated]').find('input[type=checkbox]').is(':Checked')== true){ + if(args.$form.find('.form-item[rel=isDedicated]').find('input[type=checkbox]').is(':Checked')== true) { if(args.data.accountId != "") array2.push("&account=" +todb(args.data.accountId)); + if(clusterId != null){ + $.ajax({ + url:createURL("dedicateCluster&clusterId=" +clusterId +"&domainId=" +args.data.domainId + array2.join("")), + dataType:"json", + success:function(json){ + var jid = json.dedicateclusterresponse.jobid; + args.response.success({ + _custom: + { jobId: jid + }, + notification: { + poll: pollAsyncJobResult + }, - if(clusterId != null){ - $.ajax({ - url:createURL("dedicateCluster&clusterId=" +clusterId +"&domainId=" +args.data.domainId + array2.join("")), - dataType:"json", - success:function(json){ - var jid = json.dedicateclusterresponse.jobid; - args.response.success({ - _custom: - { jobId: jid - }, - notification: { - poll: pollAsyncJobResult - }, + data:$.extend(item, {state:'Enabled'}) + }); - data:$.extend(item, {state:'Enabled'}) - }); - - }, - - error:function(json){ - args.response.error(parseXMLHttpResponse(XMLHttpResponse)); - } - }); + }, + error:function(json){ + args.response.error(parseXMLHttpResponse(XMLHttpResponse)); + } + }); + } + } else { + args.response.success({data: item}); } - } }, error: function(XMLHttpResponse) { var errorMsg = parseXMLHttpResponse(XMLHttpResponse);