2022-04-02 01:28:49 -05:00
|
|
|
<template>
|
2023-01-05 22:40:17 -06:00
|
|
|
<div class="_gaps_m">
|
2023-01-05 06:04:56 -06:00
|
|
|
<FormLink :to="`/settings/webhook/new`">
|
2023-03-24 01:44:26 -05:00
|
|
|
{{ i18n.ts._webhookSettings.createWebhook }}
|
2023-01-05 06:04:56 -06:00
|
|
|
</FormLink>
|
|
|
|
|
2022-04-02 01:28:49 -05:00
|
|
|
<FormSection>
|
|
|
|
<MkPagination :pagination="pagination">
|
2022-06-20 03:38:49 -05:00
|
|
|
<template #default="{items}">
|
2023-04-10 04:56:38 -05:00
|
|
|
<div class="_gaps">
|
|
|
|
<FormLink v-for="webhook in items" :key="webhook.id" :to="`/settings/webhook/edit/${webhook.id}`">
|
|
|
|
<template #icon>
|
|
|
|
<i v-if="webhook.active === false" class="ti ti-player-pause"></i>
|
|
|
|
<i v-else-if="webhook.latestStatus === null" class="ti ti-circle"></i>
|
|
|
|
<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>
|
|
|
|
</template>
|
|
|
|
{{ webhook.name || webhook.url }}
|
|
|
|
<template #suffix>
|
|
|
|
<MkTime v-if="webhook.latestSentAt" :time="webhook.latestSentAt"></MkTime>
|
|
|
|
</template>
|
|
|
|
</FormLink>
|
|
|
|
</div>
|
2022-04-02 01:28:49 -05:00
|
|
|
</template>
|
|
|
|
</MkPagination>
|
|
|
|
</FormSection>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
import { } from 'vue';
|
2022-09-06 04:21:49 -05:00
|
|
|
import MkPagination from '@/components/MkPagination.vue';
|
2022-04-02 01:28:49 -05:00
|
|
|
import FormSection from '@/components/form/section.vue';
|
|
|
|
import FormLink from '@/components/form/link.vue';
|
2022-06-20 03:38:49 -05:00
|
|
|
import { definePageMetadata } from '@/scripts/page-metadata';
|
2023-03-24 01:44:26 -05:00
|
|
|
import { i18n } from '@/i18n';
|
2022-04-02 01:28:49 -05:00
|
|
|
|
|
|
|
const pagination = {
|
|
|
|
endpoint: 'i/webhooks/list' as const,
|
2023-04-10 04:56:38 -05:00
|
|
|
limit: 100,
|
|
|
|
noPaging: true,
|
2022-04-02 01:28:49 -05:00
|
|
|
};
|
|
|
|
|
2022-06-20 03:38:49 -05:00
|
|
|
const headerActions = $computed(() => []);
|
|
|
|
|
|
|
|
const headerTabs = $computed(() => []);
|
|
|
|
|
|
|
|
definePageMetadata({
|
|
|
|
title: 'Webhook',
|
2022-12-19 04:01:30 -06:00
|
|
|
icon: 'ti ti-webhook',
|
2022-04-02 01:28:49 -05:00
|
|
|
});
|
|
|
|
</script>
|