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
|
|
|
|
2021-01-10 01:04:35 +01:00
|
|
|
<JoiObject :keys="settingsSchema.keys" :values="{}" />
|
2018-09-16 06:09:02 +02:00
|
|
|
</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';
|
2021-01-10 01:04:35 +01:00
|
|
|
import JoiObject from '~/components/settings/JoiObject.vue';
|
2018-09-16 06:09:02 +02:00
|
|
|
|
|
|
|
export default {
|
|
|
|
components: {
|
2021-01-10 01:04:35 +01:00
|
|
|
Sidebar,
|
|
|
|
JoiObject
|
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');
|
2021-01-10 01:04:35 +01:00
|
|
|
store.dispatch('admin/getSettingsSchema');
|
2020-07-10 00:13:51 +02:00
|
|
|
} catch (e) {
|
|
|
|
// eslint-disable-next-line no-console
|
|
|
|
console.error(e);
|
|
|
|
}
|
|
|
|
}],
|
|
|
|
computed: mapState({
|
2021-01-10 01:04:35 +01:00
|
|
|
settings: state => state.admin.settings,
|
|
|
|
settingsSchema: state => state.admin.settingsSchema
|
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
|
|
|
}
|
2021-01-04 17:27:39 +01:00
|
|
|
},
|
|
|
|
head() {
|
|
|
|
return {
|
|
|
|
title: 'Service settings'
|
|
|
|
};
|
2020-12-24 09:40:50 +01:00
|
|
|
}
|
2018-09-16 06:09:02 +02:00
|
|
|
};
|
|
|
|
</script>
|