From 6af4fe4878600aa2304afe4a7b1d8ec4cd9da319 Mon Sep 17 00:00:00 2001 From: Jochen Schalanda Date: Wed, 6 Nov 2024 19:49:17 +0100 Subject: [PATCH] feat: add size to Layer Details view (wagoodman/dive#522) Refs https://github.com/wagoodman/dive/issues/469#issuecomment-1685322270 Co-authored-by: st-gr <38470677+st-gr@users.noreply.github.com> --- runtime/ui/view/layer_details.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/runtime/ui/view/layer_details.go b/runtime/ui/view/layer_details.go index fe6d394c..4981fd12 100644 --- a/runtime/ui/view/layer_details.go +++ b/runtime/ui/view/layer_details.go @@ -5,6 +5,7 @@ import ( "strings" "github.com/awesome-gocui/gocui" + "github.com/dustin/go-humanize" "github.com/sirupsen/logrus" "github.com/wagoodman/dive/dive/image" @@ -82,9 +83,11 @@ func (v *LayerDetails) Render() error { if len(v.CurrentLayer.Names) > 0 { tags = strings.Join(v.CurrentLayer.Names, ", ") } + lines = append(lines, []string{ format.Header("Tags: ") + tags, format.Header("Id: ") + v.CurrentLayer.Id, + format.Header("Size: ") + humanize.Bytes(v.CurrentLayer.Size), format.Header("Digest: ") + v.CurrentLayer.Digest, format.Header("Command:"), v.CurrentLayer.Command,