mirror of https://github.com/1Panel-dev/1Panel
fix: 容器垃圾清理不展示细节下拉清除 (#5271)
parent
e638a416ff
commit
dab5434125
|
@ -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
|
||||
|
|
|
@ -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";
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -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",
|
||||
|
|
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 96 KiB After Width: | Height: | Size: 169 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -58,7 +58,7 @@
|
|||
<el-card class="e-card">
|
||||
<el-row>
|
||||
<el-col :span="4">
|
||||
<svg-icon iconName="p-docker" class="svg-icon"></svg-icon>
|
||||
<svg-icon iconName="p-docker1" class="svg-icon"></svg-icon>
|
||||
<el-button link class="card_icon" />
|
||||
</el-col>
|
||||
<el-col :span="20">
|
||||
|
|
Loading…
Reference in New Issue