mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-4308: UI > volume page > if hypervisor is KVM, show/hide takeSnapshot, recurringSnapshot action upon KVMsnapshotenabled property returned by listCapabilities API.
This commit is contained in:
parent
53d09c6f18
commit
aa223e5786
@ -168,6 +168,11 @@
|
|||||||
expires: 1
|
expires: 1
|
||||||
});
|
});
|
||||||
|
|
||||||
|
g_KVMsnapshotenabled = json.listcapabilitiesresponse.capability.KVMsnapshotenabled; //boolean
|
||||||
|
$.cookie('KVMsnapshotenabled', g_KVMsnapshotenabled, {
|
||||||
|
expires: 1
|
||||||
|
});
|
||||||
|
|
||||||
if (json.listcapabilitiesresponse.capability.userpublictemplateenabled != null) {
|
if (json.listcapabilitiesresponse.capability.userpublictemplateenabled != null) {
|
||||||
g_userPublicTemplateEnabled = json.listcapabilitiesresponse.capability.userpublictemplateenabled.toString(); //convert boolean to string if it's boolean
|
g_userPublicTemplateEnabled = json.listcapabilitiesresponse.capability.userpublictemplateenabled.toString(); //convert boolean to string if it's boolean
|
||||||
$.cookie('userpublictemplateenabled', g_userPublicTemplateEnabled, {
|
$.cookie('userpublictemplateenabled', g_userPublicTemplateEnabled, {
|
||||||
@ -332,6 +337,11 @@
|
|||||||
expires: 1
|
expires: 1
|
||||||
});
|
});
|
||||||
|
|
||||||
|
g_KVMsnapshotenabled = json.listcapabilitiesresponse.capability.KVMsnapshotenabled; //boolean
|
||||||
|
$.cookie('KVMsnapshotenabled', g_KVMsnapshotenabled, {
|
||||||
|
expires: 1
|
||||||
|
});
|
||||||
|
|
||||||
if (json.listcapabilitiesresponse.capability.userpublictemplateenabled != null) {
|
if (json.listcapabilitiesresponse.capability.userpublictemplateenabled != null) {
|
||||||
g_userPublicTemplateEnabled = json.listcapabilitiesresponse.capability.userpublictemplateenabled.toString(); //convert boolean to string if it's boolean
|
g_userPublicTemplateEnabled = json.listcapabilitiesresponse.capability.userpublictemplateenabled.toString(); //convert boolean to string if it's boolean
|
||||||
$.cookie('userpublictemplateenabled', g_userPublicTemplateEnabled, {
|
$.cookie('userpublictemplateenabled', g_userPublicTemplateEnabled, {
|
||||||
@ -432,6 +442,7 @@
|
|||||||
g_timezoneoffset = null;
|
g_timezoneoffset = null;
|
||||||
g_timezone = null;
|
g_timezone = null;
|
||||||
g_supportELB = null;
|
g_supportELB = null;
|
||||||
|
g_KVMsnapshotenabled = null;
|
||||||
g_loginCmdText = null;
|
g_loginCmdText = null;
|
||||||
|
|
||||||
$.cookie('JSESSIONID', null);
|
$.cookie('JSESSIONID', null);
|
||||||
|
|||||||
@ -25,6 +25,7 @@ var g_enableLogging = false;
|
|||||||
var g_timezoneoffset = null;
|
var g_timezoneoffset = null;
|
||||||
var g_timezone = null;
|
var g_timezone = null;
|
||||||
var g_supportELB = null;
|
var g_supportELB = null;
|
||||||
|
var g_KVMsnapshotenabled = null;
|
||||||
var g_userPublicTemplateEnabled = "true";
|
var g_userPublicTemplateEnabled = "true";
|
||||||
var g_cloudstackversion = null;
|
var g_cloudstackversion = null;
|
||||||
var g_queryAsyncJobResultInterval = 3000;
|
var g_queryAsyncJobResultInterval = 3000;
|
||||||
|
|||||||
@ -1865,8 +1865,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (jsonObj.hypervisor != "Ovm" && jsonObj.state == "Ready") {
|
if (jsonObj.hypervisor != "Ovm" && jsonObj.state == "Ready") {
|
||||||
allowedActions.push("takeSnapshot");
|
if(jsonObj.hypervisor != 'KVM'
|
||||||
allowedActions.push("recurringSnapshot");
|
|| (jsonObj.hypervisor == 'KVM' && g_KVMsnapshotenabled == true) ) {
|
||||||
|
allowedActions.push("takeSnapshot");
|
||||||
|
allowedActions.push("recurringSnapshot");
|
||||||
|
}
|
||||||
|
|
||||||
if (jsonObj.type == "DATADISK") {
|
if (jsonObj.type == "DATADISK") {
|
||||||
allowedActions.push("resize");
|
allowedActions.push("resize");
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user