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

71 lines
1.7 KiB
Vue
Raw Normal View History

<template>
2023-04-08 02:01:42 +02:00
<div class="_formRoot">
<FormSection>
<FormLink :to="`/settings/webhook/new`"> Create webhook </FormLink>
</FormSection>
2022-11-13 22:36:17 +01:00
2023-04-08 02:01:42 +02: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="icon('ph-pause-circle')"
2023-04-08 02:01:42 +02:00
></i>
<i
v-else-if="webhook.latestStatus === null"
class="ph-circle ph-fill"
></i>
<i
v-else-if="
[200, 201, 204].includes(
2023-07-06 03:28:27 +02:00
webhook.latestStatus,
2023-04-08 02:01:42 +02:00
)
"
:class="icon('ph-check')"
2023-04-08 02:01:42 +02:00
:style="{ color: 'var(--success)' }"
></i>
<i
v-else
:class="icon('ph-warning')"
2023-04-08 02:01:42 +02:00
: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>
2023-04-08 02:01:42 +02:00
import MkPagination from "@/components/MkPagination.vue";
import FormSection from "@/components/form/section.vue";
import FormLink from "@/components/form/link.vue";
import { definePageMetadata } from "@/scripts/page-metadata";
import icon from "@/scripts/icon";
const pagination = {
2023-04-08 02:01:42 +02:00
endpoint: "i/webhooks/list" as const,
limit: 10,
};
definePageMetadata({
2023-04-08 02:01:42 +02:00
title: "Webhook",
icon: `${icon("ph-webhooks-logo")}`,
});
</script>