From 8885dcc5d887277ff993af9f3fd744d75691a38e Mon Sep 17 00:00:00 2001 From: Michael Mead Date: Wed, 22 Nov 2023 15:16:20 -0800 Subject: [PATCH] feat: add volume `CreatedAt` field to volumes panel This commit adds the CreatedAt timestamp value of a Docker volume to the volumes panel. Signed-off-by: Michael Mead --- pkg/commands/volume.go | 2 ++ pkg/gui/volumes_panel.go | 1 + 2 files changed, 3 insertions(+) diff --git a/pkg/commands/volume.go b/pkg/commands/volume.go index e49736b8..5f809c1c 100644 --- a/pkg/commands/volume.go +++ b/pkg/commands/volume.go @@ -17,6 +17,7 @@ type Volume struct { OSCommand *OSCommand Log *logrus.Entry DockerCommand LimitedDockerCommand + CreatedAt string } // RefreshVolumes gets the volumes and stores them @@ -38,6 +39,7 @@ func (c *DockerCommand) RefreshVolumes() ([]*Volume, error) { OSCommand: c.OSCommand, Log: c.Log, DockerCommand: c, + CreatedAt: volume.CreatedAt, } } diff --git a/pkg/gui/volumes_panel.go b/pkg/gui/volumes_panel.go index 96085949..73d73d2e 100644 --- a/pkg/gui/volumes_panel.go +++ b/pkg/gui/volumes_panel.go @@ -66,6 +66,7 @@ func (gui *Gui) volumeConfigStr(volume *commands.Volume) string { output += utils.WithPadding("Mountpoint: ", padding) + volume.Volume.Mountpoint + "\n" output += utils.WithPadding("Labels: ", padding) + utils.FormatMap(padding, volume.Volume.Labels) + "\n" output += utils.WithPadding("Options: ", padding) + utils.FormatMap(padding, volume.Volume.Options) + "\n" + output += utils.WithPadding("CreatedAt: ", padding) + volume.Volume.CreatedAt + "\n" output += utils.WithPadding("Status: ", padding) if volume.Volume.Status != nil {