aboutsummaryrefslogtreecommitdiff
path: root/src/site/views
diff options
context:
space:
mode:
authorPitu <[email protected]>2018-09-18 03:34:00 -0300
committerPitu <[email protected]>2018-09-18 03:34:00 -0300
commit4b2b02110b457d8ebeee78e1bdf99eb0660d0626 (patch)
treea6e30208b61e3927c1681c7006241cd0d837de89 /src/site/views
parentStupid hash was working, the size changes for some reason when uploading (diff)
downloadhost.fuwn.me-4b2b02110b457d8ebeee78e1bdf99eb0660d0626.tar.xz
host.fuwn.me-4b2b02110b457d8ebeee78e1bdf99eb0660d0626.zip
We can now download albums yayyyy
Diffstat (limited to 'src/site/views')
-rw-r--r--src/site/views/PublicAlbum.vue16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/site/views/PublicAlbum.vue b/src/site/views/PublicAlbum.vue
index 534c185..e156698 100644
--- a/src/site/views/PublicAlbum.vue
+++ b/src/site/views/PublicAlbum.vue
@@ -24,6 +24,8 @@
<div class="container">
<h1 class="title">{{ name }}</h1>
<h2 class="subtitle">Serving {{ files.length }} files</h2>
+ <a v-if="downloadLink"
+ :href="downloadLink">Download Album</a>
<hr>
</div>
</div>
@@ -57,17 +59,20 @@ export default {
async getInitialData({ route, store }) {
try {
const res = await axios.get(`${config.baseURL}/album/${route.params.identifier}`);
+ const downloadLink = res.data.downloadEnabled ? `${config.baseURL}/album/${route.params.identifier}/zip` : null;
return {
name: res.data.name,
downloadEnabled: res.data.downloadEnabled,
- files: res.data.files
+ files: res.data.files,
+ downloadLink
};
} catch (error) {
console.error(error);
return {
name: null,
downloadEnabled: false,
- files: []
+ files: [],
+ downloadLink: null
};
}
},
@@ -100,6 +105,11 @@ export default {
location: window.location.href
});
},
- methods: {}
+ methods: {
+ async downloadAlbum() {
+ const response = await axios.get(`${config.baseURL}/album/${this.$route.params.identifier}/zip`);
+ console.log(response.data);
+ }
+ }
};
</script>