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
6b01438b
authored
Jun 18, 2025
by
skynono
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: task cost time
parent
423796e7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
13 deletions
+1
-13
web/src/components/table/TaskLogsTable.js
+1
-13
No files found.
web/src/components/table/TaskLogsTable.js
View file @
6b01438b
...
...
@@ -96,20 +96,8 @@ const renderTimestamp = (timestampInSeconds) => {
};
function
renderDuration
(
submit_time
,
finishTime
)
{
// 确保startTime和finishTime都是有效的时间戳
if
(
!
submit_time
||
!
finishTime
)
return
'N/A'
;
// 将时间戳转换为Date对象
const
start
=
new
Date
(
submit_time
);
const
finish
=
new
Date
(
finishTime
);
// 计算时间差(毫秒)
const
durationMs
=
finish
-
start
;
// 将时间差转换为秒,并保留一位小数
const
durationSec
=
(
durationMs
/
1000
).
toFixed
(
1
);
// 设置颜色:大于60秒则为红色,小于等于60秒则为绿色
const
durationSec
=
finishTime
-
submit_time
;
const
color
=
durationSec
>
60
?
'red'
:
'green'
;
// 返回带有样式的颜色标签
...
...
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