You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ro...@apache.org on 2020/10/12 10:02:08 UTC

[cloudstack-primate] branch master updated: Add storage policy details in the detail view (#796)

This is an automated email from the ASF dual-hosted git repository.

rohit pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cloudstack-primate.git


The following commit(s) were added to refs/heads/master by this push:
     new 22dde36  Add storage policy details in the detail view (#796)
22dde36 is described below

commit 22dde368b34f38c02c1b3b7c4d363dffb9a8ddfc
Author: Pearl Dsilva <pe...@gmail.com>
AuthorDate: Mon Oct 12 15:32:00 2020 +0530

    Add storage policy details in the detail view (#796)
    
    * Add storage policy details in the detail view
    
    * check if API exists
    
    Co-authored-by: Pearl Dsilva <pe...@shapeblue.com>
---
 src/config/section/offering.js | 19 +++++++++++++++++--
 src/locales/en.json            |  1 +
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/src/config/section/offering.js b/src/config/section/offering.js
index 155f150..085d859 100644
--- a/src/config/section/offering.js
+++ b/src/config/section/offering.js
@@ -14,6 +14,7 @@
 // KIND, either express or implied.  See the License for the
 // specific language governing permissions and limitations
 // under the License.
+import store from '@/store'
 
 export default {
   name: 'offering',
@@ -29,7 +30,14 @@ export default {
       permission: ['listServiceOfferings', 'listDomains'],
       params: { isrecursive: 'true' },
       columns: ['name', 'displaytext', 'cpunumber', 'cpuspeed', 'memory', 'domain', 'zone', 'order'],
-      details: ['name', 'id', 'displaytext', 'offerha', 'provisioningtype', 'storagetype', 'iscustomized', 'limitcpuuse', 'cpunumber', 'cpuspeed', 'memory', 'hosttags', 'tags', 'domain', 'zone', 'created'],
+      details: () => {
+        var fields = ['name', 'id', 'displaytext', 'offerha', 'provisioningtype', 'storagetype', 'iscustomized', 'limitcpuuse', 'cpunumber', 'cpuspeed', 'memory', 'hosttags', 'tags', 'domain', 'zone', 'created']
+        if (store.getters.apis.createServiceOffering &&
+          store.getters.apis.createServiceOffering.params.filter(x => x.name === 'storagepolicy').length > 0) {
+          fields.splice(6, 0, 'vspherestoragepolicy')
+        }
+        return fields
+      },
       related: [{
         name: 'vm',
         title: 'label.instances',
@@ -111,7 +119,14 @@ export default {
       permission: ['listDiskOfferings', 'listDomains'],
       params: { isrecursive: 'true' },
       columns: ['name', 'displaytext', 'disksize', 'domain', 'zone', 'order'],
-      details: ['name', 'id', 'displaytext', 'disksize', 'provisioningtype', 'storagetype', 'iscustomized', 'tags', 'domain', 'zone', 'created'],
+      details: () => {
+        var fields = ['name', 'id', 'displaytext', 'disksize', 'provisioningtype', 'storagetype', 'iscustomized', 'tags', 'domain', 'zone', 'created']
+        if (store.getters.apis.createDiskOffering &&
+          store.getters.apis.createDiskOffering.params.filter(x => x.name === 'storagepolicy').length > 0) {
+          fields.splice(6, 0, 'vspherestoragepolicy')
+        }
+        return fields
+      },
       related: [{
         name: 'volume',
         title: 'label.volumes',
diff --git a/src/locales/en.json b/src/locales/en.json
index ac4677c..aff571a 100644
--- a/src/locales/en.json
+++ b/src/locales/en.json
@@ -2295,6 +2295,7 @@
 "label.vsmusername": "Nexus 1000v Username",
 "label.vsmusername.req": "Nexus 1000v Username",
 "label.vsphere.managed": "vSphere Managed",
+"label.vspherestoragepolicy": "vSphere Storage Policy",
 "label.vswitch.name": "vSwitch Name",
 "label.vswitch.type": "vSwitch Type",
 "label.vswitchguestname": "Guest Traffic vSwitch Name",