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/05/06 21:57:29 UTC

[cloudstack-primate] 02/02: config: move domains to non-nested nav button

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

commit 15c8ecfe60aa813f3a01360f9a4522a2279bb3dd
Author: Rohit Yadav <ro...@shapeblue.com>
AuthorDate: Thu May 7 03:26:37 2020 +0530

    config: move domains to non-nested nav button
    
    Signed-off-by: Rohit Yadav <ro...@shapeblue.com>
---
 src/config/router.js         |   9 +++
 src/config/section/domain.js | 186 +++++++++++++++++++++----------------------
 2 files changed, 98 insertions(+), 97 deletions(-)

diff --git a/src/config/router.js b/src/config/router.js
index 86e47f8..b718773 100644
--- a/src/config/router.js
+++ b/src/config/router.js
@@ -116,6 +116,15 @@ export function generateRouterMap (section) {
   } else {
     map.component = section.component ? section.component : AutogenView
     map.hideChildrenInMenu = true
+
+    map.meta.name = section.name
+    map.meta.permission = section.permission
+    map.meta.resourceType = section.resourceType
+    map.meta.details = section.details
+    map.meta.actions = section.actions
+    map.meta.treeView = section.treeView ? section.treeView : false
+    map.meta.tabs = section.treeView ? section.tabs : {}
+
     map.children = [{
       path: '/' + section.name + '/:id',
       actions: section.actions ? section.actions : [],
diff --git a/src/config/section/domain.js b/src/config/section/domain.js
index f5e5bcf..8f646a7 100644
--- a/src/config/section/domain.js
+++ b/src/config/section/domain.js
@@ -16,110 +16,102 @@
 // under the License.
 
 export default {
-  name: 'iam',
+  name: 'domain',
   title: 'Domains',
   icon: 'block',
-  permission: ['listDomains'],
-  children: [
+  permission: ['listDomains', 'listDomainChildren'],
+  resourceType: 'Domain',
+  columns: ['name', 'state', 'path', 'parentdomainname', 'level'],
+  details: ['name', 'id', 'path', 'parentdomainname', 'level', 'networkdomain', 'iptotal', 'vmtotal', 'volumetotal', 'vmlimit', 'iplimit', 'volumelimit', 'snapshotlimit', 'templatelimit', 'vpclimit', 'cpulimit', 'memorylimit', 'networklimit', 'primarystoragelimit', 'secondarystoragelimit'],
+  related: [{
+    name: 'account',
+    title: 'Accounts',
+    param: 'domainid'
+  }],
+  tabs: [
     {
-      name: 'domain',
-      title: 'Domains',
-      icon: 'block',
-      permission: ['listDomains'],
-      resourceType: 'Domain',
-      columns: ['name', 'state', 'path', 'parentdomainname', 'level'],
-      details: ['name', 'id', 'path', 'parentdomainname', 'level', 'networkdomain', 'iptotal', 'vmtotal', 'volumetotal', 'vmlimit', 'iplimit', 'volumelimit', 'snapshotlimit', 'templatelimit', 'vpclimit', 'cpulimit', 'memorylimit', 'networklimit', 'primarystoragelimit', 'secondarystoragelimit'],
-      related: [{
-        name: 'account',
-        title: 'Accounts',
-        param: 'domainid'
-      }],
-      tabs: [
-        {
-          name: 'Domain',
-          component: () => import('@/components/view/InfoCard.vue'),
-          show: (record, route) => { return route.path === '/domain' }
-        },
-        {
-          name: 'details',
-          component: () => import('@/components/view/DetailsTab.vue')
-        },
-        {
-          name: 'limits',
-          show: (record, route, user) => { return ['Admin'].includes(user.roletype) },
-          component: () => import('@/components/view/ResourceLimitTab.vue')
-        },
-        {
-          name: 'Settings',
-          component: () => import('@/components/view/SettingsTab.vue'),
-          show: (record, route, user) => { return ['Admin'].includes(user.roletype) }
+      name: 'Domain',
+      component: () => import('@/components/view/InfoCard.vue'),
+      show: (record, route) => { return route.path === '/domain' }
+    },
+    {
+      name: 'details',
+      component: () => import('@/components/view/DetailsTab.vue')
+    },
+    {
+      name: 'limits',
+      show: (record, route, user) => { return ['Admin'].includes(user.roletype) },
+      component: () => import('@/components/view/ResourceLimitTab.vue')
+    },
+    {
+      name: 'Settings',
+      component: () => import('@/components/view/SettingsTab.vue'),
+      show: (record, route, user) => { return ['Admin'].includes(user.roletype) }
+    }
+  ],
+  treeView: true,
+  actions: [
+    {
+      api: 'createDomain',
+      icon: 'plus',
+      label: 'label.add.domain',
+      listView: true,
+      dataView: true,
+      args: ['parentdomainid', 'name', 'networkdomain', 'domainid'],
+      mapping: {
+        parentdomainid: {
+          value: (record) => { return record.id }
         }
-      ],
-      treeView: true,
-      actions: [
-        {
-          api: 'createDomain',
-          icon: 'plus',
-          label: 'label.add.domain',
-          listView: true,
-          dataView: true,
-          args: ['parentdomainid', 'name', 'networkdomain', 'domainid'],
-          mapping: {
-            parentdomainid: {
-              value: (record) => { return record.id }
-            }
-          }
-        },
-        {
-          api: 'updateDomain',
-          icon: 'edit',
-          label: 'label.action.edit.domain',
-          listView: true,
-          dataView: true,
-          args: ['name', 'networkdomain']
-        },
-        {
-          api: 'updateResourceCount',
-          icon: 'sync',
-          label: 'label.action.update.resource.count',
-          listView: true,
-          dataView: true,
-          args: ['domainid'],
-          mapping: {
-            domainid: {
-              value: (record) => { return record.id }
-            }
-          }
+      }
+    },
+    {
+      api: 'updateDomain',
+      icon: 'edit',
+      label: 'label.action.edit.domain',
+      listView: true,
+      dataView: true,
+      args: ['name', 'networkdomain']
+    },
+    {
+      api: 'updateResourceCount',
+      icon: 'sync',
+      label: 'label.action.update.resource.count',
+      listView: true,
+      dataView: true,
+      args: ['domainid'],
+      mapping: {
+        domainid: {
+          value: (record) => { return record.id }
+        }
+      }
+    },
+    {
+      api: 'linkDomainToLdap',
+      icon: 'link',
+      label: 'Link Domain to LDAP Group/OU',
+      listView: true,
+      dataView: true,
+      args: ['type', 'domainid', 'name', 'accounttype', 'admin'],
+      mapping: {
+        type: {
+          options: ['GROUP', 'OU']
         },
-        {
-          api: 'linkDomainToLdap',
-          icon: 'link',
-          label: 'Link Domain to LDAP Group/OU',
-          listView: true,
-          dataView: true,
-          args: ['type', 'domainid', 'name', 'accounttype', 'admin'],
-          mapping: {
-            type: {
-              options: ['GROUP', 'OU']
-            },
-            accounttype: {
-              options: ['0', '2']
-            },
-            domainid: {
-              value: (record) => { return record.id }
-            }
-          }
+        accounttype: {
+          options: ['0', '2']
         },
-        {
-          api: 'deleteDomain',
-          icon: 'delete',
-          label: 'label.delete.domain',
-          listView: true,
-          dataView: true,
-          show: (record) => { return record.level !== 0 },
-          args: ['cleanup']
+        domainid: {
+          value: (record) => { return record.id }
         }
-      ]
+      }
+    },
+    {
+      api: 'deleteDomain',
+      icon: 'delete',
+      label: 'label.delete.domain',
+      listView: true,
+      dataView: true,
+      show: (record) => { return record.level !== 0 },
+      args: ['cleanup']
     }
   ]
 }