Mercurial > gemma
comparison client/src/components/importqueue/Importqueuedetail.vue @ 1561:ad3a19e222bb
importqueue: loading indicator
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Wed, 12 Dec 2018 11:24:47 +0100 |
parents | 5d84dcb79a54 |
children | 7ac802add1b9 |
comparison
equal
deleted
inserted
replaced
1560:70421380142d | 1561:ad3a19e222bb |
---|---|
24 v-if="show" | 24 v-if="show" |
25 icon="angle-up" | 25 icon="angle-up" |
26 fixed-width | 26 fixed-width |
27 ></font-awesome-icon> | 27 ></font-awesome-icon> |
28 <font-awesome-icon | 28 <font-awesome-icon |
29 v-else | 29 v-if="loading" |
30 icon="spinner" | |
31 fixed-width | |
32 ></font-awesome-icon> | |
33 <font-awesome-icon | |
34 v-if="!show && !loading" | |
30 icon="angle-down" | 35 icon="angle-down" |
31 fixed-width | 36 fixed-width |
32 ></font-awesome-icon> | 37 ></font-awesome-icon> |
33 </div> | 38 </div> |
34 </div> | 39 </div> |
100 export default { | 105 export default { |
101 name: "importqueuedetail", | 106 name: "importqueuedetail", |
102 props: ["job"], | 107 props: ["job"], |
103 data() { | 108 data() { |
104 return { | 109 return { |
110 loading: false, | |
105 show: false, | 111 show: false, |
106 entries: [], | 112 entries: [], |
107 sortAsc: true | 113 sortAsc: true |
108 }; | 114 }; |
109 }, | 115 }, |
121 if (this.show) { | 127 if (this.show) { |
122 this.show = false; | 128 this.show = false; |
123 return; | 129 return; |
124 } | 130 } |
125 if (this.entries.length === 0) { | 131 if (this.entries.length === 0) { |
132 this.loading = true; | |
126 HTTP.get("/imports/" + id, { | 133 HTTP.get("/imports/" + id, { |
127 headers: { "X-Gemma-Auth": localStorage.getItem("token") } | 134 headers: { "X-Gemma-Auth": localStorage.getItem("token") } |
128 }) | 135 }) |
129 .then(response => { | 136 .then(response => { |
130 const { entries } = response.data; | 137 const { entries } = response.data; |
131 this.entries = entries; | 138 this.entries = entries; |
132 this.show = true; | 139 this.show = true; |
140 this.loading = false; | |
133 }) | 141 }) |
134 .catch(error => { | 142 .catch(error => { |
135 const { status, data } = error.response; | 143 const { status, data } = error.response; |
136 displayError({ | 144 displayError({ |
137 title: this.$gettext("Backend Error"), | 145 title: this.$gettext("Backend Error"), |