optimize downoad ui dashboard

This commit is contained in:
tickstep studio team
2026-02-03 15:52:06 +08:00
parent 4c5f45e5ab
commit ff0e3dbfa9
+3 -2
View File
@@ -330,12 +330,13 @@ func (db *DownloadDashboard) render() {
// 拼接并格式化输出 // 拼接并格式化输出
builder := &strings.Builder{} builder := &strings.Builder{}
builder.WriteString("\x1b[H\x1b[2J") // 清屏操作
builder.WriteString(renderBox(headerLines, width)) builder.WriteString(renderBox(headerLines, width))
builder.WriteString(renderTitledBox("ActiveDownloads", activeLines, width)) builder.WriteString(renderTitledBox("ActiveDownloads", activeLines, width))
builder.WriteString(renderTitledBox("History", historyBody, width)) builder.WriteString(renderTitledBox("History", historyBody, width))
fmt.Fprint(db.out, builder.String()) content := builder.String()
fmt.Fprint(db.out, "\x1b[H\x1b[2J") // 清屏操作
fmt.Fprint(db.out, content)
} }
type dashboardSnapshot struct { type dashboardSnapshot struct {