feat: 调用日志列表新增调用用户列
This commit is contained in:
@@ -247,6 +247,7 @@ export interface AiCallLog {
|
|||||||
providerCode?: string
|
providerCode?: string
|
||||||
endpointCode?: string
|
endpointCode?: string
|
||||||
userId?: string
|
userId?: string
|
||||||
|
userName?: string
|
||||||
requestId?: string
|
requestId?: string
|
||||||
status?: string
|
status?: string
|
||||||
inputText?: string
|
inputText?: string
|
||||||
|
|||||||
@@ -202,6 +202,11 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="createTime" label="调用时间" width="175" />
|
<el-table-column prop="createTime" label="调用时间" width="175" />
|
||||||
|
<el-table-column label="调用用户" width="180" show-overflow-tooltip>
|
||||||
|
<template #default="{ row }">
|
||||||
|
{{ userDisplay(row) }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column prop="sceneCode" label="场景" width="160" show-overflow-tooltip />
|
<el-table-column prop="sceneCode" label="场景" width="160" show-overflow-tooltip />
|
||||||
<el-table-column prop="providerCode" label="服务商" width="150" show-overflow-tooltip />
|
<el-table-column prop="providerCode" label="服务商" width="150" show-overflow-tooltip />
|
||||||
<el-table-column prop="endpointCode" label="接口" min-width="180" show-overflow-tooltip />
|
<el-table-column prop="endpointCode" label="接口" min-width="180" show-overflow-tooltip />
|
||||||
@@ -640,6 +645,15 @@ function formatMs(ms?: number) {
|
|||||||
return ms >= 1000 ? `${(ms / 1000).toFixed(2)}s` : `${ms}ms`
|
return ms >= 1000 ? `${(ms / 1000).toFixed(2)}s` : `${ms}ms`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function userDisplay(row: AiCallLog): string {
|
||||||
|
const name = row.userName
|
||||||
|
const id = row.userId
|
||||||
|
if (name && id) return `${name}(${id})`
|
||||||
|
if (name) return name
|
||||||
|
if (id) return `-(ID: ${id})`
|
||||||
|
return '-'
|
||||||
|
}
|
||||||
|
|
||||||
function testOutput(result?: AiRuntimeTestResponse | null) {
|
function testOutput(result?: AiRuntimeTestResponse | null) {
|
||||||
return normalizeAiText(result?.output || result?.errorMessage || '暂无输出')
|
return normalizeAiText(result?.output || result?.errorMessage || '暂无输出')
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user