2023-07-27 07:31:52 +02:00
|
|
|
<!--
|
|
|
|
SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
|
2022-04-02 08:28:49 +02:00
|
|
|
<template>
|
2023-01-06 05:40:17 +01:00
|
|
|
<div class="_gaps_m">
|
2023-01-05 13:04:56 +01:00
|
|
|
<FormLink :to="`/settings/webhook/new`">
|
2023-03-24 07:44:26 +01:00
|
|
|
{{ i18n.ts._webhookSettings.createWebhook }}
|
2023-01-05 13:04:56 +01:00
|
|
|
</FormLink>
|
|
|
|
|
2022-04-02 08:28:49 +02:00
|
|
|
<FormSection>
|
|
|
|
<MkPagination :pagination="pagination">
|
2022-06-20 10:38:49 +02:00
|
|
|
<template #default="{items}">
|
2023-04-10 11:56:38 +02:00
|
|
|
<div class="_gaps">
|
|
|
|
<FormLink v-for="webhook in items" :key="webhook.id" :to="`/settings/webhook/edit/${webhook.id}`">
|
|
|
|
<template #icon>
|
2023-10-01 00:46:42 +02:00
|
|
|
<i v-if="webhook.active === false" class="ph-pause ph-bold ph-lg"></i>
|
|
|
|
<i v-else-if="webhook.latestStatus === null" class="ph-circle ph-bold ph-lg"></i>
|
2023-09-30 21:53:52 +02:00
|
|
|
<i v-else-if="[200, 201, 204].includes(webhook.latestStatus)" class="ph-check ph-bold ph-lg" :style="{ color: 'var(--success)' }"></i>
|
|
|
|
<i v-else class="ph-warning ph-bold ph-lg" :style="{ color: 'var(--error)' }"></i>
|
2023-04-10 11:56:38 +02:00
|
|
|
</template>
|
|
|
|
{{ webhook.name || webhook.url }}
|
|
|
|
<template #suffix>
|
|
|
|
<MkTime v-if="webhook.latestSentAt" :time="webhook.latestSentAt"></MkTime>
|
|
|
|
</template>
|
|
|
|
</FormLink>
|
|
|
|
</div>
|
2022-04-02 08:28:49 +02:00
|
|
|
</template>
|
|
|
|
</MkPagination>
|
|
|
|
</FormSection>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
import { } from 'vue';
|
2022-09-06 11:21:49 +02:00
|
|
|
import MkPagination from '@/components/MkPagination.vue';
|
2022-04-02 08:28:49 +02:00
|
|
|
import FormSection from '@/components/form/section.vue';
|
|
|
|
import FormLink from '@/components/form/link.vue';
|
2023-09-19 09:37:43 +02:00
|
|
|
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
|
|
|
import { i18n } from '@/i18n.js';
|
2022-04-02 08:28:49 +02:00
|
|
|
|
|
|
|
const pagination = {
|
|
|
|
endpoint: 'i/webhooks/list' as const,
|
2023-04-10 11:56:38 +02:00
|
|
|
limit: 100,
|
|
|
|
noPaging: true,
|
2022-04-02 08:28:49 +02:00
|
|
|
};
|
|
|
|
|
2022-06-20 10:38:49 +02:00
|
|
|
const headerActions = $computed(() => []);
|
|
|
|
|
|
|
|
const headerTabs = $computed(() => []);
|
|
|
|
|
|
|
|
definePageMetadata({
|
|
|
|
title: 'Webhook',
|
2023-10-01 00:46:42 +02:00
|
|
|
icon: 'ph-webhooks-logo ph-bold ph-lg',
|
2022-04-02 08:28:49 +02:00
|
|
|
});
|
|
|
|
</script>
|