2022-04-02 15:28:49 +09:00
|
|
|
<template>
|
2023-01-06 13:40:17 +09:00
|
|
|
<div class="_gaps_m">
|
2023-01-05 21:04:56 +09:00
|
|
|
<FormLink :to="`/settings/webhook/new`">
|
|
|
|
Create webhook
|
|
|
|
</FormLink>
|
|
|
|
|
2022-04-02 15:28:49 +09:00
|
|
|
<FormSection>
|
|
|
|
<MkPagination :pagination="pagination">
|
2022-06-20 17:38:49 +09:00
|
|
|
<template #default="{items}">
|
2023-01-05 21:04:56 +09:00
|
|
|
<FormLink v-for="webhook in items" :key="webhook.id" :to="`/settings/webhook/edit/${webhook.id}`" class="_margin">
|
2022-04-02 15:28:49 +09:00
|
|
|
<template #icon>
|
2022-12-19 19:01:30 +09:00
|
|
|
<i v-if="webhook.active === false" class="ti ti-player-pause"></i>
|
2022-12-20 15:24:31 +09:00
|
|
|
<i v-else-if="webhook.latestStatus === null" class="ti ti-circle"></i>
|
2022-12-19 19:01:30 +09:00
|
|
|
<i v-else-if="[200, 201, 204].includes(webhook.latestStatus)" class="ti ti-check" :style="{ color: 'var(--success)' }"></i>
|
|
|
|
<i v-else class="ti ti-alert-triangle" :style="{ color: 'var(--error)' }"></i>
|
2022-04-02 15:28:49 +09:00
|
|
|
</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';
|
2022-09-06 18:21:49 +09:00
|
|
|
import MkPagination from '@/components/MkPagination.vue';
|
2022-04-02 15:28:49 +09:00
|
|
|
import FormSection from '@/components/form/section.vue';
|
|
|
|
import FormLink from '@/components/form/link.vue';
|
2022-06-20 17:38:49 +09:00
|
|
|
import { definePageMetadata } from '@/scripts/page-metadata';
|
2022-04-02 15:28:49 +09:00
|
|
|
|
|
|
|
const pagination = {
|
|
|
|
endpoint: 'i/webhooks/list' as const,
|
|
|
|
limit: 10,
|
|
|
|
};
|
|
|
|
|
2022-06-20 17:38:49 +09:00
|
|
|
const headerActions = $computed(() => []);
|
|
|
|
|
|
|
|
const headerTabs = $computed(() => []);
|
|
|
|
|
|
|
|
definePageMetadata({
|
|
|
|
title: 'Webhook',
|
2022-12-19 19:01:30 +09:00
|
|
|
icon: 'ti ti-webhook',
|
2022-04-02 15:28:49 +09:00
|
|
|
});
|
|
|
|
</script>
|