diff --git a/web/src/components/table/usage-logs/UsageLogsColumnDefs.jsx b/web/src/components/table/usage-logs/UsageLogsColumnDefs.jsx index 61104d22..d5243afc 100644 --- a/web/src/components/table/usage-logs/UsageLogsColumnDefs.jsx +++ b/web/src/components/table/usage-logs/UsageLogsColumnDefs.jsx @@ -35,7 +35,7 @@ import { renderModelPriceSimple, } from '../../../helpers'; import { IconHelpCircle } from '@douyinfe/semi-icons'; -import { Route, Sparkles } from 'lucide-react'; +import { CircleAlert, Route, Sparkles } from 'lucide-react'; const colors = [ 'amber', @@ -141,12 +141,58 @@ function renderType(type, t) { } } -function renderIsStream(bool, t) { +function buildStreamStatusTooltip(ss, t) { + if (!ss) return null; + const lines = [ + t('流状态') + ':' + t('异常'), + (ss.end_reason || 'unknown'), + ]; + if (ss.error_count > 0) { + lines.push(`${t('软错误')}: ${ss.error_count}`); + } + if (ss.end_error) { + lines.push(ss.end_error); + } + return ( +
+ {lines.map((line, i) => ( +
{line}
+ ))} +
+ ); +} + +function renderIsStream(bool, t, streamStatus) { + const isError = streamStatus && streamStatus.status !== 'ok'; + if (bool) { return ( - - {t('流')} - + + + {t('流')} + + {isError && ( + + + + + + )} + ); } else { return ( @@ -694,7 +740,7 @@ export const getLogsColumns = ({ {renderUseTime(text, t)} {renderFirstUseTime(other?.frt, t)} - {renderIsStream(record.is_stream, t)} + {renderIsStream(record.is_stream, t, other?.stream_status)} );