2021-09-01 21:39:40 -08:00
|
|
|
<template>
|
2021-09-04 20:24:32 -08:00
|
|
|
<v-container class="narrow-container">
|
|
|
|
<BasePageTitle divider>
|
|
|
|
<template #header>
|
2025-06-20 00:09:12 +07:00
|
|
|
<v-img
|
|
|
|
width="100%"
|
|
|
|
max-height="125"
|
|
|
|
max-width="125"
|
|
|
|
:src="require('~/static/svgs/manage-webhooks.svg')"
|
|
|
|
/>
|
|
|
|
</template>
|
|
|
|
<template #title>
|
|
|
|
{{ $t('settings.webhooks.webhooks') }}
|
2021-09-04 20:24:32 -08:00
|
|
|
</template>
|
2022-06-17 13:25:47 -08:00
|
|
|
<v-card-text class="pb-0">
|
2023-03-21 20:45:27 +01:00
|
|
|
{{ $t('settings.webhooks.description') }}
|
2022-06-17 13:25:47 -08:00
|
|
|
</v-card-text>
|
2021-09-04 20:24:32 -08:00
|
|
|
</BasePageTitle>
|
|
|
|
|
2025-06-20 00:09:12 +07:00
|
|
|
<BaseButton
|
|
|
|
create
|
|
|
|
@click="actions.createOne()"
|
|
|
|
/>
|
2021-09-01 21:39:40 -08:00
|
|
|
<v-expansion-panels class="mt-2">
|
2025-06-20 00:09:12 +07:00
|
|
|
<v-expansion-panel
|
|
|
|
v-for="(webhook, index) in webhooks"
|
|
|
|
:key="index"
|
|
|
|
class="my-2 left-border rounded"
|
|
|
|
>
|
|
|
|
<v-expansion-panel-title
|
|
|
|
disable-icon-rotate
|
|
|
|
class="headline"
|
|
|
|
>
|
2021-09-01 21:39:40 -08:00
|
|
|
<div class="d-flex align-center">
|
2025-06-20 00:09:12 +07:00
|
|
|
<v-icon
|
|
|
|
size="large"
|
|
|
|
start
|
|
|
|
:color="webhook.enabled ? 'info' : undefined"
|
|
|
|
>
|
2021-09-01 21:39:40 -08:00
|
|
|
{{ $globals.icons.webhook }}
|
|
|
|
</v-icon>
|
2023-03-21 20:45:27 +01:00
|
|
|
{{ webhook.name }} - {{ $d(timeUTC(webhook.scheduledTime), "time") }}
|
2021-09-01 21:39:40 -08:00
|
|
|
</div>
|
|
|
|
<template #actions>
|
2025-06-20 00:09:12 +07:00
|
|
|
<v-btn
|
|
|
|
size="small"
|
|
|
|
icon
|
|
|
|
flat
|
|
|
|
class="ml-2"
|
|
|
|
>
|
2022-01-09 21:04:24 -09:00
|
|
|
<v-icon>
|
2021-09-01 21:39:40 -08:00
|
|
|
{{ $globals.icons.edit }}
|
|
|
|
</v-icon>
|
|
|
|
</v-btn>
|
|
|
|
</template>
|
2025-06-20 00:09:12 +07:00
|
|
|
</v-expansion-panel-title>
|
|
|
|
<v-expansion-panel-text>
|
2022-06-17 13:25:47 -08:00
|
|
|
<GroupWebhookEditor
|
|
|
|
:key="webhook.id"
|
|
|
|
:webhook="webhook"
|
|
|
|
@save="actions.updateOne($event)"
|
|
|
|
@delete="actions.deleteOne($event)"
|
2025-06-20 00:09:12 +07:00
|
|
|
@test="actions.testOne($event).then(() => alert.success($t('events.test-message-sent')))"
|
2022-06-17 13:25:47 -08:00
|
|
|
/>
|
2025-06-20 00:09:12 +07:00
|
|
|
</v-expansion-panel-text>
|
2021-09-01 21:39:40 -08:00
|
|
|
</v-expansion-panel>
|
|
|
|
</v-expansion-panels>
|
|
|
|
</v-container>
|
|
|
|
</template>
|
2022-03-23 04:54:16 +01:00
|
|
|
|
2021-09-01 21:39:40 -08:00
|
|
|
<script lang="ts">
|
2023-03-21 20:45:27 +01:00
|
|
|
import { useGroupWebhooks, timeUTC } from "~/composables/use-group-webhooks";
|
2024-08-22 10:14:32 -05:00
|
|
|
import GroupWebhookEditor from "~/components/Domain/Household/GroupWebhookEditor.vue";
|
2024-07-06 14:10:01 -05:00
|
|
|
import { alert } from "~/composables/use-toast";
|
2021-09-01 21:39:40 -08:00
|
|
|
|
2025-06-20 00:09:12 +07:00
|
|
|
export default defineNuxtComponent({
|
2022-06-17 13:25:47 -08:00
|
|
|
components: { GroupWebhookEditor },
|
2025-06-20 00:09:12 +07:00
|
|
|
middleware: ["sidebase-auth", "advanced-only"],
|
2021-09-01 21:39:40 -08:00
|
|
|
setup() {
|
2025-06-20 00:09:12 +07:00
|
|
|
const i18n = useI18n();
|
2021-09-01 21:39:40 -08:00
|
|
|
const { actions, webhooks } = useGroupWebhooks();
|
2021-09-04 20:24:32 -08:00
|
|
|
|
2025-06-20 00:09:12 +07:00
|
|
|
useSeoMeta({
|
|
|
|
title: i18n.t("settings.webhooks.webhooks"),
|
|
|
|
});
|
|
|
|
|
2021-09-01 21:39:40 -08:00
|
|
|
return {
|
2024-07-06 14:10:01 -05:00
|
|
|
alert,
|
2021-09-01 21:39:40 -08:00
|
|
|
webhooks,
|
2021-09-04 20:24:32 -08:00
|
|
|
actions,
|
2025-06-20 00:09:12 +07:00
|
|
|
timeUTC,
|
2021-10-07 09:39:47 -08:00
|
|
|
};
|
|
|
|
},
|
2021-09-01 21:39:40 -08:00
|
|
|
});
|
2022-03-23 04:54:16 +01:00
|
|
|
</script>
|