2022-04-02 15:28:49 +09:00
|
|
|
<template>
|
2023-04-08 09:01:42 +09:00
|
|
|
<div class="_formRoot">
|
|
|
|
<FormSection>
|
|
|
|
<FormLink :to="`/settings/webhook/new`"> Create webhook </FormLink>
|
|
|
|
</FormSection>
|
2022-11-14 06:36:17 +09:00
|
|
|
|
2023-04-08 09:01:42 +09:00
|
|
|
<FormSection>
|
|
|
|
<MkPagination :pagination="pagination">
|
|
|
|
<template #default="{ items }">
|
|
|
|
<FormLink
|
|
|
|
v-for="webhook in items"
|
|
|
|
:key="webhook.id"
|
|
|
|
:to="`/settings/webhook/edit/${webhook.id}`"
|
|
|
|
class="_formBlock"
|
|
|
|
>
|
|
|
|
<template #icon>
|
|
|
|
<i
|
|
|
|
v-if="webhook.active === false"
|
|
|
|
class="ph-pause-circle ph-bold ph-lg"
|
|
|
|
></i>
|
|
|
|
<i
|
|
|
|
v-else-if="webhook.latestStatus === null"
|
|
|
|
class="ph-circle ph-fill"
|
|
|
|
></i>
|
|
|
|
<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>
|
|
|
|
</template>
|
|
|
|
</MkPagination>
|
|
|
|
</FormSection>
|
|
|
|
</div>
|
2022-04-02 15:28:49 +09:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
2023-04-08 09:01:42 +09:00
|
|
|
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";
|
2022-04-02 15:28:49 +09:00
|
|
|
|
|
|
|
const pagination = {
|
2023-04-08 09:01:42 +09:00
|
|
|
endpoint: "i/webhooks/list" as const,
|
2022-04-02 15:28:49 +09:00
|
|
|
limit: 10,
|
|
|
|
};
|
|
|
|
|
2022-06-20 17:38:49 +09:00
|
|
|
const headerActions = $computed(() => []);
|
|
|
|
|
|
|
|
const headerTabs = $computed(() => []);
|
|
|
|
|
|
|
|
definePageMetadata({
|
2023-04-08 09:01:42 +09:00
|
|
|
title: "Webhook",
|
|
|
|
icon: "ph-lightning ph-bold ph-lg",
|
2022-04-02 15:28:49 +09:00
|
|
|
});
|
|
|
|
</script>
|