autogenview: show spinner on refreshing/loading

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Rohit Yadav 2019-11-04 12:49:19 +05:30
parent fc07b9e372
commit 46d5e70c74
4 changed files with 371 additions and 367 deletions

View File

@ -16,9 +16,9 @@
// under the License. // under the License.
<template> <template>
<a-card :bordered="true" :title="title"> <a-spin :spinning="loading">
<a-skeleton active v-if="loading" /> <a-card class="spin-content" :bordered="true" :title="title">
<div v-else> <div>
<div class="resource-details"> <div class="resource-details">
<div class="avatar"> <div class="avatar">
<slot name="avatar"> <slot name="avatar">
@ -383,6 +383,7 @@
</a-comment> </a-comment>
</div> </div>
</a-card> </a-card>
</a-spin>
</template> </template>
<script> <script>
@ -491,7 +492,7 @@ export default {
}) })
}, },
getTags () { getTags () {
if (!('listTags' in this.$store.getters.apis)) { if (!('listTags' in this.$store.getters.apis) || !this.resource || !this.resource.id) {
return return
} }
this.tags = [] this.tags = []

View File

@ -22,13 +22,12 @@
<info-card :resource="resource" :loading="loading" /> <info-card :resource="resource" :loading="loading" />
</slot> </slot>
</div> </div>
<div slot="right"> <a-spin :spinning="loading" slot="right">
<a-card <a-card
class="spin-content"
:bordered="true" :bordered="true"
style="width:100%"> style="width:100%">
<a-skeleton active v-if="loading" />
<a-tabs <a-tabs
v-else
style="width: 100%" style="width: 100%"
:animated="false" :animated="false"
:defaultActiveKey="tabs[0].name" :defaultActiveKey="tabs[0].name"
@ -41,7 +40,7 @@
</a-tab-pane> </a-tab-pane>
</a-tabs> </a-tabs>
</a-card> </a-card>
</div> </a-spin>
</resource-layout> </resource-layout>
</template> </template>

View File

@ -285,6 +285,7 @@ export default {
this.actions = [] this.actions = []
this.columns = [] this.columns = []
this.columnKeys = [] this.columnKeys = []
this.items = []
var params = { listall: true } var params = { listall: true }
if (Object.keys(this.$route.query).length > 0) { if (Object.keys(this.$route.query).length > 0) {
Object.assign(params, this.$route.query) Object.assign(params, this.$route.query)

View File

@ -144,6 +144,9 @@ export default {
methods: { methods: {
fetchData () { fetchData () {
this.volumes = [] this.volumes = []
if (!this.vm || !this.vm.id) {
return
}
api('listVolumes', { 'listall': true, 'virtualmachineid': this.vm.id }).then(json => { api('listVolumes', { 'listall': true, 'virtualmachineid': this.vm.id }).then(json => {
this.volumes = json.listvolumesresponse.volume this.volumes = json.listvolumesresponse.volume
if (this.volumes) { if (this.volumes) {