mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
bug 11080: cloudStack - Add Primary Storage dialog - (1) add new protocol "OCFS2" to hypervisorType "OVM". (2) When "OCFS2" is selected, show/hide other fields like NFS is selected, except no server field.
This commit is contained in:
parent
55264226b8
commit
ff3316b3f9
@ -91,6 +91,7 @@
|
||||
'label.path': '<fmt:message key="label.path"/>',
|
||||
'label.SR.name': '<fmt:message key="label.SR.name"/>',
|
||||
'label.nfs': '<fmt:message key="label.nfs"/>',
|
||||
'label.ocfs2': '<fmt:message key="label.ocfs2"/>',
|
||||
'label.SharedMountPoint': '<fmt:message key="label.SharedMountPoint"/>',
|
||||
'label.PreSetup': '<fmt:message key="label.PreSetup"/>',
|
||||
'label.iscsi': '<fmt:message key="label.iscsi"/>',
|
||||
|
||||
@ -808,6 +808,8 @@ function bindAddPrimaryStorageButton($leftmenuItem1) {
|
||||
if (protocol == "nfs" || protocol == "PreSetup" || protocol == "SharedMountPoint") {
|
||||
isValid &= validateString("Server", $thisDialog.find("#add_pool_nfs_server"), $thisDialog.find("#add_pool_nfs_server_errormsg"));
|
||||
isValid &= validateString("Path", $thisDialog.find("#add_pool_path"), $thisDialog.find("#add_pool_path_errormsg"));
|
||||
} else if(protocol == "ocfs2") {
|
||||
isValid &= validateString("Path", $thisDialog.find("#add_pool_path"), $thisDialog.find("#add_pool_path_errormsg"));
|
||||
} else if(protocol == "iscsi") {
|
||||
isValid &= validateString("Server", $thisDialog.find("#add_pool_nfs_server"), $thisDialog.find("#add_pool_nfs_server_errormsg"));
|
||||
isValid &= validateString("Target IQN", $thisDialog.find("#add_pool_iqn"), $thisDialog.find("#add_pool_iqn_errormsg"));
|
||||
@ -846,7 +848,13 @@ function bindAddPrimaryStorageButton($leftmenuItem1) {
|
||||
if(path.substring(0,1)!="/")
|
||||
path = "/" + path;
|
||||
url = presetupURL(server, path);
|
||||
}
|
||||
}
|
||||
else if (protocol == "ocfs2") {
|
||||
var path = trim($thisDialog.find("#add_pool_path").val());
|
||||
if(path.substring(0,1)!="/")
|
||||
path = "/" + path;
|
||||
url = ocfs2URL(server, path);
|
||||
}
|
||||
else if (protocol == "SharedMountPoint") {
|
||||
var path = trim($thisDialog.find("#add_pool_path").val());
|
||||
if(path.substring(0,1)!="/")
|
||||
@ -1103,6 +1111,15 @@ function presetupURL(server, path) {
|
||||
return url;
|
||||
}
|
||||
|
||||
function ocfs2URL(server, path) {
|
||||
var url;
|
||||
if(server.indexOf("://")==-1)
|
||||
url = "ocfs2://" + server + path;
|
||||
else
|
||||
url = server + path;
|
||||
return url;
|
||||
}
|
||||
|
||||
function SharedMountPointURL(server, path) {
|
||||
var url;
|
||||
if(server.indexOf("://")==-1)
|
||||
|
||||
@ -1818,6 +1818,8 @@ function initAddPrimaryStorageShortcut($midmenuAddLink2, currentPageInRightPanel
|
||||
if (protocol == "nfs" || protocol == "PreSetup" || protocol == "SharedMountPoint") {
|
||||
isValid &= validateString("Server", $thisDialog.find("#add_pool_nfs_server"), $thisDialog.find("#add_pool_nfs_server_errormsg"));
|
||||
isValid &= validateString("Path", $thisDialog.find("#add_pool_path"), $thisDialog.find("#add_pool_path_errormsg"));
|
||||
} else if(protocol == "ocfs2") {
|
||||
isValid &= validateString("Path", $thisDialog.find("#add_pool_path"), $thisDialog.find("#add_pool_path_errormsg"));
|
||||
} else if(protocol == "iscsi") {
|
||||
isValid &= validateString("Server", $thisDialog.find("#add_pool_nfs_server"), $thisDialog.find("#add_pool_nfs_server_errormsg"));
|
||||
isValid &= validateString("Target IQN", $thisDialog.find("#add_pool_iqn"), $thisDialog.find("#add_pool_iqn_errormsg"));
|
||||
@ -1865,7 +1867,13 @@ function initAddPrimaryStorageShortcut($midmenuAddLink2, currentPageInRightPanel
|
||||
if(path.substring(0,1)!="/")
|
||||
path = "/" + path;
|
||||
url = presetupURL(server, path);
|
||||
}
|
||||
}
|
||||
else if (protocol == "ocfs2") {
|
||||
var path = trim($thisDialog.find("#add_pool_path").val());
|
||||
if(path.substring(0,1)!="/")
|
||||
path = "/" + path;
|
||||
url = ocfs2URL(server, path);
|
||||
}
|
||||
else if (protocol == "SharedMountPoint") {
|
||||
var path = trim($thisDialog.find("#add_pool_path").val());
|
||||
if(path.substring(0,1)!="/")
|
||||
@ -1958,7 +1966,8 @@ function bindEventHandlerToDialogAddPool($dialogAddPool) {
|
||||
else if(clusterObj.hypervisortype == "Ovm") {
|
||||
$protocolSelector.empty();
|
||||
$protocolSelector.append('<option value="nfs">' + g_dictionary["label.nfs"] + '</option>');
|
||||
}
|
||||
$protocolSelector.append('<option value="ocfs2">' + g_dictionary["label.ocfs2"] + '</option>');
|
||||
}
|
||||
else {
|
||||
$protocolSelector.empty();
|
||||
}
|
||||
@ -1976,8 +1985,17 @@ function bindEventHandlerToDialogAddPool($dialogAddPool) {
|
||||
|
||||
$dialogAddPool.find("#add_pool_nfs_server").val("");
|
||||
$dialogAddPool.find("#add_pool_server_container").show();
|
||||
}
|
||||
if($(this).val() == "PreSetup") {
|
||||
}
|
||||
else if($(this).val() == "ocfs2") {//ocfs2 is the same as nfs, except no server field.
|
||||
$('li[input_group="nfs"]', $dialogAddPool).show();
|
||||
$('li[input_group="iscsi"]', $dialogAddPool).hide();
|
||||
$('li[input_group="vmfs"]', $dialogAddPool).hide();
|
||||
$dialogAddPool.find("#add_pool_path_container").find("label").text(g_dictionary["label.path"]+":");
|
||||
|
||||
$dialogAddPool.find("#add_pool_nfs_server").val("");
|
||||
$dialogAddPool.find("#add_pool_server_container").hide();
|
||||
}
|
||||
else if($(this).val() == "PreSetup") {
|
||||
$("#add_pool_server_container", $dialogAddPool).show();
|
||||
$('li[input_group="nfs"]', $dialogAddPool).show();
|
||||
$('li[input_group="iscsi"]', $dialogAddPool).hide();
|
||||
|
||||
@ -985,6 +985,8 @@ function bindAddPrimaryStorageButtonOnZonePage($button, zoneId, zoneName) {
|
||||
if (protocol == "nfs" || protocol == "PreSetup" || protocol == "SharedMountPoint") {
|
||||
isValid &= validateString("Server", $thisDialog.find("#add_pool_nfs_server"), $thisDialog.find("#add_pool_nfs_server_errormsg"));
|
||||
isValid &= validateString("Path", $thisDialog.find("#add_pool_path"), $thisDialog.find("#add_pool_path_errormsg"));
|
||||
} else if(protocol == "ocfs2") {
|
||||
isValid &= validateString("Path", $thisDialog.find("#add_pool_path"), $thisDialog.find("#add_pool_path_errormsg"));
|
||||
} else if(protocol == "iscsi") {
|
||||
isValid &= validateString("Server", $thisDialog.find("#add_pool_nfs_server"), $thisDialog.find("#add_pool_nfs_server_errormsg"));
|
||||
isValid &= validateString("Target IQN", $thisDialog.find("#add_pool_iqn"), $thisDialog.find("#add_pool_iqn_errormsg"));
|
||||
@ -1032,6 +1034,12 @@ function bindAddPrimaryStorageButtonOnZonePage($button, zoneId, zoneName) {
|
||||
path = "/" + path;
|
||||
url = presetupURL(server, path);
|
||||
}
|
||||
else if (protocol == "ocfs2") {
|
||||
var path = trim($thisDialog.find("#add_pool_path").val());
|
||||
if(path.substring(0,1)!="/")
|
||||
path = "/" + path;
|
||||
url = ocfs2URL(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