|
158 | 158 | {{ weComConfig.config.displayName }} |
159 | 159 | </el-form-item> |
160 | 160 | <el-form-item :label="$t('xpack.alert.webhookUrl')" prop="url"> |
161 | | - {{ weComConfig.config.url }} |
| 161 | + <div class="webhook-field"> |
| 162 | + <template v-if="weComUrlVisible"> |
| 163 | + <el-tooltip :content="weComConfig.config.url" placement="top" effect="dark"> |
| 164 | + <span class="webhook-text"> |
| 165 | + {{ weComConfig.config.url }} |
| 166 | + </span> |
| 167 | + </el-tooltip> |
| 168 | + </template> |
| 169 | + <template v-else> |
| 170 | + <span class="webhook-text">****************</span> |
| 171 | + </template> |
| 172 | + <el-icon class="webhook-icon" @click="weComUrlVisible = !weComUrlVisible"> |
| 173 | + <Hide v-if="!weComUrlVisible" /> |
| 174 | + <View v-else /> |
| 175 | + </el-icon> |
| 176 | + </div> |
162 | 177 | </el-form-item> |
163 | 178 | </el-form> |
164 | 179 | </div> |
|
208 | 223 | {{ dingTalkConfig.config.displayName }} |
209 | 224 | </el-form-item> |
210 | 225 | <el-form-item :label="$t('xpack.alert.webhookUrl')" prop="url"> |
211 | | - {{ dingTalkConfig.config.url }} |
| 226 | + <div class="webhook-field"> |
| 227 | + <template v-if="dingTalkUrlVisible"> |
| 228 | + <el-tooltip |
| 229 | + :content="dingTalkConfig.config.url" |
| 230 | + placement="top" |
| 231 | + effect="dark" |
| 232 | + > |
| 233 | + <span class="webhook-text"> |
| 234 | + {{ dingTalkConfig.config.url }} |
| 235 | + </span> |
| 236 | + </el-tooltip> |
| 237 | + </template> |
| 238 | + <template v-else> |
| 239 | + <span class="webhook-text">****************</span> |
| 240 | + </template> |
| 241 | + <el-icon class="webhook-icon" @click="dingTalkUrlVisible = !dingTalkUrlVisible"> |
| 242 | + <Hide v-if="!dingTalkUrlVisible" /> |
| 243 | + <View v-else /> |
| 244 | + </el-icon> |
| 245 | + </div> |
212 | 246 | </el-form-item> |
213 | 247 | </el-form> |
214 | 248 | </div> |
|
258 | 292 | {{ feiShuConfig.config.displayName }} |
259 | 293 | </el-form-item> |
260 | 294 | <el-form-item :label="$t('xpack.alert.webhookUrl')" prop="url"> |
261 | | - {{ feiShuConfig.config.url }} |
| 295 | + <div class="webhook-field"> |
| 296 | + <template v-if="feiShuUrlVisible"> |
| 297 | + <el-tooltip |
| 298 | + :content="feiShuConfig.config.url" |
| 299 | + placement="top" |
| 300 | + effect="dark" |
| 301 | + > |
| 302 | + <span class="webhook-text"> |
| 303 | + {{ feiShuConfig.config.url }} |
| 304 | + </span> |
| 305 | + </el-tooltip> |
| 306 | + </template> |
| 307 | + <template v-else> |
| 308 | + <span class="webhook-text">****************</span> |
| 309 | + </template> |
| 310 | + <el-icon class="webhook-icon" @click="feiShuUrlVisible = !feiShuUrlVisible"> |
| 311 | + <Hide v-if="!feiShuUrlVisible" /> |
| 312 | + <View v-else /> |
| 313 | + </el-icon> |
| 314 | + </div> |
262 | 315 | </el-form-item> |
263 | 316 | </el-form> |
264 | 317 | </div> |
|
318 | 371 | </template> |
319 | 372 |
|
320 | 373 | <script lang="ts" setup> |
321 | | -import { computed, onMounted, ref } from 'vue'; |
| 374 | +import { computed, onMounted, ref, Ref } from 'vue'; |
322 | 375 | import { GlobalStore } from '@/store'; |
323 | 376 | import { ListAlertConfigs, DeleteAlertConfig, UpdateAlertConfig } from '@/api/modules/alert'; |
324 | 377 | import { ElMessageBox, FormInstance } from 'element-plus'; |
| 378 | +import { View, Hide } from '@element-plus/icons-vue'; |
325 | 379 | import Phone from '@/views/setting/alert/setting/phone/index.vue'; |
326 | 380 | import SendTimeRange from '@/views/setting/alert/setting/time-range/index.vue'; |
327 | 381 | import i18n from '@/lang'; |
@@ -432,6 +486,10 @@ const defaultFeiShuConfig: Alert.WebhookConfig = { |
432 | 486 | }; |
433 | 487 | const feiShuConfig = ref<Alert.WebhookConfig>({ ...defaultFeiShuConfig }); |
434 | 488 |
|
| 489 | +const weComUrlVisible = ref(false); |
| 490 | +const dingTalkUrlVisible = ref(false); |
| 491 | +const feiShuUrlVisible = ref(false); |
| 492 | +
|
435 | 493 | const config = ref<Alert.AlertConfigInfo>({ |
436 | 494 | id: 0, |
437 | 495 | type: '', |
@@ -635,4 +693,22 @@ onMounted(async () => { |
635 | 693 | margin-bottom: 0 !important; |
636 | 694 | } |
637 | 695 | } |
| 696 | +.webhook-field { |
| 697 | + display: inline-flex; |
| 698 | + align-items: center; |
| 699 | + gap: 6px; |
| 700 | + max-width: 100%; |
| 701 | +} |
| 702 | +.webhook-text { |
| 703 | + max-width: 100%; |
| 704 | + word-break: break-all; |
| 705 | + white-space: normal; |
| 706 | +} |
| 707 | +.webhook-icon { |
| 708 | + cursor: pointer; |
| 709 | + color: var(--el-text-color-secondary); |
| 710 | +} |
| 711 | +.webhook-icon:hover { |
| 712 | + color: var(--el-color-primary); |
| 713 | +} |
638 | 714 | </style> |
0 commit comments