This is an automated email from the ASF dual-hosted git repository.
czy006 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/amoro.git
The following commit(s) were added to refs/heads/master by this push:
new a40a8c14d [AMORO-4135][amoro-web] Fix blank duration column for
sub-second optimizing durations (#4136)
a40a8c14d is described below
commit a40a8c14d201e45b4f5408825a70ad5104d738fe
Author: Baixiaochun <[email protected]>
AuthorDate: Thu Mar 19 18:30:50 2026 +0800
[AMORO-4135][amoro-web] Fix blank duration column for sub-second optimizing
durations (#4136)
[AMORO-4135][amoro-web] 修复 formatMS2Time() 对小于1秒的持续时间返回空字符串的问题
当优化任务持续时间在 1ms-999ms 之间时,formatMS2Time() 函数的所有时间单位
(天/时/分/秒) 经 Math.floor 计算后都为 0,导致 result 为空字符串,前端
duration 列显示为空白。
添加对 0 < ms < 1000 的边界处理,返回 '<1s' 而非空字符串。
fix #4135
Co-authored-by: Bingtagui404
<[email protected]>
---
amoro-web/src/utils/index.ts | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/amoro-web/src/utils/index.ts b/amoro-web/src/utils/index.ts
index 3b89598a7..9aefb8a8b 100644
--- a/amoro-web/src/utils/index.ts
+++ b/amoro-web/src/utils/index.ts
@@ -93,6 +93,10 @@ export function formatMS2Time(ms: number): string {
}
// Trim any trailing spaces and return the formatted result
+ // Handle sub-second durations (0 < ms < 1000)
+ if (!result && ms > 0) {
+ return '<1s'
+ }
return result.trim()
}
/**