Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c9611c49
authored
Apr 02, 2026
by
CaIon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(usage-logs): enhance stream status display with error tooltip
parent
1baf4a63
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
3 deletions
+49
-3
web/src/components/table/usage-logs/UsageLogsColumnDefs.jsx
+49
-3
No files found.
web/src/components/table/usage-logs/UsageLogsColumnDefs.jsx
View file @
c9611c49
...
@@ -35,7 +35,7 @@ import {
...
@@ -35,7 +35,7 @@ import {
renderModelPriceSimple
,
renderModelPriceSimple
,
}
from
'../../../helpers'
;
}
from
'../../../helpers'
;
import
{
IconHelpCircle
}
from
'@douyinfe/semi-icons'
;
import
{
IconHelpCircle
}
from
'@douyinfe/semi-icons'
;
import
{
Route
,
Sparkles
}
from
'lucide-react'
;
import
{
CircleAlert
,
Route
,
Sparkles
}
from
'lucide-react'
;
const
colors
=
[
const
colors
=
[
'amber'
,
'amber'
,
...
@@ -141,12 +141,58 @@ function renderType(type, t) {
...
@@ -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
(
<
div
style=
{
{
lineHeight
:
1.6
,
display
:
'flex'
,
flexDirection
:
'column'
}
}
>
{
lines
.
map
((
line
,
i
)
=>
(
<
div
key=
{
i
}
>
{
line
}
</
div
>
))
}
</
div
>
);
}
function
renderIsStream
(
bool
,
t
,
streamStatus
)
{
const
isError
=
streamStatus
&&
streamStatus
.
status
!==
'ok'
;
if
(
bool
)
{
if
(
bool
)
{
return
(
return
(
<
span
style=
{
{
position
:
'relative'
,
display
:
'inline-block'
}
}
>
<
Tag
color=
'blue'
shape=
'circle'
>
<
Tag
color=
'blue'
shape=
'circle'
>
{
t
(
'流'
)
}
{
t
(
'流'
)
}
</
Tag
>
</
Tag
>
{
isError
&&
(
<
Tooltip
content=
{
buildStreamStatusTooltip
(
streamStatus
,
t
)
}
>
<
span
style=
{
{
position
:
'absolute'
,
right
:
-
4
,
top
:
-
4
,
lineHeight
:
1
,
color
:
'#ef4444'
,
cursor
:
'pointer'
,
userSelect
:
'none'
,
}
}
>
<
CircleAlert
size=
{
14
}
strokeWidth=
{
2.5
}
color=
'currentColor'
/>
</
span
>
</
Tooltip
>
)
}
</
span
>
);
);
}
else
{
}
else
{
return
(
return
(
...
@@ -694,7 +740,7 @@ export const getLogsColumns = ({
...
@@ -694,7 +740,7 @@ export const getLogsColumns = ({
<
Space
>
<
Space
>
{
renderUseTime
(
text
,
t
)
}
{
renderUseTime
(
text
,
t
)
}
{
renderFirstUseTime
(
other
?.
frt
,
t
)
}
{
renderFirstUseTime
(
other
?.
frt
,
t
)
}
{
renderIsStream
(
record
.
is_stream
,
t
)
}
{
renderIsStream
(
record
.
is_stream
,
t
,
other
?.
stream_status
)
}
</
Space
>
</
Space
>
</>
</>
);
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment