File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 541541 dataType : "json" ,
542542 success : function ( json ) {
543543 var jid = json . deployvirtualmachineresponse . jobid ;
544- var vmid = json . deployvirtualmachineresponse . id ;
544+ var vmid = json . deployvirtualmachineresponse . id ;
545545 args . response . success (
546546 { _custom :
547547 { jobId : jid ,
554554 getActionFilter : function ( ) {
555555 return vmActionfilter ;
556556 } ,
557- getUpdatedData : function ( ) {
558- var item ;
559- $ . ajax ( {
560- url : createURL ( "listVirtualMachines&id=" + vmid ) ,
561- dataType : "json" ,
562- async : false ,
563- success : function ( json ) {
564- item = json . listvirtualmachinesresponse . virtualmachine [ 0 ] ;
565- }
566- } ) ;
567- return item ;
568- }
557+ getUpdatedItemWhenAsyncJobFails : function ( ) {
558+ var item ;
559+ $ . ajax ( {
560+ url : createURL ( "listVirtualMachines&id=" + vmid ) ,
561+ dataType : "json" ,
562+ async : false ,
563+ success : function ( json ) {
564+ item = json . listvirtualmachinesresponse . virtualmachine [ 0 ] ;
565+ }
566+ } ) ;
567+ return item ;
568+ }
569569 }
570570 }
571571 ) ;
Original file line number Diff line number Diff line change @@ -86,14 +86,14 @@ var pollAsyncJobResult = function(args) {
8686 }
8787 else if ( result . jobstatus == 2 ) { // Failed
8888 var msg = ( result . jobresult . errortext == null ) ? "" : result . jobresult . errortext ;
89- if ( args . _custom . getUpdatedData != null && args . _custom . getActionFilter != null ) {
90- args . error ( { message : msg , updatedData : args . _custom . getUpdatedData ( ) , actionFilter : args . _custom . getActionFilter ( ) } ) ;
91- } else if ( args . _custom . getUpdatedData != null && args . _custom . getActionFilter == null ) {
92- args . error ( { message : msg , updatedData : args . _custom . getUpdatedData ( ) } ) ;
93- }
94- else {
95- args . error ( { message : msg } ) ;
96- }
89+ if ( args . _custom . getUpdatedItemWhenAsyncJobFails != null && args . _custom . getActionFilter != null ) {
90+ args . error ( { message : msg , updatedData : args . _custom . getUpdatedItemWhenAsyncJobFails ( ) , actionFilter : args . _custom . getActionFilter ( ) } ) ;
91+ } else if ( args . _custom . getUpdatedItemWhenAsyncJobFails != null && args . _custom . getActionFilter == null ) {
92+ args . error ( { message : msg , updatedData : args . _custom . getUpdatedItemWhenAsyncJobFails ( ) } ) ;
93+ }
94+ else {
95+ args . error ( { message : msg } ) ;
96+ }
9797 }
9898 }
9999 } ,
Original file line number Diff line number Diff line change 9797
9898 // Error
9999 function ( args ) {
100- if ( args && args . updatedData ) {
101- if ( $item . is ( ':visible' ) && ! isHeader ) {
102- replaceItem (
103- $item ,
104- args . updatedData ,
105- args . actionFilter
106- ) ;
107- }
108- } else {
109- $item . remove ( ) ;
110- }
100+ if ( args && args . updatedData ) {
101+ if ( $item . is ( ':visible' ) && ! isHeader ) {
102+ replaceItem (
103+ $item ,
104+ args . updatedData ,
105+ args . actionFilter
106+ ) ;
107+ }
108+ } else {
109+ $item . remove ( ) ;
110+ }
111111 }
112112 ) ;
113113 }
You can’t perform that action at this time.
0 commit comments