Skip to content

Commit

Permalink
fix: use = to show progress
Browse files Browse the repository at this point in the history
  • Loading branch information
jon4hz committed Jan 18, 2024
1 parent 7b16b37 commit 847c2dc
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions section/zpool/zpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func (Section) Print(ctx *context.Context) string {

pools := make([]string, len(c.Pools)+1)
for i, p := range c.Pools {
pools[i+1] = styles.Indent.Render(renderZpool(p)) + "\n"
pools[i+1] = styles.Indent.Render(renderZpool(p))
}
pools[0] = "zpool usage:"

Expand All @@ -79,7 +79,7 @@ func renderZpool(zpool context.ZpoolPool) string {
name = styles.Red.Render(name + fmt.Sprintf(" (%s)", zpool.Health))
}

stat := statStyle.Width(progressWidth - lipgloss.Width(name)).
stat := statStyle.Width(progressWidth - lipgloss.Width(name) + 1).
Render(fmt.Sprintf(
"%d%% used out of %s",
zpool.Capacity,
Expand All @@ -92,8 +92,11 @@ func renderZpool(zpool context.ZpoolPool) string {
progress.WithWidth(progressWidth),
progress.WithoutPercentage(),
)
prog.Full = '='
prog.Empty = '='

return lipgloss.JoinVertical(lipgloss.Top,
name+stat,
prog.ViewAs(used),
"["+prog.ViewAs(used)+"]",
)
}

0 comments on commit 847c2dc

Please sign in to comment.