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 <mmead.developer@gmail.com>
This commit is contained in:
Michael Mead 2023-11-22 15:16:20 -08:00
parent 80af149b02
commit 8885dcc5d8
2 changed files with 3 additions and 0 deletions

View file

@ -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,
}
}

View file

@ -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 {