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