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/02/23 10:32:20 UTC

[cloudstack-primate] branch master updated (cd7f290 -> 23fc80b)

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

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


    from cd7f290  compute: disable settings when the vm is not stopped (#172)
     new c4825c2  router: don't cache components
     new 23fc80b  breadcrumb: display name or text instead of UUID in the breadcrumb

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/components/view/InfoCard.vue      |  2 +-
 src/components/widgets/Breadcrumb.vue | 10 +++++++++-
 src/config/router.js                  |  7 +------
 src/views/AutogenView.vue             | 16 ++--------------
 4 files changed, 13 insertions(+), 22 deletions(-)


[cloudstack-primate] 02/02: breadcrumb: display name or text instead of UUID in the breadcrumb

Posted by ro...@apache.org.
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 23fc80b757e53a7e83ef92a5680a39f02eabd147
Author: Rohit Yadav <ro...@shapeblue.com>
AuthorDate: Sun Feb 23 15:49:00 2020 +0530

    breadcrumb: display name or text instead of UUID in the breadcrumb
    
    Signed-off-by: Rohit Yadav <ro...@shapeblue.com>
---
 src/components/widgets/Breadcrumb.vue | 10 +++++++++-
 src/views/AutogenView.vue             |  2 +-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/components/widgets/Breadcrumb.vue b/src/components/widgets/Breadcrumb.vue
index fded742..8a1135d 100644
--- a/src/components/widgets/Breadcrumb.vue
+++ b/src/components/widgets/Breadcrumb.vue
@@ -26,7 +26,7 @@
         {{ $t(item.meta.title) }}
       </router-link>
       <span v-else-if="$route.params.id">
-        {{ $route.params.id }}
+        {{ resource.displayname || resource.displaytext || resource.name || resource.hostname || resource.username || resource.ipaddress || $route.params.id }}
       </span>
       <span v-else>
         {{ $t(item.meta.title) }}
@@ -56,6 +56,14 @@ import config from '@/config/settings'
 
 export default {
   name: 'Breadcrumb',
+  props: {
+    resource: {
+      type: Object,
+      default: function () {
+        return {}
+      }
+    }
+  },
   data () {
     return {
       name: '',
diff --git a/src/views/AutogenView.vue b/src/views/AutogenView.vue
index c4e9133..229f1eb 100644
--- a/src/views/AutogenView.vue
+++ b/src/views/AutogenView.vue
@@ -20,7 +20,7 @@
     <a-card class="breadcrumb-card">
       <a-row>
         <a-col :span="14" style="padding-left: 6px">
-          <breadcrumb>
+          <breadcrumb :resource="resource">
             <a-tooltip placement="bottom" slot="end">
               <template slot="title">
                 {{ "Refresh" }}


[cloudstack-primate] 01/02: router: don't cache components

Posted by ro...@apache.org.
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 c4825c2d14df133632f240039f6e187893b1dbb8
Author: Rohit Yadav <ro...@shapeblue.com>
AuthorDate: Sun Feb 23 15:48:42 2020 +0530

    router: don't cache components
    
    Signed-off-by: Rohit Yadav <ro...@shapeblue.com>
---
 src/components/view/InfoCard.vue |  2 +-
 src/config/router.js             |  7 +------
 src/views/AutogenView.vue        | 14 +-------------
 3 files changed, 3 insertions(+), 20 deletions(-)

diff --git a/src/components/view/InfoCard.vue b/src/components/view/InfoCard.vue
index a3da95d..112fb01 100644
--- a/src/components/view/InfoCard.vue
+++ b/src/components/view/InfoCard.vue
@@ -29,7 +29,7 @@
             </div>
             <slot name="name">
               <h4 class="name">
-                {{ resource.displayname || resource.name || resource.displaytext || resource.hostname || resource.username || resource.ipaddress }}
+                {{ resource.displayname || resource.displaytext || resource.name || resource.hostname || resource.username || resource.ipaddress }}
               </h4>
               <console style="margin-left: 10px" :resource="resource" size="default" v-if="resource.id" />
             </slot>
diff --git a/src/config/router.js b/src/config/router.js
index 8036e7a..a9089eb 100644
--- a/src/config/router.js
+++ b/src/config/router.js
@@ -37,7 +37,7 @@ export function generateRouterMap (section) {
     name: section.name,
     path: '/' + section.name,
     hidden: section.hidden,
-    meta: { title: section.title, keepAlive: true, icon: section.icon, docHelp: section.docHelp },
+    meta: { title: section.title, icon: section.icon, docHelp: section.docHelp },
     component: RouteView
   }
 
@@ -54,7 +54,6 @@ export function generateRouterMap (section) {
         meta: {
           title: child.title,
           name: child.name,
-          keepAlive: true,
           icon: child.icon,
           docHelp: child.docHelp,
           permission: child.permission,
@@ -76,7 +75,6 @@ export function generateRouterMap (section) {
             meta: {
               title: child.title,
               name: child.name,
-              keepAlive: true,
               icon: child.icon,
               docHelp: child.docHelp,
               permission: child.permission,
@@ -104,7 +102,6 @@ export function generateRouterMap (section) {
             meta: {
               title: child.title,
               name: child.name,
-              keepAlive: true,
               permission: [action.api]
             },
             component: action.component
@@ -122,7 +119,6 @@ export function generateRouterMap (section) {
       meta: {
         title: section.title,
         name: section.name,
-        keepAlive: true,
         icon: section.icon,
         docHelp: section.docHelp,
         hidden: section.hidden,
@@ -170,7 +166,6 @@ export const asyncRouterMap = [
         name: 'dashboard',
         meta: {
           title: 'Dashboard',
-          keepAlive: true,
           icon: 'dashboard',
           tabs: [
             {
diff --git a/src/views/AutogenView.vue b/src/views/AutogenView.vue
index 856eba6..c4e9133 100644
--- a/src/views/AutogenView.vue
+++ b/src/views/AutogenView.vue
@@ -325,19 +325,7 @@ export default {
   },
   watch: {
     '$route' (to, from) {
-      // The route config creates two groups of section components one for each
-      // related paths. Once these two groups of components are mounted, on
-      // route changes this method is called twice causing multiple API calls.
-      // The following fixes this issue by using logical XOR to identify the
-      // current component against related `to` route and the path the component
-      // was in and only calls fetchData if `to` route and currentPath are of
-      // the same group of routes.
-
-      const related = ['/project', '/event', '/dashboard']
-      const toPath = related.map(o => to.fullPath.includes(o)).includes(true)
-      const inPath = related.map(o => this.currentPath.includes(o)).includes(true)
-      this.needToFetchData = ((toPath ^ inPath) === 0)
-      if (this.needToFetchData && to.fullPath !== from.fullPath && !to.fullPath.includes('action/')) {
+      if (to.fullPath !== from.fullPath && !to.fullPath.includes('action/')) {
         this.searchQuery = ''
         this.page = 1
         this.itemCount = 0