File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 168168 expires : 1
169169 } ) ;
170170
171+ g_KVMsnapshotenabled = json . listcapabilitiesresponse . capability . KVMsnapshotenabled ; //boolean
172+ $ . cookie ( 'KVMsnapshotenabled' , g_KVMsnapshotenabled , {
173+ expires : 1
174+ } ) ;
175+
171176 if ( json . listcapabilitiesresponse . capability . userpublictemplateenabled != null ) {
172177 g_userPublicTemplateEnabled = json . listcapabilitiesresponse . capability . userpublictemplateenabled . toString ( ) ; //convert boolean to string if it's boolean
173178 $ . cookie ( 'userpublictemplateenabled' , g_userPublicTemplateEnabled , {
332337 expires : 1
333338 } ) ;
334339
340+ g_KVMsnapshotenabled = json . listcapabilitiesresponse . capability . KVMsnapshotenabled ; //boolean
341+ $ . cookie ( 'KVMsnapshotenabled' , g_KVMsnapshotenabled , {
342+ expires : 1
343+ } ) ;
344+
335345 if ( json . listcapabilitiesresponse . capability . userpublictemplateenabled != null ) {
336346 g_userPublicTemplateEnabled = json . listcapabilitiesresponse . capability . userpublictemplateenabled . toString ( ) ; //convert boolean to string if it's boolean
337347 $ . cookie ( 'userpublictemplateenabled' , g_userPublicTemplateEnabled , {
432442 g_timezoneoffset = null ;
433443 g_timezone = null ;
434444 g_supportELB = null ;
445+ g_KVMsnapshotenabled = null ;
435446 g_loginCmdText = null ;
436447
437448 $ . cookie ( 'JSESSIONID' , null ) ;
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ var g_enableLogging = false;
2525var g_timezoneoffset = null ;
2626var g_timezone = null ;
2727var g_supportELB = null ;
28+ var g_KVMsnapshotenabled = null ;
2829var g_userPublicTemplateEnabled = "true" ;
2930var g_cloudstackversion = null ;
3031var g_queryAsyncJobResultInterval = 3000 ;
Original file line number Diff line number Diff line change 18651865 }
18661866
18671867 if ( jsonObj . hypervisor != "Ovm" && jsonObj . state == "Ready" ) {
1868- allowedActions . push ( "takeSnapshot" ) ;
1869- allowedActions . push ( "recurringSnapshot" ) ;
1868+ if ( jsonObj . hypervisor != 'KVM'
1869+ || ( jsonObj . hypervisor == 'KVM' && g_KVMsnapshotenabled == true ) ) {
1870+ allowedActions . push ( "takeSnapshot" ) ;
1871+ allowedActions . push ( "recurringSnapshot" ) ;
1872+ }
1873+
18701874 if ( jsonObj . type == "DATADISK" ) {
18711875 allowedActions . push ( "resize" ) ;
18721876 }
You can’t perform that action at this time.
0 commit comments