Skip to content

Commit c07e06d

Browse files
hi-leiclaude
andcommitted
fix(volume): improve trash display with type, contract, and pricing
Shows OS/Block type, contract, monthly price, and created date. Note: SDK Volume struct lacks deleted_at and is_permanently_deleted fields — those will show once the SDK is updated. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent cbd7c06 commit c07e06d

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

internal/verda-cli/cmd/volume/trash.go

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,19 @@ func runTrash(cmd *cobra.Command, f cmdutil.Factory, ioStreams cmdutil.IOStreams
6161
_, _ = fmt.Fprintf(ioStreams.Out, " %d volume(s) in trash\n\n", len(volumes))
6262

6363
for _, v := range volumes {
64-
_, _ = fmt.Fprintf(ioStreams.Out, " %s\n", bold.Render(v.Name))
64+
volType := "Block"
65+
if v.IsOSVolume {
66+
volType = "OS"
67+
}
68+
_, _ = fmt.Fprintf(ioStreams.Out, " %s %s\n", bold.Render(v.Name), dim.Render(volType))
6569
_, _ = fmt.Fprintf(ioStreams.Out, " %s %s\n", dim.Render("ID: "), v.ID)
66-
_, _ = fmt.Fprintf(ioStreams.Out, " %s %dGB\n", dim.Render("Size: "), v.Size)
67-
_, _ = fmt.Fprintf(ioStreams.Out, " %s %s\n", dim.Render("Type: "), v.Type)
70+
_, _ = fmt.Fprintf(ioStreams.Out, " %s %dGB %s\n", dim.Render("Size: "), v.Size, v.Type)
6871
_, _ = fmt.Fprintf(ioStreams.Out, " %s %s\n", dim.Render("Location:"), v.Location)
69-
_, _ = fmt.Fprintf(ioStreams.Out, " %s %s\n\n", dim.Render("Deleted: "), v.CreatedAt.Format("2 Jan 2006, 15:04"))
72+
_, _ = fmt.Fprintf(ioStreams.Out, " %s %s\n", dim.Render("Contract:"), v.Contract)
73+
if v.MonthlyPrice > 0 {
74+
_, _ = fmt.Fprintf(ioStreams.Out, " %s $%.2f/mo (%s)\n", dim.Render("Price: "), v.MonthlyPrice, v.Currency)
75+
}
76+
_, _ = fmt.Fprintf(ioStreams.Out, " %s %s\n\n", dim.Render("Created: "), v.CreatedAt.Format("2 Jan 2006, 15:04"))
7077
}
7178

7279
return nil

0 commit comments

Comments
 (0)