File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 141141 {
142142 id : { label : 'ID' } ,
143143 accountTotal : { label : 'Accounts' } ,
144- instances : { label : 'Instances' } ,
145- volumes : { label : 'Volumes' }
144+ vmTotal : { label : 'Instances' } ,
145+ volumeTotal : { label : 'Volumes' }
146146 }
147147 ] ,
148148 dataProvider : function ( args ) {
152152 async : false ,
153153 dataType : "json" ,
154154 success : function ( json ) {
155- var accounts = json . listaccountsresponse . account ;
156- var accountTotal ;
157- if ( accounts != null )
158- accountTotal = accounts . length ;
155+ var items = json . listaccountsresponse . account ;
156+ var total ;
157+ if ( items != null )
158+ total = items . length ;
159159 else
160- accountTotal = 0 ;
161- domainObj [ "accountTotal" ] = accountTotal ;
160+ total = 0 ;
161+ domainObj [ "accountTotal" ] = total ;
162162 }
163163 } ) ;
164-
164+
165+ $ . ajax ( {
166+ url : createURL ( "listVirtualMachines&domainid=" + domainObj . id ) ,
167+ async : false ,
168+ dataType : "json" ,
169+ success : function ( json ) {
170+ var items = json . listvirtualmachinesresponse . virtualmachine ;
171+ var total ;
172+ if ( items != null )
173+ total = items . length ;
174+ else
175+ total = 0 ;
176+ domainObj [ "vmTotal" ] = total ;
177+ }
178+ } ) ;
179+
180+ $ . ajax ( {
181+ url : createURL ( "listVolumes&domainid=" + domainObj . id ) ,
182+ async : false ,
183+ dataType : "json" ,
184+ success : function ( json ) {
185+ var items = json . listvolumesresponse . volume ;
186+ var total ;
187+ if ( items != null )
188+ total = items . length ;
189+ else
190+ total = 0 ;
191+ domainObj [ "volumeTotal" ] = total ;
192+ }
193+ } ) ;
194+
165195 args . response . success ( {
166196 data : domainObj
167197 } ) ;
You can’t perform that action at this time.
0 commit comments