mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Add Primary Storage dialog - When protocol is PreSetup, compose URL as "presetup://~~~~~~~".
This commit is contained in:
parent
41a1e2cd9e
commit
ec6aa13c74
@ -726,12 +726,18 @@ function bindAddPrimaryStorageButton($leftmenuItem1) {
|
||||
var server = trim($thisDialog.find("#add_pool_nfs_server").val());
|
||||
|
||||
var url = null;
|
||||
if (protocol == "nfs" || protocol == "PreSetup") {
|
||||
if (protocol == "nfs") {
|
||||
var path = trim($thisDialog.find("#add_pool_path").val());
|
||||
if(path.substring(0,1)!="/")
|
||||
path = "/" + path;
|
||||
url = nfsURL(server, path);
|
||||
}
|
||||
}
|
||||
else if (protocol == "PreSetup") {
|
||||
var path = trim($thisDialog.find("#add_pool_path").val());
|
||||
if(path.substring(0,1)!="/")
|
||||
path = "/" + path;
|
||||
url = presetupURL(server, path);
|
||||
}
|
||||
else if (protocol == "sharedMountPoint") {
|
||||
var path = trim($thisDialog.find("#add_pool_path").val());
|
||||
if(path.substring(0,1)!="/")
|
||||
@ -877,6 +883,15 @@ function nfsURL(server, path) {
|
||||
return url;
|
||||
}
|
||||
|
||||
function presetupURL(server, path) {
|
||||
var url;
|
||||
if(server.indexOf("://")==-1)
|
||||
url = "presetup://" + server + path;
|
||||
else
|
||||
url = server + path;
|
||||
return url;
|
||||
}
|
||||
|
||||
function sharedMountPointURL(server, path) {
|
||||
var url;
|
||||
if(server.indexOf("://")==-1)
|
||||
|
||||
@ -1783,12 +1783,18 @@ function initAddPrimaryStorageShortcut($midmenuAddLink2, currentPageInRightPanel
|
||||
var server = trim($thisDialog.find("#add_pool_nfs_server").val());
|
||||
|
||||
var url = null;
|
||||
if (protocol == "nfs" || protocol == "PreSetup") {
|
||||
if (protocol == "nfs") {
|
||||
var path = trim($thisDialog.find("#add_pool_path").val());
|
||||
if(path.substring(0,1)!="/")
|
||||
path = "/" + path;
|
||||
url = nfsURL(server, path);
|
||||
}
|
||||
else if (protocol == "PreSetup") {
|
||||
var path = trim($thisDialog.find("#add_pool_path").val());
|
||||
if(path.substring(0,1)!="/")
|
||||
path = "/" + path;
|
||||
url = presetupURL(server, path);
|
||||
}
|
||||
else if (protocol == "sharedMountPoint") {
|
||||
var path = trim($thisDialog.find("#add_pool_path").val());
|
||||
if(path.substring(0,1)!="/")
|
||||
|
||||
@ -943,12 +943,18 @@ function bindAddPrimaryStorageButtonOnZonePage($button, zoneId, zoneName) {
|
||||
var server = trim($thisDialog.find("#add_pool_nfs_server").val());
|
||||
|
||||
var url = null;
|
||||
if (protocol == "nfs" || protocol == "PreSetup") {
|
||||
if (protocol == "nfs") {
|
||||
var path = trim($thisDialog.find("#add_pool_path").val());
|
||||
if(path.substring(0,1)!="/")
|
||||
path = "/" + path;
|
||||
url = nfsURL(server, path);
|
||||
}
|
||||
else if (protocol == "PreSetup") {
|
||||
var path = trim($thisDialog.find("#add_pool_path").val());
|
||||
if(path.substring(0,1)!="/")
|
||||
path = "/" + path;
|
||||
url = presetupURL(server, path);
|
||||
}
|
||||
else if (protocol == "sharedMountPoint") {
|
||||
var path = trim($thisDialog.find("#add_pool_path").val());
|
||||
if(path.substring(0,1)!="/")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user