Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

Add the missing webhook provider logo in webhook detail view

天舟8a8a60645285
diff --git a/frontend/src/views/ProjectWebhookDetail.vue b/frontend/src/views/ProjectWebhookDetail.vue
index c926566bfd..9a7490f0ed 100644
--- a/frontend/src/views/ProjectWebhookDetail.vue
+++ b/frontend/src/views/ProjectWebhookDetail.vue
@@ -2,7 +2,30 @@
<div class="space-y-4 divide-y divide-block-border">
<div class="flex justify-between">
<div class="flex flex-row space-x-2 items-center">
- <img class="h-6 w-6" :src="`/src/assets/${logo}`" />
+ <!-- This awkward code is author couldn't figure out proper way to use dynamic src under vite
+ https://github.com/vitejs/vite/issues/1265 -->
+ <template v-if="projectWebhook.type == 'bb.plugin.webhook.slack'">
+ <img class="h-6 w-6" src="../assets/slack-logo.png" alt="" />
+ </template>
+ <template
+ v-else-if="projectWebhook.type == 'bb.plugin.webhook.discord'"
+ >
+ <img class="h-6 w-6" src="../assets/discord-logo.svg" />
+ </template>
+ <template v-else-if="projectWebhook.type == 'bb.plugin.webhook.teams'">
+ <img class="h-6 w-6" src="../assets/teams-logo.svg" />
+ </template>
+ <template
+ v-else-if="projectWebhook.type == 'bb.plugin.webhook.dingtalk'"
+ >
+ <img class="h-6 w-6" src="../assets/dingtalk-logo.png" />
+ </template>
+ <template v-else-if="projectWebhook.type == 'bb.plugin.webhook.feishu'">
+ <img class="h-6 w-6" src="../assets/feishu-logo.png" />
+ </template>
+ <template v-else-if="projectWebhook.type == 'bb.plugin.webhook.wecom'">
+ <img class="h-6 w-6" src="../assets/wecom-logo.png" />
+ </template>
<h3 class="text-xl leading-6 font-medium text-main">
{{ projectWebhook.name }}
</h3>
@@ -68,16 +91,6 @@ export default {
);
});
- const logo = computed(() => {
- for (const item of PROJECT_HOOK_TYPE_ITEM_LIST) {
- if (item.type == projectWebhook.value.type) {
- return item.logo;
- }
- }
-
- return "";
- });
-
const testWebhook = () => {
store
.dispatch("projectWebhook/testProjectWebhookById", {
@@ -106,7 +119,6 @@ export default {
return {
project,
projectWebhook,
- logo,
testWebhook,
};
},