perf: webhook触发器一个流水线限制只能添加一个

This commit is contained in:
xiaojunnuo
2026-01-13 19:07:21 +08:00
parent 840bd52671
commit 6c39d7b1ee
2 changed files with 8 additions and 2 deletions

View File

@@ -5,7 +5,7 @@
<fs-copyable :model-value="webhookUrl" class="flex-1 overflow-hidden"></fs-copyable>
</div>
<a-button class="mt-2" type="primary" size="small" @click="refreshWebhookKey">重新生成</a-button>
<div class="helper">支持post和get请求</div>
<div class="helper">支持post和get请求同一个流水线的webhook地址是唯一的</div>
</a-form-item>
</div>
</template>
@@ -41,6 +41,7 @@ onMounted(() => {
const refreshWebhookKey = () => {
Modal.confirm({
title: "确认重新生成Webhook URL吗",
content: "重新生成后旧的webhook地址将失效",
okText: "确认",
okType: "danger",
onOk: async () => {

View File

@@ -103,7 +103,7 @@
</a-button>
</div>
</div>
<div v-if="editMode" class="task-container is-add">
<div v-if="editMode && !hasWebhookTrigger" class="task-container is-add">
<div class="line line-right">
<div class="flow-line"></div>
</div>
@@ -994,6 +994,10 @@ export default defineComponent({
const isCert = computed(() => {
return currentPipeline.value?.type?.startsWith("cert");
});
const hasWebhookTrigger = computed(() => {
return currentPipeline.value?.triggers?.some((item: any) => item.type === "webhook");
});
return {
isCert,
pipeline,
@@ -1013,6 +1017,7 @@ export default defineComponent({
viewCert,
downloadCert,
pipelineDetail,
hasWebhookTrigger,
};
},
});