remove test webhook step
This commit is contained in:
parent
c273a173c9
commit
b3baf4108e
|
@ -11,7 +11,7 @@ interface APIBody {
|
||||||
status: 'success' | 'error'
|
status: 'success' | 'error'
|
||||||
}
|
}
|
||||||
|
|
||||||
const steps = ['get_me', 'get_user_id', 'get_bx', "end_step", "test_webhook"]
|
const steps = ['get_me', 'get_user_id', 'get_bx', "end_step"]
|
||||||
|
|
||||||
const { data, pending, error, status } = await useLazyFetch<APIBody>(`${config.public.apiBase}/api/tg/get_me`, { server: false })
|
const { data, pending, error, status } = await useLazyFetch<APIBody>(`${config.public.apiBase}/api/tg/get_me`, { server: false })
|
||||||
|
|
||||||
|
@ -60,10 +60,6 @@ const nextStep = async () => {
|
||||||
await retryStep('end_step')
|
await retryStep('end_step')
|
||||||
passToStep('end_step')
|
passToStep('end_step')
|
||||||
}
|
}
|
||||||
else if (step.value == 'end_step') {
|
|
||||||
await retryStep('test_webhook')
|
|
||||||
passToStep('test_webhook')
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
const retryStep = async (stepName: typeof steps[number]) => {
|
const retryStep = async (stepName: typeof steps[number]) => {
|
||||||
if (stepName == 'get_user_id') {
|
if (stepName == 'get_user_id') {
|
||||||
|
@ -81,9 +77,8 @@ const retryStep = async (stepName: typeof steps[number]) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const testWebhook = async () => {
|
const copyOnClick = (e:Event) => {
|
||||||
const bx_res = await $fetch<APIBody>(`${config.public.apiBase}/api/bx/test_webhook/${selected_tg.value}`)
|
navigator.clipboard.writeText(e.currentTarget.textContent)
|
||||||
console.log(bx_res)
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
|
@ -104,7 +99,7 @@ const testWebhook = async () => {
|
||||||
<li v-for="item in tg_data.slice(0, 1)">
|
<li v-for="item in tg_data.slice(0, 1)">
|
||||||
Имя: {{ [item.message.chat.first_name, item.message.chat.last_name,
|
Имя: {{ [item.message.chat.first_name, item.message.chat.last_name,
|
||||||
item.message.chat.username].filter(Boolean).join(' ') }}<br />
|
item.message.chat.username].filter(Boolean).join(' ') }}<br />
|
||||||
ID: <code class="code">{{ item.message.chat.id }}</code>
|
ID: <code class="code" @click="copyOnClick">{{ item.message.chat.id }}</code>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
@ -119,7 +114,7 @@ const testWebhook = async () => {
|
||||||
<li :class="isPassed('end_step')" v-if="shown_steps.includes('end_step')">
|
<li :class="isPassed('end_step')" v-if="shown_steps.includes('end_step')">
|
||||||
<p>
|
<p>
|
||||||
Вот ваша ссылка для формирования вебхука
|
Вот ваша ссылка для формирования вебхука
|
||||||
<code>https://gi.svs-tech.pro/integration_tg/{{ selected_bx.id }}/{{ selected_tg }}</code>
|
<code @click="copyOnClick">https://gi.svs-tech.pro/integration_tg/{{ selected_bx.id }}/{{ selected_tg }}</code>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Теперь вам осталось <ULink to="https://crm.svs-tech.pro/devops/section/standard/" target="_blank">
|
Теперь вам осталось <ULink to="https://crm.svs-tech.pro/devops/section/standard/" target="_blank">
|
||||||
|
@ -129,20 +124,18 @@ const testWebhook = async () => {
|
||||||
Вставьте туда этот урл и укажите События <i>Добавление комментария к задаче (ONTASKCOMMENTADD)</i>
|
Вставьте туда этот урл и укажите События <i>Добавление комментария к задаче (ONTASKCOMMENTADD)</i>
|
||||||
</p>
|
</p>
|
||||||
</li>
|
</li>
|
||||||
<li :class="isPassed('test_webhook')" v-if="shown_steps.includes('test_webhook')">
|
|
||||||
Если вы установили вебхук - можете его проверить!
|
|
||||||
</li>
|
|
||||||
</ol>
|
</ol>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<div class="flex gap-4">
|
<div class="flex gap-4">
|
||||||
<UButton color="orange" v-if="['get_user_id'].includes(step)" @click="retryStep(step)"
|
<UButton color="orange" v-if="['get_user_id'].includes(step)" @click="retryStep(step)"
|
||||||
:loading="loading" :disabled="disabled">Ошибка в данных
|
:loading="loading" :disabled="disabled">Ошибка в данных
|
||||||
</UButton>
|
</UButton>
|
||||||
<UButton @click="testWebhook" v-else-if="step == 'test_webhook'">Проверить</UButton>
|
|
||||||
|
|
||||||
<UButton v-if="step !== 'test_webhook'" :loading="loading" :disabled="disabled || (step == 'get_bx' && !selected_bx)"
|
<UButton v-if="step !== 'end_step'" :loading="loading" :disabled="disabled || (step == 'get_bx' && !selected_bx)"
|
||||||
@click="nextStep">
|
@click="nextStep">
|
||||||
Сделано</UButton>
|
Сделано</UButton>
|
||||||
|
|
||||||
|
<p v-if="step=='end_step'">Вот и все!</p>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</UCard>
|
</UCard>
|
||||||
|
|
Loading…
Reference in New Issue