aboutsummaryrefslogtreecommitdiff
path: root/src/site/views
diff options
context:
space:
mode:
authorPitu <[email protected]>2018-09-18 03:34:29 -0300
committerPitu <[email protected]>2018-09-18 03:34:29 -0300
commitb75023114a22cac1a918198a64b7e6d4b238d2bc (patch)
tree6bb965d43da8004243bebe4687e298eb1a9ee552 /src/site/views
parentWe can now download albums yayyyy (diff)
downloadhost.fuwn.me-b75023114a22cac1a918198a64b7e6d4b238d2bc.tar.xz
host.fuwn.me-b75023114a22cac1a918198a64b7e6d4b238d2bc.zip
Enable changing album options
Diffstat (limited to 'src/site/views')
-rw-r--r--src/site/views/dashboard/Albums.vue25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/site/views/dashboard/Albums.vue b/src/site/views/dashboard/Albums.vue
index 57cd01f..9dc883c 100644
--- a/src/site/views/dashboard/Albums.vue
+++ b/src/site/views/dashboard/Albums.vue
@@ -226,21 +226,29 @@
<b-table-column field="enableDownload"
label="Allow download"
centered>
- <b-switch :value="props.row.enableDownload "/>
+ <b-switch v-model="props.row.enableDownload"
+ @input="linkOptionsChanged(props.row)"/>
</b-table-column>
<b-table-column field="enabled"
label="Enabled"
centered>
- <b-switch :value="props.row.enabled "/>
+ <b-switch v-model="props.row.enabled"
+ @input="linkOptionsChanged(props.row)"/>
</b-table-column>
+ <!--
+ Until it's decided if we want to delete links or just hide them from the list
+ this setting will be hidden. Discussion about it is encouraged on Discord.
+ -->
+ <!--
<b-table-column field="actions"
label="Actions"
centered>
<button class="button is-danger"
@click="deleteLink(props.row.identifier)">Delete link</button>
</b-table-column>
+ -->
</template>
<template slot="empty">
<div class="has-text-centered">
@@ -303,6 +311,19 @@ export default {
});
},
methods: {
+ async linkOptionsChanged(link) {
+ try {
+ const response = await this.axios.post(`${this.$config.baseURL}/album/link/edit`,
+ {
+ identifier: link.identifier,
+ enableDownload: link.enableDownload,
+ enabled: link.enabled
+ });
+ this.$toast.open(response.data.message);
+ } catch (error) {
+ this.$onPromiseError(error);
+ }
+ },
async createLink(album) {
album.isCreatingLink = true;
try {