Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 80 additions & 4 deletions frontend/src/views/setting/alert/setting/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,22 @@
{{ weComConfig.config.displayName }}
</el-form-item>
<el-form-item :label="$t('xpack.alert.webhookUrl')" prop="url">
{{ weComConfig.config.url }}
<div class="webhook-field">
<template v-if="weComUrlVisible">
<el-tooltip :content="weComConfig.config.url" placement="top" effect="dark">
<span class="webhook-text">
{{ weComConfig.config.url }}
</span>
</el-tooltip>
</template>
<template v-else>
<span class="webhook-text">****************</span>
</template>
<el-icon class="webhook-icon" @click="weComUrlVisible = !weComUrlVisible">
<Hide v-if="!weComUrlVisible" />
<View v-else />
</el-icon>
</div>
</el-form-item>
</el-form>
</div>
Expand Down Expand Up @@ -208,7 +223,26 @@
{{ dingTalkConfig.config.displayName }}
</el-form-item>
<el-form-item :label="$t('xpack.alert.webhookUrl')" prop="url">
{{ dingTalkConfig.config.url }}
<div class="webhook-field">
<template v-if="dingTalkUrlVisible">
<el-tooltip
:content="dingTalkConfig.config.url"
placement="top"
effect="dark"
>
<span class="webhook-text">
{{ dingTalkConfig.config.url }}
</span>
</el-tooltip>
</template>
<template v-else>
<span class="webhook-text">****************</span>
</template>
<el-icon class="webhook-icon" @click="dingTalkUrlVisible = !dingTalkUrlVisible">
<Hide v-if="!dingTalkUrlVisible" />
<View v-else />
</el-icon>
</div>
</el-form-item>
</el-form>
</div>
Expand Down Expand Up @@ -258,7 +292,26 @@
{{ feiShuConfig.config.displayName }}
</el-form-item>
<el-form-item :label="$t('xpack.alert.webhookUrl')" prop="url">
{{ feiShuConfig.config.url }}
<div class="webhook-field">
<template v-if="feiShuUrlVisible">
<el-tooltip
:content="feiShuConfig.config.url"
placement="top"
effect="dark"
>
<span class="webhook-text">
{{ feiShuConfig.config.url }}
</span>
</el-tooltip>
</template>
<template v-else>
<span class="webhook-text">****************</span>
</template>
<el-icon class="webhook-icon" @click="feiShuUrlVisible = !feiShuUrlVisible">
<Hide v-if="!feiShuUrlVisible" />
<View v-else />
</el-icon>
</div>
</el-form-item>
</el-form>
</div>
Expand Down Expand Up @@ -318,10 +371,11 @@
</template>

<script lang="ts" setup>
import { computed, onMounted, ref } from 'vue';
import { computed, onMounted, ref, Ref } from 'vue';
import { GlobalStore } from '@/store';
import { ListAlertConfigs, DeleteAlertConfig, UpdateAlertConfig } from '@/api/modules/alert';
import { ElMessageBox, FormInstance } from 'element-plus';
import { View, Hide } from '@element-plus/icons-vue';
import Phone from '@/views/setting/alert/setting/phone/index.vue';
import SendTimeRange from '@/views/setting/alert/setting/time-range/index.vue';
import i18n from '@/lang';
Expand Down Expand Up @@ -432,6 +486,10 @@ const defaultFeiShuConfig: Alert.WebhookConfig = {
};
const feiShuConfig = ref<Alert.WebhookConfig>({ ...defaultFeiShuConfig });

const weComUrlVisible = ref(false);
const dingTalkUrlVisible = ref(false);
const feiShuUrlVisible = ref(false);

const config = ref<Alert.AlertConfigInfo>({
id: 0,
type: '',
Expand Down Expand Up @@ -635,4 +693,22 @@ onMounted(async () => {
margin-bottom: 0 !important;
}
}
.webhook-field {
display: inline-flex;
align-items: center;
gap: 6px;
max-width: 100%;
}
.webhook-text {
max-width: 100%;
word-break: break-all;
white-space: normal;
}
.webhook-icon {
cursor: pointer;
color: var(--el-text-color-secondary);
}
.webhook-icon:hover {
color: var(--el-color-primary);
}
</style>
Loading