feat(frontend/channel-editor): support isSensitive in create/edit channel page
This commit is contained in:
parent
11593a76b0
commit
fb91b8cb95
|
@ -15,6 +15,10 @@
|
|||
<template #label>{{ i18n.ts.color }}</template>
|
||||
</MkColorInput>
|
||||
|
||||
<MkSwitch v-model="isSensitive">
|
||||
<template #label>{{ i18n.ts.sensitive }}</template>
|
||||
</MkSwitch>
|
||||
|
||||
<div>
|
||||
<MkButton v-if="bannerId == null" @click="setBannerImage"><i class="ti ti-plus"></i> {{ i18n.ts._channel.setBanner }}</MkButton>
|
||||
<div v-else-if="bannerUrl">
|
||||
|
@ -67,6 +71,7 @@ import { useRouter } from '@/router';
|
|||
import { definePageMetadata } from '@/scripts/page-metadata';
|
||||
import { i18n } from '@/i18n';
|
||||
import MkFolder from '@/components/MkFolder.vue';
|
||||
import MkSwitch from "@/components/MkSwitch.vue";
|
||||
|
||||
const Sortable = defineAsyncComponent(() => import('vuedraggable').then(x => x.default));
|
||||
|
||||
|
@ -82,6 +87,7 @@ let description = $ref(null);
|
|||
let bannerUrl = $ref<string | null>(null);
|
||||
let bannerId = $ref<string | null>(null);
|
||||
let color = $ref('#000');
|
||||
let isSensitive = $ref(false);
|
||||
const pinnedNotes = ref([]);
|
||||
|
||||
watch(() => bannerId, async () => {
|
||||
|
@ -105,6 +111,7 @@ async function fetchChannel() {
|
|||
description = channel.description;
|
||||
bannerId = channel.bannerId;
|
||||
bannerUrl = channel.bannerUrl;
|
||||
isSensitive = channel.isSensitive;
|
||||
pinnedNotes.value = channel.pinnedNoteIds.map(id => ({
|
||||
id,
|
||||
}));
|
||||
|
@ -137,6 +144,7 @@ function save() {
|
|||
bannerId: bannerId,
|
||||
pinnedNoteIds: pinnedNotes.value.map(x => x.id),
|
||||
color: color,
|
||||
isSensitive: isSensitive,
|
||||
};
|
||||
|
||||
if (props.channelId) {
|
||||
|
|
Loading…
Reference in New Issue