iflow-feishu 1.0.6 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iflow-feishu",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "iFlow CLI 飞书插件 - 将 iFlow AI 助手接入飞书机器人",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -5,28 +5,28 @@
5
5
  /**
6
6
  * 格式化时间显示
7
7
  * @param {number} ms - 毫秒数
8
- * @returns {string} 格式化的时间字符串
8
+ * @returns {string} 格式化的时间字符串 (h m s 格式)
9
9
  */
10
10
  function formatTime(ms) {
11
11
  if (ms < 1000) {
12
12
  return `${ms}ms`;
13
13
  }
14
14
 
15
- const seconds = Math.floor(ms / 1000);
16
- const minutes = Math.floor(seconds / 60);
17
- const hours = Math.floor(minutes / 60);
15
+ const totalSeconds = Math.floor(ms / 1000);
16
+ const seconds = totalSeconds % 60;
17
+ const totalMinutes = Math.floor(totalSeconds / 60);
18
+ const minutes = totalMinutes % 60;
19
+ const hours = Math.floor(totalMinutes / 60);
18
20
 
19
21
  if (hours > 0) {
20
- const remainMinutes = minutes % 60;
21
- return remainMinutes > 0 ? `${hours}h ${remainMinutes}m` : `${hours}h`;
22
+ return `${hours}h ${minutes}m ${seconds}s`;
22
23
  }
23
24
 
24
25
  if (minutes > 0) {
25
- const remainSeconds = seconds % 60;
26
- return remainSeconds > 0 ? `${minutes}m ${remainSeconds}s` : `${minutes}m`;
26
+ return `${minutes}m ${seconds}s`;
27
27
  }
28
28
 
29
- return `${(ms / 1000).toFixed(1)}s`;
29
+ return `${seconds}s`;
30
30
  }
31
31
 
32
32
  class CardBuilder {