|
|
@ -4,18 +4,27 @@ import type { AuditType } from 'nocodb-sdk' |
|
|
|
import { |
|
|
|
import { |
|
|
|
Form, |
|
|
|
Form, |
|
|
|
MetaInj, |
|
|
|
MetaInj, |
|
|
|
|
|
|
|
computed, |
|
|
|
extractSdkResponseErrorMsg, |
|
|
|
extractSdkResponseErrorMsg, |
|
|
|
fieldRequiredValidator, |
|
|
|
fieldRequiredValidator, |
|
|
|
inject, |
|
|
|
inject, |
|
|
|
message, |
|
|
|
message, |
|
|
|
onMounted, |
|
|
|
onMounted, |
|
|
|
reactive, |
|
|
|
reactive, |
|
|
|
|
|
|
|
ref, |
|
|
|
useApi, |
|
|
|
useApi, |
|
|
|
useI18n, |
|
|
|
useI18n, |
|
|
|
useNuxtApp, |
|
|
|
useNuxtApp, |
|
|
|
|
|
|
|
watch, |
|
|
|
} from '#imports' |
|
|
|
} from '#imports' |
|
|
|
|
|
|
|
|
|
|
|
const emit = defineEmits(['backToList', 'editOrAdd']) |
|
|
|
interface Props { |
|
|
|
|
|
|
|
hook?: Record<string, any> |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const props = defineProps<Props>() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const emit = defineEmits(['backToList']) |
|
|
|
|
|
|
|
|
|
|
|
const { t } = useI18n() |
|
|
|
const { t } = useI18n() |
|
|
|
|
|
|
|
|
|
|
@ -155,16 +164,13 @@ const formInput = ref({ |
|
|
|
], |
|
|
|
], |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
const eventList = ref([ |
|
|
|
const eventList = [ |
|
|
|
// {text: ["Before", "Insert"], value: ['before', 'insert']}, |
|
|
|
|
|
|
|
{ text: ['After', 'Insert'], value: ['after', 'insert'] }, |
|
|
|
{ text: ['After', 'Insert'], value: ['after', 'insert'] }, |
|
|
|
// {text: ["Before", "Update"], value: ['before', 'update']}, |
|
|
|
|
|
|
|
{ text: ['After', 'Update'], value: ['after', 'update'] }, |
|
|
|
{ text: ['After', 'Update'], value: ['after', 'update'] }, |
|
|
|
// {text: ["Before", "Delete"], value: ['before', 'delete']}, |
|
|
|
|
|
|
|
{ text: ['After', 'Delete'], value: ['after', 'delete'] }, |
|
|
|
{ text: ['After', 'Delete'], value: ['after', 'delete'] }, |
|
|
|
]) |
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
const notificationList = ref([ |
|
|
|
const notificationList = [ |
|
|
|
{ type: 'URL' }, |
|
|
|
{ type: 'URL' }, |
|
|
|
{ type: 'Email' }, |
|
|
|
{ type: 'Email' }, |
|
|
|
{ type: 'Slack' }, |
|
|
|
{ type: 'Slack' }, |
|
|
@ -173,16 +179,16 @@ const notificationList = ref([ |
|
|
|
{ type: 'Mattermost' }, |
|
|
|
{ type: 'Mattermost' }, |
|
|
|
{ type: 'Twilio' }, |
|
|
|
{ type: 'Twilio' }, |
|
|
|
{ type: 'Whatsapp Twilio' }, |
|
|
|
{ type: 'Whatsapp Twilio' }, |
|
|
|
]) |
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
const methodList = ref([ |
|
|
|
const methodList = [ |
|
|
|
{ title: 'GET' }, |
|
|
|
{ title: 'GET' }, |
|
|
|
{ title: 'POST' }, |
|
|
|
{ title: 'POST' }, |
|
|
|
{ title: 'DELETE' }, |
|
|
|
{ title: 'DELETE' }, |
|
|
|
{ title: 'PUT' }, |
|
|
|
{ title: 'PUT' }, |
|
|
|
{ title: 'HEAD' }, |
|
|
|
{ title: 'HEAD' }, |
|
|
|
{ title: 'PATCH' }, |
|
|
|
{ title: 'PATCH' }, |
|
|
|
]) |
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
const validators = computed(() => { |
|
|
|
const validators = computed(() => { |
|
|
|
return { |
|
|
|
return { |
|
|
@ -386,11 +392,6 @@ async function testWebhook() { |
|
|
|
await webhookTestRef.value.testWebhook() |
|
|
|
await webhookTestRef.value.testWebhook() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
defineExpose({ |
|
|
|
|
|
|
|
onEventChange, |
|
|
|
|
|
|
|
setHook, |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
watch( |
|
|
|
watch( |
|
|
|
() => hook.eventOperation, |
|
|
|
() => hook.eventOperation, |
|
|
|
() => { |
|
|
|
() => { |
|
|
@ -402,9 +403,18 @@ watch( |
|
|
|
}, |
|
|
|
}, |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
onMounted(async () => { |
|
|
|
watch( |
|
|
|
await loadPluginList() |
|
|
|
() => props.hook, |
|
|
|
}) |
|
|
|
() => { |
|
|
|
|
|
|
|
if (props.hook) { |
|
|
|
|
|
|
|
setHook(props.hook) |
|
|
|
|
|
|
|
onEventChange() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ immediate: true }, |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onMounted(loadPluginList) |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<template> |
|
|
|
<template> |
|
|
@ -513,7 +523,9 @@ onMounted(async () => { |
|
|
|
class="nc-select-hook-url-method" |
|
|
|
class="nc-select-hook-url-method" |
|
|
|
dropdown-class-name="nc-dropdown-hook-notification-url-method" |
|
|
|
dropdown-class-name="nc-dropdown-hook-notification-url-method" |
|
|
|
> |
|
|
|
> |
|
|
|
<a-select-option v-for="(method, i) in methodList" :key="i" :value="method.title">{{ method.title }}</a-select-option> |
|
|
|
<a-select-option v-for="(method, i) in methodList" :key="i" :value="method.title"> |
|
|
|
|
|
|
|
{{ method.title }} |
|
|
|
|
|
|
|
</a-select-option> |
|
|
|
</a-select> |
|
|
|
</a-select> |
|
|
|
</a-col> |
|
|
|
</a-col> |
|
|
|
|
|
|
|
|
|
|
@ -625,7 +637,13 @@ onMounted(async () => { |
|
|
|
<a-row class="mb-5" type="flex"> |
|
|
|
<a-row class="mb-5" type="flex"> |
|
|
|
<a-col :span="24"> |
|
|
|
<a-col :span="24"> |
|
|
|
<a-card> |
|
|
|
<a-card> |
|
|
|
<a-checkbox v-model:checked="hook.condition" class="nc-check-box-hook-condition">On Condition</a-checkbox> |
|
|
|
<a-checkbox |
|
|
|
|
|
|
|
:checked="Boolean(hook.condition)" |
|
|
|
|
|
|
|
class="nc-check-box-hook-condition" |
|
|
|
|
|
|
|
@update:checked="hook.condition = $event" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
On Condition |
|
|
|
|
|
|
|
</a-checkbox> |
|
|
|
|
|
|
|
|
|
|
|
<LazySmartsheetToolbarColumnFilter |
|
|
|
<LazySmartsheetToolbarColumnFilter |
|
|
|
v-if="hook.condition" |
|
|
|
v-if="hook.condition" |
|
|
|