-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
122 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
packages/backend/migration/1678694614599-sensitive-words.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
export class sensitiveWords1678694614599 { | ||
name = 'sensitiveWords1678694614599' | ||
|
||
async up(queryRunner) { | ||
await queryRunner.query(`ALTER TABLE "meta" ADD "sensitiveWords" character varying(1024) array NOT NULL DEFAULT '{}'`); | ||
} | ||
|
||
async down(queryRunner) { | ||
await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "sensitiveWords"`); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<template> | ||
<div> | ||
<MkStickyContainer> | ||
<template #header><XHeader :tabs="headerTabs"/></template> | ||
<MkSpacer :content-max="700" :margin-min="16" :margin-max="32"> | ||
<FormSuspense :p="init"> | ||
<div class="_gaps_m"> | ||
<FormSection first> | ||
<div class="_gaps_m"> | ||
<MkTextarea v-model="sensitiveWords"> | ||
<template #label>{{ i18n.ts.sensitiveWords }}</template> | ||
<template #caption>{{ i18n.ts.sensitiveWordsDescription }}</template> | ||
</MkTextarea> | ||
</div> | ||
</FormSection> | ||
</div> | ||
</FormSuspense> | ||
</MkSpacer> | ||
<template #footer> | ||
<div :class="$style.footer"> | ||
<MkSpacer :content-max="700" :margin-min="16" :margin-max="16"> | ||
<MkButton primary rounded @click="save"><i class="ti ti-check"></i> {{ i18n.ts.save }}</MkButton> | ||
</MkSpacer> | ||
</div> | ||
</template> | ||
</MkStickyContainer> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { } from 'vue'; | ||
import XHeader from './_header_.vue'; | ||
import MkSwitch from '@/components/MkSwitch.vue'; | ||
import MkInput from '@/components/MkInput.vue'; | ||
import MkTextarea from '@/components/MkTextarea.vue'; | ||
import FormSection from '@/components/form/section.vue'; | ||
import FormSplit from '@/components/form/split.vue'; | ||
import FormSuspense from '@/components/form/suspense.vue'; | ||
import * as os from '@/os'; | ||
import { fetchInstance } from '@/instance'; | ||
import { i18n } from '@/i18n'; | ||
import { definePageMetadata } from '@/scripts/page-metadata'; | ||
import MkButton from '@/components/MkButton.vue'; | ||
let sensitiveWords: string = $ref(''); | ||
async function init() { | ||
const meta = await os.api('admin/meta'); | ||
sensitiveWords = meta.pinnedUsers.join('\n'); | ||
} | ||
function save() { | ||
os.apiWithDialog('admin/update-meta', { | ||
sensitiveWords: sensitiveWords.split('\n'), | ||
}).then(() => { | ||
fetchInstance(); | ||
}); | ||
} | ||
const headerTabs = $computed(() => []); | ||
definePageMetadata({ | ||
title: i18n.ts.moderation, | ||
icon: 'ti ti-shield', | ||
}); | ||
</script> | ||
|
||
<style lang="scss" module> | ||
.footer { | ||
-webkit-backdrop-filter: var(--blur, blur(15px)); | ||
backdrop-filter: var(--blur, blur(15px)); | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters