feat: add trigger by of app log (#24973)

This commit is contained in:
非法操作
2025-09-02 16:04:08 +08:00
committed by GitHub
parent a239c39f09
commit 883a6caf96
4 changed files with 8 additions and 1 deletions

View File

@@ -8,6 +8,7 @@ workflow_run_for_log_fields = {
"id": fields.String,
"version": fields.String,
"status": fields.String,
"triggered_from": fields.String,
"error": fields.String,
"elapsed_time": fields.Float,
"total_tokens": fields.Integer,

View File

@@ -30,6 +30,8 @@ const WorkflowAppLogList: FC<ILogs> = ({ logs, appDetail, onRefresh }) => {
const [showDrawer, setShowDrawer] = useState<boolean>(false)
const [currentLog, setCurrentLog] = useState<WorkflowAppLogDetail | undefined>()
const isWorkflow = appDetail?.mode === 'workflow'
const statusTdRender = (status: string) => {
if (status === 'succeeded') {
return (
@@ -92,7 +94,8 @@ const WorkflowAppLogList: FC<ILogs> = ({ logs, appDetail, onRefresh }) => {
<td className='whitespace-nowrap bg-background-section-burn py-1.5 pl-3'>{t('appLog.table.header.status')}</td>
<td className='whitespace-nowrap bg-background-section-burn py-1.5 pl-3'>{t('appLog.table.header.runtime')}</td>
<td className='whitespace-nowrap bg-background-section-burn py-1.5 pl-3'>{t('appLog.table.header.tokens')}</td>
<td className='whitespace-nowrap rounded-r-lg bg-background-section-burn py-1.5 pl-3'>{t('appLog.table.header.user')}</td>
<td className={cn('whitespace-nowrap bg-background-section-burn py-1.5 pl-3', !isWorkflow ? 'rounded-r-lg' : '')}>{t('appLog.table.header.user')}</td>
{isWorkflow && <td className='whitespace-nowrap rounded-r-lg bg-background-section-burn py-1.5 pl-3'>{t('appLog.table.header.triggered_from')}</td>}
</tr>
</thead>
<tbody className="system-sm-regular text-text-secondary">
@@ -125,6 +128,7 @@ const WorkflowAppLogList: FC<ILogs> = ({ logs, appDetail, onRefresh }) => {
{endUser}
</div>
</td>
{isWorkflow && <td className='p-3 pr-2'>{log.workflow_run.triggered_from}</td>}
</tr>
})}
</tbody>

View File

@@ -20,6 +20,7 @@ const translation = {
tokens: 'TOKENS',
user: 'End User or Account',
version: 'VERSION',
triggered_from: 'TRIGGER BY',
},
pagination: {
previous: 'Prev',

View File

@@ -234,6 +234,7 @@ export type WorkflowRunDetail = {
version: string
status: 'running' | 'succeeded' | 'failed' | 'stopped'
error?: string
triggered_from?: string
elapsed_time: number
total_tokens: number
total_price: number