2018-09-16 06:09:02 +02:00
|
|
|
<template>
|
2020-06-29 19:02:47 +02:00
|
|
|
<section class="section is-fullheight dashboard">
|
|
|
|
<div class="container">
|
|
|
|
<div class="columns">
|
|
|
|
<div class="column is-narrow">
|
|
|
|
<Sidebar />
|
|
|
|
</div>
|
|
|
|
<div class="column">
|
2020-07-08 03:00:12 +02:00
|
|
|
<h2 class="subtitle">
|
|
|
|
Service settings
|
|
|
|
</h2>
|
2020-06-29 19:02:47 +02:00
|
|
|
<hr>
|
2018-09-16 06:09:02 +02:00
|
|
|
|
2020-07-08 03:00:12 +02:00
|
|
|
<b-field
|
|
|
|
label="Service name"
|
2020-06-29 19:02:47 +02:00
|
|
|
message="Please enter the name which this service is gonna be identified as"
|
|
|
|
horizontal>
|
2020-07-08 03:00:12 +02:00
|
|
|
<b-input
|
2020-07-10 00:13:51 +02:00
|
|
|
v-model="settings.serviceName"
|
2020-12-25 12:45:22 +01:00
|
|
|
class="chibisafe-input"
|
2020-06-29 19:02:47 +02:00
|
|
|
expanded />
|
|
|
|
</b-field>
|
2019-02-26 14:26:03 +01:00
|
|
|
|
2020-07-08 03:00:12 +02:00
|
|
|
<b-field
|
|
|
|
label="Upload folder"
|
2020-06-29 19:02:47 +02:00
|
|
|
message="Where to store the files relative to the working directory"
|
|
|
|
horizontal>
|
2020-07-08 03:00:12 +02:00
|
|
|
<b-input
|
2020-07-10 00:13:51 +02:00
|
|
|
v-model="settings.uploadFolder"
|
2020-12-25 12:45:22 +01:00
|
|
|
class="chibisafe-input"
|
2020-06-29 19:02:47 +02:00
|
|
|
expanded />
|
|
|
|
</b-field>
|
2019-02-26 14:26:03 +01:00
|
|
|
|
2020-07-08 03:00:12 +02:00
|
|
|
<b-field
|
|
|
|
label="Links per album"
|
2020-06-29 19:02:47 +02:00
|
|
|
message="Maximum links allowed per album"
|
|
|
|
horizontal>
|
2020-07-08 03:00:12 +02:00
|
|
|
<b-input
|
2020-07-10 00:13:51 +02:00
|
|
|
v-model="settings.linksPerAlbum"
|
2020-12-25 12:45:22 +01:00
|
|
|
class="chibisafe-input"
|
2020-06-29 19:02:47 +02:00
|
|
|
type="number"
|
|
|
|
expanded />
|
|
|
|
</b-field>
|
2019-02-26 14:26:03 +01:00
|
|
|
|
2020-07-08 03:00:12 +02:00
|
|
|
<b-field
|
|
|
|
label="Max upload size"
|
2020-06-29 19:02:47 +02:00
|
|
|
message="Maximum allowed file size in MB"
|
|
|
|
horizontal>
|
2020-07-08 03:00:12 +02:00
|
|
|
<b-input
|
2020-07-10 00:13:51 +02:00
|
|
|
v-model="settings.maxUploadSize"
|
2020-12-25 12:45:22 +01:00
|
|
|
class="chibisafe-input"
|
2020-06-29 19:02:47 +02:00
|
|
|
expanded />
|
|
|
|
</b-field>
|
2019-02-26 14:26:03 +01:00
|
|
|
|
2020-07-08 03:00:12 +02:00
|
|
|
<b-field
|
|
|
|
label="Filename length"
|
2020-06-29 19:02:47 +02:00
|
|
|
message="How many characters long should the generated filenames be"
|
|
|
|
horizontal>
|
2020-07-08 03:00:12 +02:00
|
|
|
<b-input
|
2020-07-10 00:13:51 +02:00
|
|
|
v-model="settings.filenameLength"
|
2020-12-25 12:45:22 +01:00
|
|
|
class="chibisafe-input"
|
2020-06-29 19:02:47 +02:00
|
|
|
expanded />
|
|
|
|
</b-field>
|
2019-02-26 14:26:03 +01:00
|
|
|
|
2020-07-08 03:00:12 +02:00
|
|
|
<b-field
|
|
|
|
label="Album link length"
|
2020-06-29 19:02:47 +02:00
|
|
|
message="How many characters a link for an album should have"
|
|
|
|
horizontal>
|
2020-07-08 03:00:12 +02:00
|
|
|
<b-input
|
2020-07-10 00:13:51 +02:00
|
|
|
v-model="settings.albumLinkLength"
|
2020-12-25 12:45:22 +01:00
|
|
|
class="chibisafe-input"
|
2020-06-29 19:02:47 +02:00
|
|
|
expanded />
|
|
|
|
</b-field>
|
2019-02-26 14:26:03 +01:00
|
|
|
|
2020-07-08 03:00:12 +02:00
|
|
|
<b-field
|
|
|
|
label="Generate thumbnails"
|
2020-06-29 19:02:47 +02:00
|
|
|
message="Generate thumbnails when uploading a file if possible"
|
|
|
|
horizontal>
|
2020-07-08 03:00:12 +02:00
|
|
|
<b-switch
|
2020-07-10 00:13:51 +02:00
|
|
|
v-model="settings.generateThumbnails"
|
2020-06-29 19:02:47 +02:00
|
|
|
:true-value="true"
|
|
|
|
:false-value="false" />
|
|
|
|
</b-field>
|
2019-02-26 14:26:03 +01:00
|
|
|
|
2020-07-08 03:00:12 +02:00
|
|
|
<b-field
|
|
|
|
label="Generate zips"
|
2020-06-29 19:02:47 +02:00
|
|
|
message="Allow generating zips to download entire albums"
|
|
|
|
horizontal>
|
2020-07-08 03:00:12 +02:00
|
|
|
<b-switch
|
2020-07-10 00:13:51 +02:00
|
|
|
v-model="settings.generateZips"
|
2020-06-29 19:02:47 +02:00
|
|
|
:true-value="true"
|
|
|
|
:false-value="false" />
|
|
|
|
</b-field>
|
2019-02-26 14:26:03 +01:00
|
|
|
|
2020-07-08 03:00:12 +02:00
|
|
|
<b-field
|
|
|
|
label="Public mode"
|
2020-06-29 19:02:47 +02:00
|
|
|
message="Enable anonymous uploades"
|
|
|
|
horizontal>
|
2020-07-08 03:00:12 +02:00
|
|
|
<b-switch
|
2020-07-10 00:13:51 +02:00
|
|
|
v-model="settings.publicMode"
|
2020-06-29 19:02:47 +02:00
|
|
|
:true-value="true"
|
|
|
|
:false-value="false" />
|
|
|
|
</b-field>
|
2019-02-26 14:26:03 +01:00
|
|
|
|
2020-07-08 03:00:12 +02:00
|
|
|
<b-field
|
|
|
|
label="Enable creating account"
|
2020-06-29 19:02:47 +02:00
|
|
|
message="Enable creating new accounts in the platform"
|
|
|
|
horizontal>
|
2020-07-08 03:00:12 +02:00
|
|
|
<b-switch
|
2020-07-10 00:13:51 +02:00
|
|
|
v-model="settings.enableAccounts"
|
2020-06-29 19:02:47 +02:00
|
|
|
:true-value="true"
|
|
|
|
:false-value="false" />
|
|
|
|
</b-field>
|
2019-02-26 14:26:03 +01:00
|
|
|
|
2020-06-29 19:02:47 +02:00
|
|
|
<div class="mb2 mt2 text-center">
|
2020-07-08 03:00:12 +02:00
|
|
|
<button
|
|
|
|
class="button is-primary"
|
|
|
|
@click="promptRestartService">
|
|
|
|
Save and restart service
|
|
|
|
</button>
|
2018-09-16 06:09:02 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2020-07-10 00:13:51 +02:00
|
|
|
import { mapState } from 'vuex';
|
2018-09-19 09:45:50 +02:00
|
|
|
import Sidebar from '~/components/sidebar/Sidebar.vue';
|
2018-09-16 06:09:02 +02:00
|
|
|
|
|
|
|
export default {
|
|
|
|
components: {
|
2020-12-24 09:40:50 +01:00
|
|
|
Sidebar
|
2018-09-16 06:09:02 +02:00
|
|
|
},
|
2020-07-10 00:13:51 +02:00
|
|
|
middleware: ['auth', 'admin', ({ store }) => {
|
|
|
|
try {
|
|
|
|
store.dispatch('admin/fetchSettings');
|
|
|
|
} catch (e) {
|
|
|
|
// eslint-disable-next-line no-console
|
|
|
|
console.error(e);
|
|
|
|
}
|
|
|
|
}],
|
2018-09-16 06:09:02 +02:00
|
|
|
metaInfo() {
|
|
|
|
return { title: 'Settings' };
|
|
|
|
},
|
2020-07-10 00:13:51 +02:00
|
|
|
computed: mapState({
|
2020-12-24 15:45:16 +01:00
|
|
|
settings: state => state.admin.settings
|
2020-07-10 00:13:51 +02:00
|
|
|
}),
|
2018-09-16 06:09:02 +02:00
|
|
|
methods: {
|
2019-02-28 15:26:44 +01:00
|
|
|
promptRestartService() {
|
2019-10-12 08:47:25 +02:00
|
|
|
this.$buefy.dialog.confirm({
|
2019-02-28 15:26:44 +01:00
|
|
|
message: 'Keep in mind that restarting only works if you have PM2 or something similar set up. Continue?',
|
2020-12-24 09:40:50 +01:00
|
|
|
onConfirm: () => this.restartService()
|
2019-02-28 15:26:44 +01:00
|
|
|
});
|
|
|
|
},
|
2020-07-10 00:13:51 +02:00
|
|
|
restartService() {
|
|
|
|
this.$handler.executeAction('admin/restartService');
|
2020-12-24 09:40:50 +01:00
|
|
|
}
|
|
|
|
}
|
2018-09-16 06:09:02 +02:00
|
|
|
};
|
|
|
|
</script>
|