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/06/13 08:17:58 UTC

[cloudstack-primate] 02/02: infra: embed host-info into details tab

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 80cb0e0275bea54f2246900ce5ada7294cbf1c5d
Author: Rohit Yadav <ro...@shapeblue.com>
AuthorDate: Sat Jun 13 13:47:09 2020 +0530

    infra: embed host-info into details tab
    
    Signed-off-by: Rohit Yadav <ro...@shapeblue.com>
---
 src/components/view/DetailsTab.vue                |  3 +++
 src/config/section/infra/hosts.js                 |  3 ---
 src/views/infra/{HostInfoTab.vue => HostInfo.vue} | 15 ++++++++++-----
 3 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/src/components/view/DetailsTab.vue b/src/components/view/DetailsTab.vue
index 250eace..cfa340f 100644
--- a/src/components/view/DetailsTab.vue
+++ b/src/components/view/DetailsTab.vue
@@ -38,6 +38,7 @@
         </div>
       </div>
     </a-list-item>
+    <HostInfo :resource="resource" v-if="$route.meta.name === 'host' && 'listHosts' in $store.getters.apis" />
     <DedicateData :resource="resource" v-if="dedicatedSectionActive" />
     <VmwareData :resource="resource" v-if="$route.meta.name === 'zone' && 'listVmwareDcs' in $store.getters.apis" />
   </a-list>
@@ -45,12 +46,14 @@
 
 <script>
 import DedicateData from './DedicateData'
+import HostInfo from '@/views/infra/HostInfo'
 import VmwareData from './VmwareData'
 
 export default {
   name: 'DetailsTab',
   components: {
     DedicateData,
+    HostInfo,
     VmwareData
   },
   props: {
diff --git a/src/config/section/infra/hosts.js b/src/config/section/infra/hosts.js
index e06a7d7..de1e827 100644
--- a/src/config/section/infra/hosts.js
+++ b/src/config/section/infra/hosts.js
@@ -27,9 +27,6 @@ export default {
   tabs: [{
     name: 'details',
     component: () => import('@/components/view/DetailsTab.vue')
-  }, {
-    name: 'config',
-    component: () => import('@/views/infra/HostInfoTab.vue')
   }],
   related: [{
     name: 'vm',
diff --git a/src/views/infra/HostInfoTab.vue b/src/views/infra/HostInfo.vue
similarity index 90%
rename from src/views/infra/HostInfoTab.vue
rename to src/views/infra/HostInfo.vue
index aeb3b76..627f6ff 100644
--- a/src/views/infra/HostInfoTab.vue
+++ b/src/views/infra/HostInfo.vue
@@ -21,9 +21,14 @@
       <a-list-item>
         <div>
           <strong>{{ $t('label.hypervisorversion') }}</strong>
-          <div v-if="host.details">
+          <div>
             {{ host.hypervisor }}
-            {{ host.details['Host.OS'] + ' ' + host.details['Host.OS.Version'] }}
+            <span v-if="host.details">
+              {{ host.details['Host.OS'] + ' ' + host.details['Host.OS.Version'] }}
+            </span>
+            <span v-else>
+              {{ host.version }}
+            </span>
           </div>
         </div>
       </a-list-item>
@@ -100,7 +105,7 @@
 import { api } from '@/api'
 
 export default {
-  name: 'HostInfoTab',
+  name: 'HostInfo',
   props: {
     resource: {
       type: Object,
@@ -121,8 +126,8 @@ export default {
     this.fetchData()
   },
   watch: {
-    loading (newData, oldData) {
-      if (!newData && this.resource.id) {
+    resource (newItem, oldItem) {
+      if (this.resource && this.resource.id && newItem && newItem.id !== oldItem.id) {
         this.fetchData()
       }
     }