feat: disable popup dialog when clicking command on execution history page
This commit is contained in:
@@ -6,15 +6,18 @@ const props = withDefaults(
|
||||
defineProps<{
|
||||
text: string
|
||||
title?: string
|
||||
disableDialog?: boolean
|
||||
}>(),
|
||||
{
|
||||
title: '详情'
|
||||
title: '详情',
|
||||
disableDialog: false
|
||||
}
|
||||
)
|
||||
|
||||
const showDialog = ref(false)
|
||||
|
||||
function handleClick() {
|
||||
if (props.disableDialog) return
|
||||
if (props.text && props.text !== '-') {
|
||||
showDialog.value = true
|
||||
}
|
||||
@@ -22,8 +25,11 @@ function handleClick() {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<span v-bind="$attrs" class="truncate block cursor-pointer hover:text-primary transition-colors" :title="text || '-'"
|
||||
@click.stop="handleClick">
|
||||
<span v-bind="$attrs"
|
||||
class="truncate block transition-colors"
|
||||
:class="[!disableDialog ? 'cursor-pointer hover:text-primary' : '']"
|
||||
:title="text || '-'"
|
||||
@click="e => { if (!disableDialog) { e.stopPropagation(); handleClick(); } }">
|
||||
{{ text || '-' }}
|
||||
</span>
|
||||
|
||||
|
||||
@@ -462,7 +462,7 @@ watch(() => route.query, (newQuery) => {
|
||||
</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">
|
||||
<TextOverflow :text="log.command" title="执行命令" />
|
||||
<TextOverflow :text="log.command" title="执行命令" disable-dialog />
|
||||
</code>
|
||||
<span class="w-12 flex justify-center shrink-0">
|
||||
<div v-if="log.status === TASK_STATUS.SUCCESS"
|
||||
|
||||
Reference in New Issue
Block a user