diff --git a/UI b/UI
index 62a6bd4..796ed1c 160000
--- a/UI
+++ b/UI
@@ -1 +1 @@
-Subproject commit 62a6bd44d5740e3cb0ba0694d37c943147bea362
+Subproject commit 796ed1cfd076eaad2bd546b3f5723a4608206368
diff --git a/service/app.go b/service/app.go
index b08bcc8..b2d4686 100644
--- a/service/app.go
+++ b/service/app.go
@@ -479,10 +479,10 @@ func (a *appStruct) GetHardwareUsageSteam() {
if err != nil {
loger.Error("Failed to get container_list", zap.Any("err", err))
}
+ var temp sync.Map
var wg sync.WaitGroup
for _, v := range containers {
if v.State != "running" {
- dataStats.Delete(v.ID)
continue
}
wg.Add(1)
@@ -490,7 +490,6 @@ func (a *appStruct) GetHardwareUsageSteam() {
defer wg.Done()
stats, err := cli.ContainerStats(ctx, v.ID, true)
if err != nil {
- dataStats.Delete(v.ID)
return
}
decode := json.NewDecoder(stats.Body)
@@ -507,14 +506,16 @@ func (a *appStruct) GetHardwareUsageSteam() {
dockerStats.Icon = v.Labels["icon"]
dockerStats.Title = strings.ReplaceAll(v.Names[0], "/", "")
- dataStats.Store(v.ID, dockerStats)
+ temp.Store(v.ID, dockerStats)
if i == 99 {
stats.Body.Close()
}
}(v, i)
}
wg.Wait()
+ dataStats = temp
isFinish = true
+
time.Sleep(time.Second * 1)
}
isFinish = false
diff --git a/web/index.html b/web/index.html
index 395f8b2..84e74cf 100644
--- a/web/index.html
+++ b/web/index.html
@@ -20,7 +20,7 @@
CasaOS
-
+