2020-02-16 11:21:27 -06:00
|
|
|
<template>
|
2021-04-22 08:29:33 -05:00
|
|
|
<FormBase>
|
|
|
|
<FormSuspense :p="init">
|
|
|
|
<FormInput v-model:value="name">
|
|
|
|
<span>{{ $ts.instanceName }}</span>
|
|
|
|
</FormInput>
|
|
|
|
|
|
|
|
<FormTextarea v-model:value="description">
|
|
|
|
<span>{{ $ts.instanceDescription }}</span>
|
|
|
|
</FormTextarea>
|
|
|
|
|
|
|
|
<FormInput v-model:value="iconUrl">
|
|
|
|
<template #prefix><i class="fas fa-link"></i></template>
|
|
|
|
<span>{{ $ts.iconUrl }}</span>
|
|
|
|
</FormInput>
|
|
|
|
|
|
|
|
<FormInput v-model:value="bannerUrl">
|
|
|
|
<template #prefix><i class="fas fa-link"></i></template>
|
|
|
|
<span>{{ $ts.bannerUrl }}</span>
|
|
|
|
</FormInput>
|
|
|
|
|
|
|
|
<FormInput v-model:value="tosUrl">
|
|
|
|
<template #prefix><i class="fas fa-link"></i></template>
|
|
|
|
<span>{{ $ts.tosUrl }}</span>
|
|
|
|
</FormInput>
|
|
|
|
|
|
|
|
<FormInput v-model:value="maintainerName">
|
|
|
|
<span>{{ $ts.maintainerName }}</span>
|
|
|
|
</FormInput>
|
|
|
|
|
|
|
|
<FormInput v-model:value="maintainerEmail" type="email">
|
|
|
|
<template #prefix><i class="fas fa-envelope"></i></template>
|
|
|
|
<span>{{ $ts.maintainerEmail }}</span>
|
|
|
|
</FormInput>
|
|
|
|
|
|
|
|
<FormInput v-model:value="maxNoteTextLength" type="number">
|
|
|
|
<template #prefix><i class="fas fa-pencil-alt"></i></template>
|
|
|
|
<span>{{ $ts.maxNoteTextLength }}</span>
|
|
|
|
</FormInput>
|
|
|
|
|
|
|
|
<FormSwitch v-model:value="enableLocalTimeline">{{ $ts.enableLocalTimeline }}</FormSwitch>
|
|
|
|
<FormSwitch v-model:value="enableGlobalTimeline">{{ $ts.enableGlobalTimeline }}</FormSwitch>
|
|
|
|
<FormInfo>{{ $ts.disablingTimelinesInfo }}</FormInfo>
|
|
|
|
|
|
|
|
<FormButton @click="save" primary><i class="fas fa-save"></i> {{ $ts.save }}</FormButton>
|
|
|
|
</FormSuspense>
|
|
|
|
</FormBase>
|
2020-02-16 11:21:27 -06:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2021-04-22 08:29:33 -05:00
|
|
|
import { defineComponent } from 'vue';
|
|
|
|
import FormSwitch from '@client/components/form/switch.vue';
|
|
|
|
import FormInput from '@client/components/form/input.vue';
|
|
|
|
import FormButton from '@client/components/form/button.vue';
|
|
|
|
import FormBase from '@client/components/form/base.vue';
|
|
|
|
import FormGroup from '@client/components/form/group.vue';
|
|
|
|
import FormTextarea from '@client/components/form/textarea.vue';
|
|
|
|
import FormInfo from '@client/components/form/info.vue';
|
|
|
|
import FormSuspense from '@client/components/form/suspense.vue';
|
2021-03-23 03:30:14 -05:00
|
|
|
import * as os from '@client/os';
|
2021-04-09 22:54:12 -05:00
|
|
|
import * as symbols from '@client/symbols';
|
2021-04-22 08:29:33 -05:00
|
|
|
import { fetchInstance } from '@client/instance';
|
2020-02-16 11:21:27 -06:00
|
|
|
|
2020-10-17 06:12:00 -05:00
|
|
|
export default defineComponent({
|
2020-02-16 11:21:27 -06:00
|
|
|
components: {
|
2021-04-22 08:29:33 -05:00
|
|
|
FormSwitch,
|
|
|
|
FormInput,
|
|
|
|
FormBase,
|
|
|
|
FormGroup,
|
|
|
|
FormButton,
|
|
|
|
FormTextarea,
|
|
|
|
FormInfo,
|
|
|
|
FormSuspense,
|
2020-02-16 11:21:27 -06:00
|
|
|
},
|
|
|
|
|
2021-04-22 08:29:33 -05:00
|
|
|
emits: ['info'],
|
|
|
|
|
2020-02-16 11:21:27 -06:00
|
|
|
data() {
|
|
|
|
return {
|
2021-04-09 22:54:12 -05:00
|
|
|
[symbols.PAGE_INFO]: {
|
2021-04-22 08:29:33 -05:00
|
|
|
title: this.$ts.general,
|
|
|
|
icon: 'fas fa-cog'
|
2020-10-17 06:12:00 -05:00
|
|
|
},
|
2020-02-16 11:21:27 -06:00
|
|
|
name: null,
|
|
|
|
description: null,
|
2020-07-25 21:05:26 -05:00
|
|
|
tosUrl: null as string | null,
|
2021-04-22 08:29:33 -05:00
|
|
|
maintainerName: null,
|
|
|
|
maintainerEmail: null,
|
2020-02-16 11:21:27 -06:00
|
|
|
iconUrl: null,
|
2021-04-22 08:29:33 -05:00
|
|
|
bannerUrl: null,
|
2020-02-16 11:21:27 -06:00
|
|
|
maxNoteTextLength: 0,
|
|
|
|
enableLocalTimeline: false,
|
|
|
|
enableGlobalTimeline: false,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2021-04-22 08:29:33 -05:00
|
|
|
async mounted() {
|
|
|
|
this.$emit('info', this[symbols.PAGE_INFO]);
|
2020-04-28 19:35:37 -05:00
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
2021-04-22 08:29:33 -05:00
|
|
|
async init() {
|
|
|
|
const meta = await os.api('meta', { detail: true });
|
|
|
|
this.name = meta.name;
|
|
|
|
this.description = meta.description;
|
|
|
|
this.tosUrl = meta.tosUrl;
|
|
|
|
this.iconUrl = meta.iconUrl;
|
|
|
|
this.bannerUrl = meta.bannerUrl;
|
|
|
|
this.maintainerName = meta.maintainerName;
|
|
|
|
this.maintainerEmail = meta.maintainerEmail;
|
|
|
|
this.maxNoteTextLength = meta.maxNoteTextLength;
|
|
|
|
this.enableLocalTimeline = !meta.disableLocalTimeline;
|
|
|
|
this.enableGlobalTimeline = !meta.disableGlobalTimeline;
|
2020-03-21 09:27:54 -05:00
|
|
|
},
|
|
|
|
|
2021-04-22 08:29:33 -05:00
|
|
|
save() {
|
|
|
|
os.apiWithDialog('admin/update-meta', {
|
2020-02-16 11:21:27 -06:00
|
|
|
name: this.name,
|
|
|
|
description: this.description,
|
|
|
|
tosUrl: this.tosUrl,
|
|
|
|
iconUrl: this.iconUrl,
|
2021-04-22 08:29:33 -05:00
|
|
|
bannerUrl: this.bannerUrl,
|
2020-02-16 11:21:27 -06:00
|
|
|
maintainerName: this.maintainerName,
|
|
|
|
maintainerEmail: this.maintainerEmail,
|
|
|
|
maxNoteTextLength: this.maxNoteTextLength,
|
|
|
|
disableLocalTimeline: !this.enableLocalTimeline,
|
|
|
|
disableGlobalTimeline: !this.enableGlobalTimeline,
|
|
|
|
}).then(() => {
|
2020-12-18 19:55:52 -06:00
|
|
|
fetchInstance();
|
2020-02-16 11:21:27 -06:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|