iceshrimp/packages/client/src/pages/settings/webhook.vue

54 lines
1.6 KiB
Vue
Raw Normal View History

<template>
<div class="_formRoot">
<FormSection>
<FormLink :to="`/settings/webhook/new`">
Create webhook
</FormLink>
</FormSection>
2022-11-14 06:36:17 +09:00
<FormSection>
<MkPagination :pagination="pagination">
<template #default="{items}">
2022-07-20 23:21:42 +09:00
<FormLink v-for="webhook in items" :key="webhook.id" :to="`/settings/webhook/edit/${webhook.id}`" class="_formBlock">
<template #icon>
2022-11-07 11:49:47 +09:00
<i v-if="webhook.active === false" class="ph-pause-circle-bold ph-lg"></i>
2022-11-14 06:36:17 +09:00
<i v-else-if="webhook.latestStatus === null" class="ph-circle-fill"></i>
2022-11-07 11:49:47 +09:00
<i v-else-if="[200, 201, 204].includes(webhook.latestStatus)" class="ph-check-bold ph-lg" :style="{ color: 'var(--success)' }"></i>
<i v-else class="ph-warning-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>
</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';
import { userPage } from '@/filters/user';
import * as os from '@/os';
import { i18n } from '@/i18n';
import { definePageMetadata } from '@/scripts/page-metadata';
const pagination = {
endpoint: 'i/webhooks/list' as const,
limit: 10,
};
const headerActions = $computed(() => []);
const headerTabs = $computed(() => []);
definePageMetadata({
title: 'Webhook',
2022-11-07 11:49:47 +09:00
icon: 'ph-lightning-bold ph-lg',
});
</script>