aboutsummaryrefslogtreecommitdiff
path: root/viewer/src/views/LdGallery.vue
diff options
context:
space:
mode:
authorZero~Informatique2019-12-21 08:08:54 +0100
committerZero~Informatique2019-12-21 08:08:54 +0100
commit9e4fdd6f38853d8a4a959901ab7902569de75484 (patch)
tree3255e7fc08a6767ce8c333a42388f6398d2b460e /viewer/src/views/LdGallery.vue
parent40e8303d6b37a062754fdfbe824a153b8e5e2ddf (diff)
downloadldgallery-9e4fdd6f38853d8a4a959901ab7902569de75484.tar.gz
viewer:
Implemented the "example" project in devServer Display loader and error messages (not translated yet) Created a "GalleryStore" to fetch the JSon data from the gallery (currently from example)
Diffstat (limited to 'viewer/src/views/LdGallery.vue')
-rw-r--r--viewer/src/views/LdGallery.vue28
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 @@
11import { Component, Vue } from "vue-property-decorator"; 12import { Component, Vue } from "vue-property-decorator";
12 13
13@Component 14@Component
14export default class LdGallery extends Vue {} 15export 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">