From 08070e6843ae190a75d03c6bae1520af6b3eaf75 Mon Sep 17 00:00:00 2001 From: "jialong.wang" Date: Sat, 13 Apr 2024 00:22:44 +0800 Subject: [PATCH] feat: version 1.3.1 --- go.mod | 2 +- go.sum | 10 ++++++---- service/task.go | 8 ++++++++ web/dist/index.html | 2 +- web/src/views/container/image/index.vue | 5 ----- 5 files changed, 16 insertions(+), 11 deletions(-) diff --git a/go.mod b/go.mod index 1526c15..919d596 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.21.4 require ( github.com/amuluze/amutool/database v0.0.0-20240329052546-d5fbbede26a1 - github.com/amuluze/amutool/docker v0.0.0-20240408023446-ec916475d43e + github.com/amuluze/amutool/docker v0.0.0-20240412134521-f5acb72cb7dd github.com/amuluze/amutool/errors v0.0.0-20240409163639-4b2153b70b7a github.com/amuluze/amutool/logger v0.0.0-20240329052546-d5fbbede26a1 github.com/amuluze/amutool/timex v0.0.0-20240329052546-d5fbbede26a1 diff --git a/go.sum b/go.sum index ea1c833..1316821 100644 --- a/go.sum +++ b/go.sum @@ -112,10 +112,12 @@ github.com/alexflint/go-filemutex v0.0.0-20171022225611-72bdc8eae2ae/go.mod h1:C github.com/alexflint/go-filemutex v1.1.0/go.mod h1:7P4iRhttt/nUvUOrYIhcpMzv2G6CY9UnI16Z+UJqRyk= github.com/amuluze/amutool/database v0.0.0-20240329052546-d5fbbede26a1 h1:V0y+lPgC19LD+HLI3iIKhDBQ3hWe4GuLO2ZmH6WgJ8Y= github.com/amuluze/amutool/database v0.0.0-20240329052546-d5fbbede26a1/go.mod h1:JlinOdHx/H3IfAzkD4ed5AV4JlPTvIXi5aJKDoZ0inI= -github.com/amuluze/amutool/docker v0.0.0-20240408023446-ec916475d43e h1:7tsTiGWXs3+9rz2q1Ya+nTcdWbrQLavNIts2OCylmaw= -github.com/amuluze/amutool/docker v0.0.0-20240408023446-ec916475d43e/go.mod h1:0fJE1xESetX+Z+betFhczY/GFkEAlrfDe8popJVCdR0= -github.com/amuluze/amutool/errors v0.0.0-20240408023446-ec916475d43e h1:55KOCRuRP1HHNSQ6iK6dt2qV1F6vORc/Xy911RgTXbs= -github.com/amuluze/amutool/errors v0.0.0-20240408023446-ec916475d43e/go.mod h1:0ihSw6Kx+ZKoxxdmgxM66x9G1LISH4srjemQ9ysegP4= +github.com/amuluze/amutool/docker v0.0.0-20240409163639-4b2153b70b7a h1:OLZFhmXWukpDIGp7hnGLNlYhBw508xwg4kiGYzsCNXA= +github.com/amuluze/amutool/docker v0.0.0-20240409163639-4b2153b70b7a/go.mod h1:0fJE1xESetX+Z+betFhczY/GFkEAlrfDe8popJVCdR0= +github.com/amuluze/amutool/docker v0.0.0-20240412111543-0df6e29ee226 h1:kNUpfsSab1qyrqu7FNpb2v9NNeeprGV5cURyXCJ/u/Y= +github.com/amuluze/amutool/docker v0.0.0-20240412111543-0df6e29ee226/go.mod h1:0fJE1xESetX+Z+betFhczY/GFkEAlrfDe8popJVCdR0= +github.com/amuluze/amutool/docker v0.0.0-20240412134521-f5acb72cb7dd h1:AS+w6Kb2nP+UnsHcAbXJNoshcYVfvOC5XelEuqfS4Ew= +github.com/amuluze/amutool/docker v0.0.0-20240412134521-f5acb72cb7dd/go.mod h1:0fJE1xESetX+Z+betFhczY/GFkEAlrfDe8popJVCdR0= github.com/amuluze/amutool/errors v0.0.0-20240409163639-4b2153b70b7a h1:pClvDJdbCVe6JA4eLVJCvHAvcwwccahnR9yCspqQEA8= github.com/amuluze/amutool/errors v0.0.0-20240409163639-4b2153b70b7a/go.mod h1:0ihSw6Kx+ZKoxxdmgxM66x9G1LISH4srjemQ9ysegP4= github.com/amuluze/amutool/logger v0.0.0-20240329052546-d5fbbede26a1 h1:0VIEkQkSSrmXeOLW18NSAQUQRPbNAdHrqBbhi0WhZ/0= diff --git a/service/task.go b/service/task.go index 243f872..129df73 100644 --- a/service/task.go +++ b/service/task.go @@ -249,12 +249,20 @@ func (a *TimedTask) image(timestamp time.Time) { return } var list model.Images + duplicateImage := make(map[string]struct{}) for _, im := range images { val, ok := a.cache.Get(im.Name + ":" + im.Tag) if !ok { slog.Error("failed to get image cache", "error", err) val = 0 } + if _, ok := duplicateImage[im.ID]; !ok { + duplicateImage[im.ID] = struct{}{} + } else { + if im.Tag != "latest" { + continue + } + } list = append(list, model.Image{ Timestamp: timestamp, ImageID: im.ID[7:19], diff --git a/web/dist/index.html b/web/dist/index.html index bcbb1f6..9b9df60 100644 --- a/web/dist/index.html +++ b/web/dist/index.html @@ -14,7 +14,7 @@ s.parentNode.insertBefore(hm, s) })() - + diff --git a/web/src/views/container/image/index.vue b/web/src/views/container/image/index.vue index 3cfc545..110c8a0 100644 --- a/web/src/views/container/image/index.vue +++ b/web/src/views/container/image/index.vue @@ -95,11 +95,6 @@ const pruneImagesForce = () => { type: 'success', message: '清理完成' }) - }).catch(() => { - ElMessage({ - type: 'error', - message: '清理失败' - }) }) }