mirror of
https://github.com/langgenius/dify.git
synced 2026-04-29 04:26:30 +08:00
feat: add trigger by of app log (#24973)
This commit is contained in:
parent
a239c39f09
commit
883a6caf96
@ -8,6 +8,7 @@ workflow_run_for_log_fields = {
|
|||||||
"id": fields.String,
|
"id": fields.String,
|
||||||
"version": fields.String,
|
"version": fields.String,
|
||||||
"status": fields.String,
|
"status": fields.String,
|
||||||
|
"triggered_from": fields.String,
|
||||||
"error": fields.String,
|
"error": fields.String,
|
||||||
"elapsed_time": fields.Float,
|
"elapsed_time": fields.Float,
|
||||||
"total_tokens": fields.Integer,
|
"total_tokens": fields.Integer,
|
||||||
|
|||||||
@ -30,6 +30,8 @@ const WorkflowAppLogList: FC<ILogs> = ({ logs, appDetail, onRefresh }) => {
|
|||||||
const [showDrawer, setShowDrawer] = useState<boolean>(false)
|
const [showDrawer, setShowDrawer] = useState<boolean>(false)
|
||||||
const [currentLog, setCurrentLog] = useState<WorkflowAppLogDetail | undefined>()
|
const [currentLog, setCurrentLog] = useState<WorkflowAppLogDetail | undefined>()
|
||||||
|
|
||||||
|
const isWorkflow = appDetail?.mode === 'workflow'
|
||||||
|
|
||||||
const statusTdRender = (status: string) => {
|
const statusTdRender = (status: string) => {
|
||||||
if (status === 'succeeded') {
|
if (status === 'succeeded') {
|
||||||
return (
|
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.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.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 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>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody className="system-sm-regular text-text-secondary">
|
<tbody className="system-sm-regular text-text-secondary">
|
||||||
@ -125,6 +128,7 @@ const WorkflowAppLogList: FC<ILogs> = ({ logs, appDetail, onRefresh }) => {
|
|||||||
{endUser}
|
{endUser}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
{isWorkflow && <td className='p-3 pr-2'>{log.workflow_run.triggered_from}</td>}
|
||||||
</tr>
|
</tr>
|
||||||
})}
|
})}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@ -20,6 +20,7 @@ const translation = {
|
|||||||
tokens: 'TOKENS',
|
tokens: 'TOKENS',
|
||||||
user: 'End User or Account',
|
user: 'End User or Account',
|
||||||
version: 'VERSION',
|
version: 'VERSION',
|
||||||
|
triggered_from: 'TRIGGER BY',
|
||||||
},
|
},
|
||||||
pagination: {
|
pagination: {
|
||||||
previous: 'Prev',
|
previous: 'Prev',
|
||||||
|
|||||||
@ -234,6 +234,7 @@ export type WorkflowRunDetail = {
|
|||||||
version: string
|
version: string
|
||||||
status: 'running' | 'succeeded' | 'failed' | 'stopped'
|
status: 'running' | 'succeeded' | 'failed' | 'stopped'
|
||||||
error?: string
|
error?: string
|
||||||
|
triggered_from?: string
|
||||||
elapsed_time: number
|
elapsed_time: number
|
||||||
total_tokens: number
|
total_tokens: number
|
||||||
total_price: number
|
total_price: number
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user