diff --git a/backend/app/service/device_clean.go b/backend/app/service/device_clean.go index ca06e8415..700caa0c0 100644 --- a/backend/app/service/device_clean.go +++ b/backend/app/service/device_clean.go @@ -522,70 +522,35 @@ func loadContainerTree() []dto.CleanTree { if err != nil { return treeData } - var listImage []dto.CleanTree imageSize := uint64(0) for _, file := range diskUsage.Images { if file.Containers == 0 { - name := "none" - if file.RepoTags != nil { - name = file.RepoTags[0] - } - item := dto.CleanTree{ - ID: file.ID, - Label: name, - Type: "images", - Size: uint64(file.Size), - Name: name, - IsCheck: false, - IsRecommend: true, - } - imageSize += item.Size - listImage = append(listImage, item) + imageSize += uint64(file.Size) } } - treeData = append(treeData, dto.CleanTree{ID: uuid.NewString(), Label: "container_images", Size: imageSize, Children: listImage, Type: "images", IsRecommend: true}) + treeData = append(treeData, dto.CleanTree{ID: uuid.NewString(), Label: "container_images", Size: imageSize, Children: nil, Type: "images", IsRecommend: true}) - var listContainer []dto.CleanTree containerSize := uint64(0) for _, file := range diskUsage.Containers { if file.State != "running" { - item := dto.CleanTree{ - ID: file.ID, - Label: file.Names[0], - Type: "containers", - Size: uint64(file.SizeRw), - Name: file.Names[0], - IsCheck: false, - IsRecommend: true, - } - containerSize += item.Size - listContainer = append(listContainer, item) + containerSize += uint64(file.SizeRw) } } - treeData = append(treeData, dto.CleanTree{ID: uuid.NewString(), Label: "container_containers", Size: containerSize, Children: listContainer, Type: "containers", IsRecommend: true}) + treeData = append(treeData, dto.CleanTree{ID: uuid.NewString(), Label: "container_containers", Size: containerSize, Children: nil, Type: "containers", IsRecommend: true}) - var listVolume []dto.CleanTree volumeSize := uint64(0) for _, file := range diskUsage.Volumes { if file.UsageData.RefCount <= 0 { - item := dto.CleanTree{ - ID: uuid.NewString(), - Label: file.Name, - Type: "volumes", - Size: uint64(file.UsageData.Size), - Name: file.Name, - IsCheck: false, - IsRecommend: true, - } - volumeSize += item.Size - listVolume = append(listVolume, item) + volumeSize += uint64(file.UsageData.Size) } } - treeData = append(treeData, dto.CleanTree{ID: uuid.NewString(), Label: "container_volumes", Size: volumeSize, Children: listVolume, Type: "volumes", IsRecommend: true}) + treeData = append(treeData, dto.CleanTree{ID: uuid.NewString(), Label: "container_volumes", Size: volumeSize, Children: nil, Type: "volumes", IsRecommend: true}) var buildCacheTotalSize int64 for _, cache := range diskUsage.BuildCache { - buildCacheTotalSize += cache.Size + if cache.Type == "source.local" { + buildCacheTotalSize += cache.Size + } } treeData = append(treeData, dto.CleanTree{ID: uuid.NewString(), Label: "build_cache", Size: uint64(buildCacheTotalSize), Type: "build_cache", IsRecommend: true}) return treeData diff --git a/frontend/src/assets/iconfont/iconfont.css b/frontend/src/assets/iconfont/iconfont.css index b87102f15..874c42a64 100644 --- a/frontend/src/assets/iconfont/iconfont.css +++ b/frontend/src/assets/iconfont/iconfont.css @@ -1,9 +1,9 @@ @font-face { font-family: "panel"; /* Project id 3575356 */ - src: url('iconfont.woff2?t=1716193696248') format('woff2'), - url('iconfont.woff?t=1716193696248') format('woff'), - url('iconfont.ttf?t=1716193696248') format('truetype'), - url('iconfont.svg?t=1716193696248#panel') format('svg'); + src: url('iconfont.woff2?t=1717468101688') format('woff2'), + url('iconfont.woff?t=1717468101688') format('woff'), + url('iconfont.ttf?t=1717468101688') format('truetype'), + url('iconfont.svg?t=1717468101688#panel') format('svg'); } .panel { @@ -14,6 +14,94 @@ -moz-osx-font-smoothing: grayscale; } +.p-docker1:before { + content: "\e689"; +} + +.p-Firefox:before { + content: "\e87c"; +} + +.p-m-ios:before { + content: "\e60e"; +} + +.p-m-pc:before { + content: "\e771"; +} + +.p-m-theworld:before { + content: "\e947"; +} + +.p-m-android:before { + content: "\e9e0"; +} + +.p-m-tencent:before { + content: "\e609"; +} + +.p-m-windows:before { + content: "\e6a0"; +} + +.p-m-machine:before { + content: "\e862"; +} + +.p-m-mobile:before { + content: "\e620"; +} + +.p-m-ucweb:before { + content: "\e603"; +} + +.p-m-edge:before { + content: "\e8e2"; +} + +.p-m-2345explorer:before { + content: "\e60a"; +} + +.p-m-chrome:before { + content: "\ea09"; +} + +.p-m-opera:before { + content: "\ea0e"; +} + +.p-m-linux:before { + content: "\e80b"; +} + +.p-m-maxthon:before { + content: "\e676"; +} + +.p-m-mac:before { + content: "\ef2d"; +} + +.p-m-ie:before { + content: "\eaab"; +} + +.p-Chrome-OS:before { + content: "\e60b"; +} + +.p-m-safari:before { + content: "\e60c"; +} + +.p-m-360se:before { + content: "\e678"; +} + .p-monitor-1:before { content: "\e60d"; } diff --git a/frontend/src/assets/iconfont/iconfont.js b/frontend/src/assets/iconfont/iconfont.js index 39eb66470..55695b0f1 100644 --- a/frontend/src/assets/iconfont/iconfont.js +++ b/frontend/src/assets/iconfont/iconfont.js @@ -1 +1 @@ -window._iconfont_svg_string_3575356='',function(c){var l=(l=document.getElementsByTagName("script"))[l.length-1],h=l.getAttribute("data-injectcss"),l=l.getAttribute("data-disable-injectsvg");if(!l){var a,t,p,v,z,i=function(l,h){h.parentNode.insertBefore(l,h)};if(h&&!c.__iconfont__svg__cssinject__){c.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(l){console&&console.log(l)}}a=function(){var l,h=document.createElement("div");h.innerHTML=c._iconfont_svg_string_3575356,(h=h.getElementsByTagName("svg")[0])&&(h.setAttribute("aria-hidden","true"),h.style.position="absolute",h.style.width=0,h.style.height=0,h.style.overflow="hidden",h=h,(l=document.body).firstChild?i(h,l.firstChild):l.appendChild(h))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(a,0):(t=function(){document.removeEventListener("DOMContentLoaded",t,!1),a()},document.addEventListener("DOMContentLoaded",t,!1)):document.attachEvent&&(p=a,v=c.document,z=!1,m(),v.onreadystatechange=function(){"complete"==v.readyState&&(v.onreadystatechange=null,d())})}function d(){z||(z=!0,p())}function m(){try{v.documentElement.doScroll("left")}catch(l){return void setTimeout(m,50)}d()}}(window); \ No newline at end of file +window._iconfont_svg_string_3575356='',function(h){var l=(l=document.getElementsByTagName("script"))[l.length-1],a=l.getAttribute("data-injectcss"),l=l.getAttribute("data-disable-injectsvg");if(!l){var c,t,p,z,v,i=function(l,a){a.parentNode.insertBefore(l,a)};if(a&&!h.__iconfont__svg__cssinject__){h.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(l){console&&console.log(l)}}c=function(){var l,a=document.createElement("div");a.innerHTML=h._iconfont_svg_string_3575356,(a=a.getElementsByTagName("svg")[0])&&(a.setAttribute("aria-hidden","true"),a.style.position="absolute",a.style.width=0,a.style.height=0,a.style.overflow="hidden",a=a,(l=document.body).firstChild?i(a,l.firstChild):l.appendChild(a))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(c,0):(t=function(){document.removeEventListener("DOMContentLoaded",t,!1),c()},document.addEventListener("DOMContentLoaded",t,!1)):document.attachEvent&&(p=c,z=h.document,v=!1,d(),z.onreadystatechange=function(){"complete"==z.readyState&&(z.onreadystatechange=null,m())})}function m(){v||(v=!0,p())}function d(){try{z.documentElement.doScroll("left")}catch(l){return void setTimeout(d,50)}m()}}(window); \ No newline at end of file diff --git a/frontend/src/assets/iconfont/iconfont.json b/frontend/src/assets/iconfont/iconfont.json index 4743ee57f..b6c5480f6 100644 --- a/frontend/src/assets/iconfont/iconfont.json +++ b/frontend/src/assets/iconfont/iconfont.json @@ -5,6 +5,160 @@ "css_prefix_text": "p-", "description": "", "glyphs": [ + { + "icon_id": "4630923", + "name": "docker", + "font_class": "docker1", + "unicode": "e689", + "unicode_decimal": 59017 + }, + { + "icon_id": "37759945", + "name": "Firefox", + "font_class": "Firefox", + "unicode": "e87c", + "unicode_decimal": 59516 + }, + { + "icon_id": "1120947", + "name": "mac", + "font_class": "m-ios", + "unicode": "e60e", + "unicode_decimal": 58894 + }, + { + "icon_id": "1354850", + "name": "PC", + "font_class": "m-pc", + "unicode": "e771", + "unicode_decimal": 59249 + }, + { + "icon_id": "1948990", + "name": "浏览器-世界之窗", + "font_class": "m-theworld", + "unicode": "e947", + "unicode_decimal": 59719 + }, + { + "icon_id": "3176588", + "name": "Android", + "font_class": "m-android", + "unicode": "e9e0", + "unicode_decimal": 59872 + }, + { + "icon_id": "3547761", + "name": "tencent", + "font_class": "m-tencent", + "unicode": "e609", + "unicode_decimal": 58889 + }, + { + "icon_id": "3846904", + "name": "Windows", + "font_class": "m-windows", + "unicode": "e6a0", + "unicode_decimal": 59040 + }, + { + "icon_id": "6172784", + "name": "cloud-machine", + "font_class": "m-machine", + "unicode": "e862", + "unicode_decimal": 59490 + }, + { + "icon_id": "6189402", + "name": "mobile", + "font_class": "m-mobile", + "unicode": "e620", + "unicode_decimal": 58912 + }, + { + "icon_id": "7172218", + "name": "UC浏览器", + "font_class": "m-ucweb", + "unicode": "e603", + "unicode_decimal": 58883 + }, + { + "icon_id": "7736005", + "name": "edge", + "font_class": "m-edge", + "unicode": "e8e2", + "unicode_decimal": 59618 + }, + { + "icon_id": "8714496", + "name": "2345浏览器", + "font_class": "m-2345explorer", + "unicode": "e60a", + "unicode_decimal": 58890 + }, + { + "icon_id": "11983530", + "name": "chrome", + "font_class": "m-chrome", + "unicode": "ea09", + "unicode_decimal": 59913 + }, + { + "icon_id": "11983549", + "name": "opera", + "font_class": "m-opera", + "unicode": "ea0e", + "unicode_decimal": 59918 + }, + { + "icon_id": "12463174", + "name": "linux", + "font_class": "m-linux", + "unicode": "e80b", + "unicode_decimal": 59403 + }, + { + "icon_id": "13354966", + "name": "maxthonlogo", + "font_class": "m-maxthon", + "unicode": "e676", + "unicode_decimal": 58998 + }, + { + "icon_id": "18583105", + "name": "macbook", + "font_class": "m-mac", + "unicode": "ef2d", + "unicode_decimal": 61229 + }, + { + "icon_id": "19448086", + "name": "IE", + "font_class": "m-ie", + "unicode": "eaab", + "unicode_decimal": 60075 + }, + { + "icon_id": "32828855", + "name": "Chrome-OS", + "font_class": "Chrome-OS", + "unicode": "e60b", + "unicode_decimal": 58891 + }, + { + "icon_id": "34065043", + "name": "Safari浏览器", + "font_class": "m-safari", + "unicode": "e60c", + "unicode_decimal": 58892 + }, + { + "icon_id": "37095081", + "name": "bro360se", + "font_class": "m-360se", + "unicode": "e678", + "unicode_decimal": 59000 + }, { "icon_id": "8156501", "name": "e6d8", diff --git a/frontend/src/assets/iconfont/iconfont.svg b/frontend/src/assets/iconfont/iconfont.svg index 7a1197847..e63e80d25 100644 --- a/frontend/src/assets/iconfont/iconfont.svg +++ b/frontend/src/assets/iconfont/iconfont.svg @@ -14,6 +14,50 @@ /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/src/assets/iconfont/iconfont.ttf b/frontend/src/assets/iconfont/iconfont.ttf index 2dc17ad68..68f813950 100644 Binary files a/frontend/src/assets/iconfont/iconfont.ttf and b/frontend/src/assets/iconfont/iconfont.ttf differ diff --git a/frontend/src/assets/iconfont/iconfont.woff b/frontend/src/assets/iconfont/iconfont.woff index 95608de62..4cfa1a129 100644 Binary files a/frontend/src/assets/iconfont/iconfont.woff and b/frontend/src/assets/iconfont/iconfont.woff differ diff --git a/frontend/src/assets/iconfont/iconfont.woff2 b/frontend/src/assets/iconfont/iconfont.woff2 index 5c0176a5d..77f403aec 100644 Binary files a/frontend/src/assets/iconfont/iconfont.woff2 and b/frontend/src/assets/iconfont/iconfont.woff2 differ diff --git a/frontend/src/views/toolbox/clean/index.vue b/frontend/src/views/toolbox/clean/index.vue index b7e95b650..421cee972 100644 --- a/frontend/src/views/toolbox/clean/index.vue +++ b/frontend/src/views/toolbox/clean/index.vue @@ -58,7 +58,7 @@ - +