You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by mt...@apache.org on 2014/06/27 07:49:38 UTC
git commit: updated refs/heads/master to 9a27f20
Repository: cloudstack
Updated Branches:
refs/heads/master 5c36fe84b -> 9a27f201b
Enable primary storage to be added that is based on non-default storage plug-ins
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/9a27f201
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/9a27f201
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/9a27f201
Branch: refs/heads/master
Commit: 9a27f201b02fe33cdba1dcca7da63497b323a874
Parents: 5c36fe8
Author: seif <se...@gmail.com>
Authored: Mon Jun 23 00:37:44 2014 +0200
Committer: Mike Tutkowski <mi...@solidfire.com>
Committed: Thu Jun 26 23:49:23 2014 -0600
----------------------------------------------------------------------
.../classes/resources/messages.properties | 5 +-
ui/dictionary.jsp | 3 +
ui/scripts/docs.js | 23 ++
ui/scripts/system.js | 275 ++++++++++++++-----
4 files changed, 238 insertions(+), 68 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9a27f201/client/WEB-INF/classes/resources/messages.properties
----------------------------------------------------------------------
diff --git a/client/WEB-INF/classes/resources/messages.properties b/client/WEB-INF/classes/resources/messages.properties
index b504a18..b192cb0 100644
--- a/client/WEB-INF/classes/resources/messages.properties
+++ b/client/WEB-INF/classes/resources/messages.properties
@@ -425,6 +425,8 @@ label.bytes.received=Bytes Received
label.bytes.sent=Bytes Sent
label.cancel=Cancel
label.capacity=Capacity
+label.capacity.bytes=Capacity Bytes
+label.capacity.iops=Capacity IOPS
label.certificate=Certificate
label.change.service.offering=Change service offering
label.change.value=Change value
@@ -747,6 +749,7 @@ label.lun=LUN
label.make.project.owner=Make account project owner
label.manage.resources=Manage Resources
label.manage=Manage
+label.managed=Managed
label.management.ips=Management IP Addresses
label.management=Management
label.max.cpus=Max. CPU cores
@@ -1076,7 +1079,7 @@ label.source=Source
label.specify.IP.ranges=Specify IP ranges
label.specify.vlan=Specify VLAN
label.specify.vxlan=Specify VXLAN
-label.SR.name = SR Name-Label
+label.SR.name=SR Name-Label
label.srx=SRX
label.PA=Palo Alto
label.start.IP=Start IP
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9a27f201/ui/dictionary.jsp
----------------------------------------------------------------------
diff --git a/ui/dictionary.jsp b/ui/dictionary.jsp
index 9026a36..24d6345 100644
--- a/ui/dictionary.jsp
+++ b/ui/dictionary.jsp
@@ -76,6 +76,8 @@ dictionary = {
'label.hypervisor.snapshot.reserve': '<fmt:message key="label.hypervisor.snapshot.reserve" />',
'label.acquire.new.secondary.ip': '<fmt:message key="label.acquire.new.secondary.ip" />',
'label.view.secondary.ips': '<fmt:message key="label.view.secondary.ips" />',
+'label.capacity.bytes': '<fmt:message key="label.capacity.bytes" />',
+'label.capacity.iops': '<fmt:message key="label.capacity.iops" />',
'message.acquire.ip.nic': '<fmt:message key="message.acquire.ip.nic" />',
'message.select.affinity.groups': '<fmt:message key="message.select.affinity.groups" />',
'message.no.affinity.groups': '<fmt:message key="message.no.affinity.groups" />',
@@ -736,6 +738,7 @@ dictionary = {
'label.LUN.number': '<fmt:message key="label.LUN.number" />',
'label.make.project.owner': '<fmt:message key="label.make.project.owner" />',
'label.manage': '<fmt:message key="label.manage" />',
+'label.managed': '<fmt:message key="label.managed" />',
'label.management': '<fmt:message key="label.management" />',
'label.management.ips': '<fmt:message key="label.management.ips" />',
'label.max.cpus': '<fmt:message key="label.max.cpus" />',
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9a27f201/ui/scripts/docs.js
----------------------------------------------------------------------
diff --git a/ui/scripts/docs.js b/ui/scripts/docs.js
index aad358b..74a08bc 100755
--- a/ui/scripts/docs.js
+++ b/ui/scripts/docs.js
@@ -85,6 +85,29 @@ cloudStack.docs = {
externalLink: ''
},
+ helpManaged: {
+
+ desc: 'True if CloudStack manages the storage; else, false (check with storage provider if unknown)',
+ externalLink: ''
+ },
+
+ helpCapacityBytes: {
+
+ desc: 'Number of bytes for the primary storage to have',
+ externalLink: ''
+ },
+
+ helpCapacityIops: {
+
+ desc: 'Number of IOPS for the primary storage to have',
+ externalLink: ''
+ },
+
+ helpUrl: {
+
+ desc: 'Arbitrary data to be sent to the storage provider for configuration purposes',
+ externalLink: ''
+ },
//Ldap
helpLdapQueryFilter: {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9a27f201/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index 00ca1d4..c5aea92 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -15294,7 +15294,10 @@
id: 'Hyperv',
description: _l('Hyperv')
});
-
+ items.push({
+ id: 'Any',
+ description: _l('Any')
+ });
args.response.success({
data: items
});
@@ -15489,6 +15492,10 @@
id: "iscsi",
description: "iscsi"
});
+ items.push({
+ id: "custom",
+ description: "custom"
+ });
args.response.success({
data: items
});
@@ -15502,6 +15509,10 @@
id: "vmfs",
description: "vmfs"
});
+ items.push({
+ id: "custom",
+ description: "custom"
+ });
args.response.success({
data: items
});
@@ -15660,6 +15671,30 @@
$form.find('.form-item[rel=rbdsecret]').hide();
$form.find('.form-item[rel=glustervolume]').hide();
+ } else if (protocol == "custom") {
+ $form.find('.form-item[rel=server]').hide();
+ $form.find('.form-item[rel=server]').find(".value").find("input").val("localhost");
+
+ $form.find('.form-item[rel=path]').hide();
+
+ $form.find('.form-item[rel=smbUsername]').hide();
+ $form.find('.form-item[rel=smbPassword]').hide();
+ $form.find('.form-item[rel=smbDomain]').hide();
+
+ $form.find('.form-item[rel=iqn]').hide();
+ $form.find('.form-item[rel=lun]').hide();
+
+ $form.find('.form-item[rel=volumegroup]').hide();
+
+ $form.find('.form-item[rel=vCenterDataCenter]').hide();
+ $form.find('.form-item[rel=vCenterDataStore]').hide();
+
+ $form.find('.form-item[rel=rbdmonitor]').hide();
+ $form.find('.form-item[rel=rbdpool]').hide();
+ $form.find('.form-item[rel=rbdid]').hide();
+ $form.find('.form-item[rel=rbdsecret]').hide();
+
+ $form.find('.form-item[rel=glustervolume]').hide();
} else if (protocol == "iscsi") {
$form.find('.form-item[rel=server]').css('display', 'inline-block');
$form.find('.form-item[rel=server]').find(".value").find("input").val("");
@@ -15858,7 +15893,83 @@
},
isHidden: true
},
-
+ provider: {
+ label: 'label.provider',
+ docID: 'helpPrimaryStorageZone',
+ validation: {
+ required: true
+ },
+ select: function (args) {
+ var data = args.context.providers ?
+ { id: args.context.providers[0].id } :
+ { listAll: true };
+
+ $.ajax({
+ url: createURL('listStorageProviders'),
+ data: {
+ type: 'primary'
+ },
+ success: function (json) {
+ var providers = json.liststorageprovidersresponse.dataStoreProvider ? json.liststorageprovidersresponse.dataStoreProvider : [];
+
+ args.response.success({
+ data: $.map(providers, function (provider) {
+ return {
+ id: provider.name,
+ description: provider.name
+ };
+ })
+ });
+ }
+ });
+ args.$select.change(function () {
+ var $form = $(this).closest('form');
+ var scope = $(this).val();
+
+ if (scope == 'DefaultPrimary') {
+ $form.find('.form-item[rel=isManaged]').hide();
+ $form.find('.form-item[rel=capacityIops]').hide();
+ $form.find('.form-item[rel=capacityBytes]').hide();
+ $form.find('.form-item[rel=url]').hide();
+ } else {
+ $form.find('.form-item[rel=isManaged]').css('display', 'inline-block');
+ $form.find('.form-item[rel=capacityIops]').css('display', 'inline-block');
+ $form.find('.form-item[rel=capacityBytes]').css('display', 'inline-block');
+ $form.find('.form-item[rel=url]').css('display', 'inline-block');
+ }
+ }
+ )
+ }},
+ isManaged: {
+ label: 'label.managed',
+ docID: 'helpManaged',
+ isBoolean: true,
+ isChecked: false,
+ validation: {
+ required: false
+ }
+ },
+ capacityBytes: {
+ label: 'label.capacity.bytes',
+ docID: 'helpCapacityBytes',
+ validation: {
+ required: false
+ }
+ },
+ capacityIops: {
+ label: 'label.capacity.iops',
+ docID: 'helpCapacityIops',
+ validation: {
+ required: false
+ }
+ },
+ url: {
+ label: 'URL',
+ docID: 'helpUrl',
+ validation: {
+ required: false
+ }
+ },
//SMB
smbUsername: {
label: 'label.smb.username',
@@ -15981,6 +16092,7 @@
}
},
+ /******************************/
action: function (args) {
var array1 =[];
array1.push("&scope=" + todb(args.data.scope));
@@ -16003,74 +16115,103 @@
array1.push("&clusterid=" + args.data.clusterId);
array1.push("&hostid=" + args.data.hostId);
}
-
+
array1.push("&name=" + todb(args.data.name));
-
- var server = args.data.server;
- var url = null;
- if (args.data.protocol == "nfs") {
- var path = args.data.path;
- if (path.substring(0, 1) != "/")
- path = "/" + path;
- url = nfsURL(server, path);
- } else if (args.data.protocol == "SMB") {
- var path = args.data.path;
- if (path.substring(0, 1) != "/")
- path = "/" + path;
- url = smbURL(server, path);
- array1.push("&details[0].user=" + args.data.smbUsername);
- array1.push("&details[1].password=" + todb(args.data.smbPassword));
- array1.push("&details[2].domain=" + args.data.smbDomain);
- } else if (args.data.protocol == "PreSetup") {
- var path = args.data.path;
- if (path.substring(0, 1) != "/")
- path = "/" + path;
- url = presetupURL(server, path);
- } else if (args.data.protocol == "ocfs2") {
- var path = args.data.path;
- if (path.substring(0, 1) != "/")
- path = "/" + path;
- url = ocfs2URL(server, path);
- } else if (args.data.protocol == "SharedMountPoint") {
- var path = args.data.path;
- if (path.substring(0, 1) != "/")
- path = "/" + path;
- url = SharedMountPointURL(server, path);
- } else if (args.data.protocol == "clvm") {
- var vg = args.data.volumegroup;
- if (vg.substring(0, 1) != "/")
- vg = "/" + vg;
- url = clvmURL(vg);
- } else if (args.data.protocol == "rbd") {
- var rbdmonitor = args.data.rbdmonitor;
- var rbdpool = args.data.rbdpool;
- var rbdid = args.data.rbdid;
- var rbdsecret = args.data.rbdsecret;
- url = rbdURL(rbdmonitor, rbdpool, rbdid, rbdsecret);
- } else if (args.data.protocol == "vmfs") {
- var path = args.data.vCenterDataCenter;
- if (path.substring(0, 1) != "/")
- path = "/" + path;
- path += "/" + args.data.vCenterDataStore;
- url = vmfsURL("dummy", path);
- } else if (args.data.protocol == "gluster") {
- var glustervolume = args.data.glustervolume;
- if (glustervolume.substring(0, 1) != "/")
- glustervolume = "/" + glustervolume;
- url = glusterURL(server, glustervolume);
- } else {
- var iqn = args.data.iqn;
- if (iqn.substring(0, 1) != "/")
- iqn = "/" + iqn;
- var lun = args.data.lun;
- url = iscsiURL(server, iqn, lun);
+ array1.push("&provider=" + todb(args.data.provider));
+
+ if (args.data.provider == "DefaultPrimary")
+ {
+ var server = args.data.server;
+ var url = null;
+ if (args.data.protocol == "nfs") {
+ var path = args.data.path;
+ if (path.substring(0, 1) != "/")
+ path = "/" + path;
+ url = nfsURL(server, path);
+ } else if (args.data.protocol == "SMB") {
+ var path = args.data.path;
+ if (path.substring(0, 1) != "/")
+ path = "/" + path;
+ url = smbURL(server, path);
+ array1.push("&details[0].user=" + args.data.smbUsername);
+ array1.push("&details[1].password=" + todb(args.data.smbPassword));
+ array1.push("&details[2].domain=" + args.data.smbDomain);
+ } else if (args.data.protocol == "PreSetup") {
+ var path = args.data.path;
+ if (path.substring(0, 1) != "/")
+ path = "/" + path;
+ url = presetupURL(server, path);
+ } else if (args.data.protocol == "ocfs2") {
+ var path = args.data.path;
+ if (path.substring(0, 1) != "/")
+ path = "/" + path;
+ url = ocfs2URL(server, path);
+ } else if (args.data.protocol == "SharedMountPoint") {
+ var path = args.data.path;
+ if (path.substring(0, 1) != "/")
+ path = "/" + path;
+ url = SharedMountPointURL(server, path);
+ } else if (args.data.protocol == "clvm") {
+ var vg = args.data.volumegroup;
+ if (vg.substring(0, 1) != "/")
+ vg = "/" + vg;
+ url = clvmURL(vg);
+ } else if (args.data.protocol == "rbd") {
+ var rbdmonitor = args.data.rbdmonitor;
+ var rbdpool = args.data.rbdpool;
+ var rbdid = args.data.rbdid;
+ var rbdsecret = args.data.rbdsecret;
+ url = rbdURL(rbdmonitor, rbdpool, rbdid, rbdsecret);
+ } else if (args.data.protocol == "vmfs") {
+ var path = args.data.vCenterDataCenter;
+ if (path.substring(0, 1) != "/")
+ path = "/" + path;
+ path += "/" + args.data.vCenterDataStore;
+ url = vmfsURL("dummy", path);
+ } else if (args.data.protocol == "gluster") {
+ var glustervolume = args.data.glustervolume;
+
+ if (glustervolume.substring(0, 1) != "/")
+ glustervolume = "/" + glustervolume;
+ url = glusterURL(server, glustervolume);
+ } else if (args.data.protocol == "iscsi") {
+ var iqn = args.data.iqn;
+ if (iqn.substring(0, 1) != "/")
+ iqn = "/" + iqn;
+ var lun = args.data.lun;
+ url = iscsiURL(server, iqn, lun);
+ } else {
+ url = "";
+ }
+
+ array1.push("&url=" + todb(url));
}
- array1.push("&url=" + todb(url));
-
+ else
+ {
+ array1.push("&managed=" + (args.data.isManaged == "on").toString());
+
+ if (args.data.capacityBytes != null && args.data.capacityBytes.length > 0)
+ {
+ array1.push("&capacityBytes=" + args.data.capacityBytes.split(",").join(""));
+ }
+
+ if (args.data.capacityIops != null && args.data.capacityIops.length > 0)
+ {
+ array1.push("&capacityIops=" + args.data.capacityIops.split(",").join(""));
+ }
+
+ if (args.data.url != null && args.data.url.length > 0)
+ {
+ array1.push("&url=" + todb(args.data.url));
+ }
+ }
+
if (args.data.storageTags != null && args.data.storageTags.length > 0)
- array1.push("&tags=" + todb(args.data.storageTags));
-
+ {
+ array1.push("&tags=" + todb(args.data.storageTags));
+ }
+
$.ajax({
url: createURL("createStoragePool" + array1.join("")),
dataType: "json",
@@ -17899,7 +18040,7 @@
label: 'label.url'
},
providername: {
- label: 'Provider'
+ label: 'label.provider'
},
scope: {
label: 'label.scope'