演示目录只保留可重建的源码。运行密钥、数据卷、依赖和带口令的本地配置不进入仓库。 Co-authored-by: Cursor <cursoragent@cursor.com>
33 lines
1.3 KiB
TypeScript
33 lines
1.3 KiB
TypeScript
import { useAtomValue } from 'jotai'
|
|
import { memo } from 'react'
|
|
import { useTranslation } from 'react-i18next'
|
|
import { isChatflowAtom } from '@/app/components/workflow/editor-resource/state'
|
|
import { useStore } from '../store'
|
|
import { formatWorkflowRunIdentifier } from '../utils'
|
|
|
|
const RunningTitle = () => {
|
|
const { t } = useTranslation(['workflow'] as const)
|
|
const isChatflow = useAtomValue(isChatflowAtom)
|
|
const historyWorkflowData = useStore((s) => s.historyWorkflowData)
|
|
|
|
return (
|
|
<div className="flex h-4.5 items-center text-xs text-gray-500">
|
|
<span
|
|
aria-hidden
|
|
className="me-1 i-custom-vender-line-time-clock-play size-3 text-gray-500"
|
|
/>
|
|
<span>
|
|
{isChatflow
|
|
? `Test Chat${formatWorkflowRunIdentifier(historyWorkflowData?.finished_at, historyWorkflowData?.status)}`
|
|
: `Test Run${formatWorkflowRunIdentifier(historyWorkflowData?.finished_at, historyWorkflowData?.status)}`}
|
|
</span>
|
|
<span className="mx-1">·</span>
|
|
<span className="ms-1 flex h-4.5 items-center rounded-[5px] border border-indigo-300 bg-white/48 px-1 text-2xs font-semibold text-indigo-600 uppercase">
|
|
{t(($) => $['common.viewOnly'], { ns: 'workflow' })}
|
|
</span>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default memo(RunningTitle)
|