This commit is contained in:
2026-06-10 07:55:16 +08:00
parent 821eca9f0c
commit aaac7e9d98
31 changed files with 548 additions and 149 deletions
@@ -4,6 +4,12 @@
<span>
日志 ·
<span :class="connClass">{{ connText }}</span>
<span
v-if="exitText"
class="text-gray-400"
>
· {{ exitText }}
</span>
</span>
<NButton
text
@@ -45,7 +51,7 @@ import { useRunStream } from '@/composables/useRunStream'
const props = defineProps<{ profileId: string }>()
const { status, logs, clear } = useRunStream(props.profileId)
const { status, runStatus, exitCode, logs, clear } = useRunStream(props.profileId)
const scrollRef = ref<InstanceType<typeof NScrollbar> | null>(null)
@@ -69,6 +75,12 @@ const connText = computed(() => {
return '已断开'
}
})
// 进程已停止/崩溃且带退出码时展示,例如「退出码 0」。
const exitText = computed(() =>
exitCode.value !== null && (runStatus.value === 'stopped' || runStatus.value === 'crashed')
? `退出码 ${exitCode.value}`
: '',
)
const connClass = computed(() =>
status.value === 'streaming'
? 'text-green-400'