diff options
Diffstat (limited to 'viewer/src')
-rw-r--r-- | viewer/src/@types/gallery.d.ts | 3 | ||||
-rw-r--r-- | viewer/src/store/galleryStore.ts | 11 |
2 files changed, 11 insertions, 3 deletions
diff --git a/viewer/src/@types/gallery.d.ts b/viewer/src/@types/gallery.d.ts index 56feff0..b756331 100644 --- a/viewer/src/@types/gallery.d.ts +++ b/viewer/src/@types/gallery.d.ts | |||
@@ -20,7 +20,8 @@ | |||
20 | declare namespace Gallery { | 20 | declare namespace Gallery { |
21 | interface Config { | 21 | interface Config { |
22 | galleryRoot: string; | 22 | galleryRoot: string; |
23 | initialTagDisplayLimit: number; | 23 | galleryIndex?: string; |
24 | initialTagDisplayLimit?: number; | ||
24 | } | 25 | } |
25 | 26 | ||
26 | interface GalleryProperties { | 27 | interface GalleryProperties { |
diff --git a/viewer/src/store/galleryStore.ts b/viewer/src/store/galleryStore.ts index 768adb6..b672551 100644 --- a/viewer/src/store/galleryStore.ts +++ b/viewer/src/store/galleryStore.ts | |||
@@ -85,7 +85,7 @@ export default class GalleryStore extends VuexModule { | |||
85 | 85 | ||
86 | // Fetches the gallery's JSON config | 86 | // Fetches the gallery's JSON config |
87 | @action async fetchConfig() { | 87 | @action async fetchConfig() { |
88 | return fetch(`${process.env.VUE_APP_DATA_URL}config.json`, { cache: "no-cache" }) | 88 | return fetch(`${process.env.VUE_APP_DATA_URL}${GalleryStore.getUrlConfig()}`, { cache: "no-cache" }) |
89 | .then(response => response.json()) | 89 | .then(response => response.json()) |
90 | .then(this.setConfig); | 90 | .then(this.setConfig); |
91 | } | 91 | } |
@@ -93,7 +93,8 @@ export default class GalleryStore extends VuexModule { | |||
93 | // Fetches the gallery's JSON metadata | 93 | // Fetches the gallery's JSON metadata |
94 | @action async fetchGalleryItems() { | 94 | @action async fetchGalleryItems() { |
95 | const root = this.config?.galleryRoot ?? ""; | 95 | const root = this.config?.galleryRoot ?? ""; |
96 | return fetch(`${process.env.VUE_APP_DATA_URL}${root}index.json`, { cache: "no-cache" }) | 96 | const index = this.config?.galleryIndex ?? "index.json"; |
97 | return fetch(`${process.env.VUE_APP_DATA_URL}${root}${index}`, { cache: "no-cache" }) | ||
97 | .then(response => response.json()) | 98 | .then(response => response.json()) |
98 | .then(this.setGalleryIndex) | 99 | .then(this.setGalleryIndex) |
99 | .then(this.indexTags) | 100 | .then(this.indexTags) |
@@ -121,4 +122,10 @@ export default class GalleryStore extends VuexModule { | |||
121 | this.setCurrentSearch(results); | 122 | this.setCurrentSearch(results); |
122 | return results; | 123 | return results; |
123 | } | 124 | } |
125 | |||
126 | private static getUrlConfig() { | ||
127 | let search = window.location.search; | ||
128 | if (search.length > 1) return search.substr(1) + ".json"; | ||
129 | return "config.json"; | ||
130 | } | ||
124 | } | 131 | } |