MCPcopy Create free account
hub / github.com/echoVic/blade-code / createProgressBar

Method createProgressBar

src/ui/components/Progress.ts:84–92  ·  view source on GitHub ↗

* 创建简单的进度条字符串

(percentage: number, width: number = 20)

Source from the content-addressed store, hash-verified

82 * 创建简单的进度条字符串
83 */
84 private static createProgressBar(percentage: number, width: number = 20): string {
85 const filled = Math.round((percentage / 100) * width);
86 const empty = width - filled;
87
88 const filledBar = UIStyles.status.success('█'.repeat(filled));
89 const emptyBar = UIStyles.status.muted('░'.repeat(empty));
90
91 return `[${filledBar}${emptyBar}]`;
92 }
93
94 /**
95 * 格式化时间

Callers 3

stepMethod · 0.95
timedStepMethod · 0.95
simulateMethod · 0.95

Calls 2

successMethod · 0.80
mutedMethod · 0.80

Tested by

no test coverage detected