File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 560560 takeSnapshot : {
561561 label : 'label.action.take.snapshot' ,
562562 messages : {
563- confirm : function ( args ) {
564- return 'message.action.take.snapshot' ;
565- } ,
566563 notification : function ( args ) {
567564 return 'label.action.take.snapshot' ;
568565 }
569566 } ,
567+ createForm : {
568+ title : 'label.action.take.snapshot' ,
569+ desc : 'message.action.take.snapshot' ,
570+ fields : {
571+ quiescevm : {
572+ label : 'Quiesce VM' ,
573+ isBoolean : true ,
574+ isHidden : function ( args ) {
575+ var hidden = true ;
576+ $ . ajax ( {
577+ url : createURL ( 'listStoragePools&id=' + args . context . volumes [ 0 ] . storageid ) ,
578+ dataType : "json" ,
579+ async : false ,
580+ success : function ( json ) {
581+ if ( json . liststoragepoolsresponse . storagepool [ 0 ] . storagecapabilities . VOLUME_SNAPSHOT_QUIESCEVM == 'true' )
582+ hidden = false ;
583+ else
584+ hidden = true ;
585+ }
586+ } ) ;
587+
588+ return hidden ;
589+ }
590+ }
591+ }
592+ } ,
570593 action : function ( args ) {
571594 $ . ajax ( {
572- url : createURL ( "createSnapshot&volumeid=" + args . context . volumes [ 0 ] . id ) ,
595+ url : createURL ( "createSnapshot&volumeid=" + args . context . volumes [ 0 ] . id + "&quiescevm=" + args . context . quiescevm ) ,
573596 dataType : "json" ,
574597 async : true ,
575598 success : function ( json ) {
Original file line number Diff line number Diff line change 144144 if ( field . isHidden != null ) {
145145 if ( typeof ( field . isHidden ) == 'boolean' && field . isHidden == true )
146146 $formItem . hide ( ) ;
147- else if ( typeof ( field . isHidden ) == 'function' && field . isHidden ( ) == true )
147+ else if ( typeof ( field . isHidden ) == 'function' && field . isHidden ( args ) == true )
148148 $formItem . hide ( ) ;
149149 }
150150
You can’t perform that action at this time.
0 commit comments