feat: disable popup dialog when clicking command on execution history page

This commit is contained in:
duorameng
2026-05-21 15:04:09 +08:00
parent f132ebe287
commit efb1625675
2 changed files with 10 additions and 4 deletions
+9 -3
View File
@@ -6,15 +6,18 @@ const props = withDefaults(
defineProps<{ defineProps<{
text: string text: string
title?: string title?: string
disableDialog?: boolean
}>(), }>(),
{ {
title: '详情' title: '详情',
disableDialog: false
} }
) )
const showDialog = ref(false) const showDialog = ref(false)
function handleClick() { function handleClick() {
if (props.disableDialog) return
if (props.text && props.text !== '-') { if (props.text && props.text !== '-') {
showDialog.value = true showDialog.value = true
} }
@@ -22,8 +25,11 @@ function handleClick() {
</script> </script>
<template> <template>
<span v-bind="$attrs" class="truncate block cursor-pointer hover:text-primary transition-colors" :title="text || '-'" <span v-bind="$attrs"
@click.stop="handleClick"> class="truncate block transition-colors"
:class="[!disableDialog ? 'cursor-pointer hover:text-primary' : '']"
:title="text || '-'"
@click="e => { if (!disableDialog) { e.stopPropagation(); handleClick(); } }">
{{ text || '-' }} {{ text || '-' }}
</span> </span>
+1 -1
View File
@@ -462,7 +462,7 @@ watch(() => route.query, (newQuery) => {
</span> </span>
<span class="w-36 shrink-0 font-medium truncate text-sm">{{ log.task_name }}</span> <span class="w-36 shrink-0 font-medium truncate text-sm">{{ log.task_name }}</span>
<code class="flex-1 min-w-0 text-muted-foreground truncate text-xs bg-muted/40 px-2 py-1 rounded"> <code class="flex-1 min-w-0 text-muted-foreground truncate text-xs bg-muted/40 px-2 py-1 rounded">
<TextOverflow :text="log.command" title="执行命令" /> <TextOverflow :text="log.command" title="执行命令" disable-dialog />
</code> </code>
<span class="w-12 flex justify-center shrink-0"> <span class="w-12 flex justify-center shrink-0">
<div v-if="log.status === TASK_STATUS.SUCCESS" <div v-if="log.status === TASK_STATUS.SUCCESS"