diff options
Diffstat (limited to 'viewer/src/views/LdGallery.vue')
-rw-r--r-- | viewer/src/views/LdGallery.vue | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/viewer/src/views/LdGallery.vue b/viewer/src/views/LdGallery.vue index ecdfa1b..04474c3 100644 --- a/viewer/src/views/LdGallery.vue +++ b/viewer/src/views/LdGallery.vue | |||
@@ -4,6 +4,7 @@ | |||
4 | <div class="layout layout-left">panel</div> | 4 | <div class="layout layout-left">panel</div> |
5 | <router-view class="layout layout-content" /> | 5 | <router-view class="layout layout-content" /> |
6 | <ld-button-fullscreen /> | 6 | <ld-button-fullscreen /> |
7 | <b-loading :active="isLoading" is-full-page /> | ||
7 | </div> | 8 | </div> |
8 | </template> | 9 | </template> |
9 | 10 | ||
@@ -11,7 +12,32 @@ | |||
11 | import { Component, Vue } from "vue-property-decorator"; | 12 | import { Component, Vue } from "vue-property-decorator"; |
12 | 13 | ||
13 | @Component | 14 | @Component |
14 | export default class LdGallery extends Vue {} | 15 | export default class LdGallery extends Vue { |
16 | isLoading: boolean = false; | ||
17 | |||
18 | mounted() { | ||
19 | this.fetchGalleryItems(); | ||
20 | } | ||
21 | |||
22 | fetchGalleryItems() { | ||
23 | this.isLoading = true; | ||
24 | this.$galleryStore | ||
25 | .fetchGalleryItems("/gallery/index.json") | ||
26 | .finally(() => (this.isLoading = false)) | ||
27 | .catch(this.displayError); | ||
28 | } | ||
29 | |||
30 | displayError(reason: any) { | ||
31 | this.$buefy.snackbar.open({ | ||
32 | message: `Error ${reason}`, | ||
33 | actionText: "Retry", | ||
34 | position: "is-top", | ||
35 | type: "is-danger", | ||
36 | indefinite: true, | ||
37 | onAction: this.fetchGalleryItems, | ||
38 | }); | ||
39 | } | ||
40 | } | ||
15 | </script> | 41 | </script> |
16 | 42 | ||
17 | <style lang="scss"> | 43 | <style lang="scss"> |