Sharkey/packages/frontend/src/pages/settings/webhook.vue

58 lines
1.7 KiB
Vue
Raw Normal View History

<!--
SPDX-FileCopyrightText: syuilo and other misskey contributors
SPDX-License-Identifier: AGPL-3.0-only
-->
<template>
2023-01-06 06:40:17 +02:00
<div class="_gaps_m">
2023-01-05 14:04:56 +02:00
<FormLink :to="`/settings/webhook/new`">
{{ i18n.ts._webhookSettings.createWebhook }}
2023-01-05 14:04:56 +02:00
</FormLink>
<FormSection>
<MkPagination :pagination="pagination">
<template #default="{items}">
<div class="_gaps">
<FormLink v-for="webhook in items" :key="webhook.id" :to="`/settings/webhook/edit/${webhook.id}`">
<template #icon>
2023-10-01 01:46:42 +03: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 22:53:52 +03: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>
</template>
{{ webhook.name || webhook.url }}
<template #suffix>
<MkTime v-if="webhook.latestSentAt" :time="webhook.latestSentAt"></MkTime>
</template>
</FormLink>
</div>
</template>
</MkPagination>
</FormSection>
</div>
</template>
<script lang="ts" setup>
import { } from 'vue';
import MkPagination from '@/components/MkPagination.vue';
import FormSection from '@/components/form/section.vue';
import FormLink from '@/components/form/link.vue';
2023-09-19 10:37:43 +03:00
import { definePageMetadata } from '@/scripts/page-metadata.js';
import { i18n } from '@/i18n.js';
const pagination = {
endpoint: 'i/webhooks/list' as const,
limit: 100,
noPaging: true,
};
const headerActions = $computed(() => []);
const headerTabs = $computed(() => []);
definePageMetadata({
title: 'Webhook',
2023-10-01 01:46:42 +03:00
icon: 'ph-webhooks-logo ph-bold ph-lg',
});
</script>