2022-04-02 09:28:49 +03:00
|
|
|
<template>
|
|
|
|
<div class="_formRoot">
|
|
|
|
<FormSection>
|
|
|
|
<FormLink :to="`/settings/webhook/new`">
|
|
|
|
Create webhook
|
|
|
|
</FormLink>
|
|
|
|
</FormSection>
|
|
|
|
|
|
|
|
<FormSection>
|
|
|
|
<MkPagination :pagination="pagination">
|
2022-06-20 11:38:49 +03:00
|
|
|
<template #default="{items}">
|
2022-07-20 17:21:42 +03:00
|
|
|
<FormLink v-for="webhook in items" :key="webhook.id" :to="`/settings/webhook/edit/${webhook.id}`" class="_formBlock">
|
2022-04-02 09:28:49 +03:00
|
|
|
<template #icon>
|
|
|
|
<i v-if="webhook.active === false" class="fas fa-circle-pause"></i>
|
|
|
|
<i v-else-if="webhook.latestStatus === null" class="far fa-circle"></i>
|
2022-12-19 06:53:41 +02:00
|
|
|
<i v-else-if="[200, 201, 204].includes(webhook.latestStatus)" class="ti ti-check" :style="{ color: 'var(--success)' }"></i>
|
2022-04-02 09:28:49 +03:00
|
|
|
<i v-else class="fas fa-triangle-exclamation" :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';
|
2022-09-06 12:21:49 +03:00
|
|
|
import MkPagination from '@/components/MkPagination.vue';
|
2022-04-02 09:28:49 +03:00
|
|
|
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';
|
2022-06-20 11:38:49 +03:00
|
|
|
import { definePageMetadata } from '@/scripts/page-metadata';
|
2022-04-02 09:28:49 +03:00
|
|
|
|
|
|
|
const pagination = {
|
|
|
|
endpoint: 'i/webhooks/list' as const,
|
|
|
|
limit: 10,
|
|
|
|
};
|
|
|
|
|
2022-06-20 11:38:49 +03:00
|
|
|
const headerActions = $computed(() => []);
|
|
|
|
|
|
|
|
const headerTabs = $computed(() => []);
|
|
|
|
|
|
|
|
definePageMetadata({
|
|
|
|
title: 'Webhook',
|
|
|
|
icon: 'fas fa-bolt',
|
2022-04-02 09:28:49 +03:00
|
|
|
});
|
|
|
|
</script>
|