feat: 通報を受けた際にメールまたはWebhookで通知を送出出来るようにする (#13758)
* feat: 通報を受けた際にメールまたはWebhookで通知を送出出来るようにする * モデログに対応&エンドポイントを単一オブジェクトでのサポートに変更(API経由で大量に作るシチュエーションもないと思うので) * fix spdx * fix migration * fix migration * fix models * add e2e webhook * tweak * fix modlog * fix bugs * add tests and fix bugs * add tests and fix bugs * add tests * fix path * regenerate locale * 混入除去 * 混入除去 * add abuseReportResolved * fix pnpm-lock.yaml * add abuseReportResolved test * fix bugs * fix ui * add tests * fix CHANGELOG.md * add tests * add RoleService.getModeratorIds tests * WebhookServiceをUserとSystemに分割 * fix CHANGELOG.md * fix test * insertOneを使う用に * fix * regenerate locales * revert version * separate webhook job queue * fix * 🎨 * Update QueueProcessorService.ts --------- Co-authored-by: osamu <46447427+sam-osamu@users.noreply.github.com> Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
This commit is contained in:
96
packages/frontend/src/pages/admin/system-webhook.vue
Normal file
96
packages/frontend/src/pages/admin/system-webhook.vue
Normal file
@@ -0,0 +1,96 @@
|
||||
<!--
|
||||
SPDX-FileCopyrightText: syuilo and misskey-project
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
-->
|
||||
|
||||
<template>
|
||||
<MkStickyContainer>
|
||||
<template #header>
|
||||
<XHeader :actions="headerActions" :tabs="headerTabs"/>
|
||||
</template>
|
||||
|
||||
<MkSpacer :contentMax="900">
|
||||
<div class="_gaps_m">
|
||||
<MkButton :class="$style.linkButton" full @click="onCreateWebhookClicked">
|
||||
{{ i18n.ts._webhookSettings.createWebhook }}
|
||||
</MkButton>
|
||||
|
||||
<FormSection>
|
||||
<div class="_gaps">
|
||||
<XItem v-for="item in webhooks" :key="item.id" :entity="item" @edit="onEditButtonClicked" @delete="onDeleteButtonClicked"/>
|
||||
</div>
|
||||
</FormSection>
|
||||
</div>
|
||||
</MkSpacer>
|
||||
</MkStickyContainer>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, onMounted, ref } from 'vue';
|
||||
import { entities } from 'misskey-js';
|
||||
import XItem from './system-webhook.item.vue';
|
||||
import FormSection from '@/components/form/section.vue';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import XHeader from '@/pages/admin/_header_.vue';
|
||||
import MkButton from '@/components/MkButton.vue';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { showSystemWebhookEditorDialog } from '@/components/MkSystemWebhookEditor.impl.js';
|
||||
import * as os from '@/os.js';
|
||||
|
||||
const webhooks = ref<entities.SystemWebhook[]>([]);
|
||||
|
||||
const headerActions = computed(() => []);
|
||||
const headerTabs = computed(() => []);
|
||||
|
||||
async function onCreateWebhookClicked() {
|
||||
await showSystemWebhookEditorDialog({
|
||||
mode: 'create',
|
||||
});
|
||||
|
||||
await fetchWebhooks();
|
||||
}
|
||||
|
||||
async function onEditButtonClicked(webhook: entities.SystemWebhook) {
|
||||
await showSystemWebhookEditorDialog({
|
||||
mode: 'edit',
|
||||
id: webhook.id,
|
||||
});
|
||||
|
||||
await fetchWebhooks();
|
||||
}
|
||||
|
||||
async function onDeleteButtonClicked(webhook: entities.SystemWebhook) {
|
||||
const result = await os.confirm({
|
||||
type: 'warning',
|
||||
title: i18n.ts._webhookSettings.deleteConfirm,
|
||||
});
|
||||
if (!result.canceled) {
|
||||
await misskeyApi('admin/system-webhook/delete', {
|
||||
id: webhook.id,
|
||||
});
|
||||
await fetchWebhooks();
|
||||
}
|
||||
}
|
||||
|
||||
async function fetchWebhooks() {
|
||||
const result = await misskeyApi('admin/system-webhook/list', {});
|
||||
webhooks.value = result.sort((a, b) => a.id.localeCompare(b.id));
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
await fetchWebhooks();
|
||||
});
|
||||
|
||||
definePageMetadata(() => ({
|
||||
title: 'SystemWebhook',
|
||||
icon: 'ti ti-webhook',
|
||||
}));
|
||||
</script>
|
||||
|
||||
<style module lang="scss">
|
||||
.linkButton {
|
||||
text-align: left;
|
||||
padding: 10px 18px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user