From baf306d73c57e32887c840d8efb8375abee19972 Mon Sep 17 00:00:00 2001 From: "a624669980@163.com" Date: Tue, 14 Jun 2022 18:08:43 +0800 Subject: [PATCH] fixed bug - [System] Fixed the issue of widgets displaying wrongly on mobile devices. - [App] Fix the problem of application opening failure on non-80 ports ([#283](https://github.com/IceWhaleTech/CasaOS/issues/283) [#280](https://github.com/IceWhaleTech/CasaOS/issues/280)) - [System] Modify port failure problem ([#282](https://github.com/IceWhaleTech/CasaOS/issues/282)) - [App]Modify environment variables disappearing problem([#284](https://github.com/IceWhaleTech/CasaOS/issues/284)) - [System]Fix no update alert([#278](https://github.com/IceWhaleTech/CasaOS/issues/278)) - [System] Fixed some bugs of application cpu usage and memory staging([#272]https://github.com/IceWhaleTech/CasaOS/issues/272) --- CHANGELOG.md | 14 ++++++++++---- UI | 2 +- model/docker.go | 10 ++++++++++ service/app.go | 16 +++++++++------- web/index.html | 2 +- web/js/11.js | 2 +- web/js/12.js | 2 +- web/js/3.js | 2 +- web/js/4.js | 6 +++--- web/js/8.js | 26 +++++++++++++------------- web/js/app.js | 16 ++++++++-------- 11 files changed, 58 insertions(+), 40 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c6647f69e..81aa0c415 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,12 +20,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [0.3.2.1] - 2022-06-14 +### Changed + +- [System] Adjusted the display style. + ### Fixed -- Fix the problem of application opening failure on non-80 ports ([#283](https://github.com/IceWhaleTech/CasaOS/issues/283) [#280](https://github.com/IceWhaleTech/CasaOS/issues/280)) -- Modify port failure problem ([#282](https://github.com/IceWhaleTech/CasaOS/issues/282)) -- Modify environment variables disappearing problem([#284](https://github.com/IceWhaleTech/CasaOS/issues/284)) -- Fix no update alert([#278](https://github.com/IceWhaleTech/CasaOS/issues/278)) +- [System] Fixed the issue of widgets displaying wrongly on mobile devices. +- [App] Fix the problem of application opening failure on non-80 ports ([#283](https://github.com/IceWhaleTech/CasaOS/issues/283) [#280](https://github.com/IceWhaleTech/CasaOS/issues/280)) +- [System] Modify port failure problem ([#282](https://github.com/IceWhaleTech/CasaOS/issues/282)) +- [App]Modify environment variables disappearing problem([#284](https://github.com/IceWhaleTech/CasaOS/issues/284)) +- [System]Fix no update alert([#278](https://github.com/IceWhaleTech/CasaOS/issues/278)) +- [System] Fixed some bugs of application cpu usage and memory staging([#272]https://github.com/IceWhaleTech/CasaOS/issues/272) ## [0.3.2] - 2022-06-10 diff --git a/UI b/UI index 62a6bd44d..8a41d913c 160000 --- a/UI +++ b/UI @@ -1 +1 @@ -Subproject commit 62a6bd44d5740e3cb0ba0694d37c943147bea362 +Subproject commit 8a41d913cbfa82d2c0901a132d9b1fbce911457c diff --git a/model/docker.go b/model/docker.go index 1718eb6e3..59b006d6b 100644 --- a/model/docker.go +++ b/model/docker.go @@ -1,3 +1,13 @@ +/* + * @Author: LinkLeong link@icewhale.com + * @Date: 2021-12-08 18:10:25 + * @LastEditors: LinkLeong + * @LastEditTime: 2022-06-14 17:20:36 + * @FilePath: /CasaOS/model/docker.go + * @Description: + * @Website: https://www.casaos.io + * Copyright (c) 2022 by icewhale, All Rights Reserved. + */ package model type DockerStatsModel struct { diff --git a/service/app.go b/service/app.go index f976f137f..4ed972851 100644 --- a/service/app.go +++ b/service/app.go @@ -464,12 +464,8 @@ func (a *appStruct) GetHardwareUsageSteam() { fts := filters.NewArgs() fts.Add("label", "casaos=casaos") - //fts.Add("label", "casaos") - //fts.Add("casaos", "casaos") - containers, err := cli.ContainerList(context.Background(), types.ContainerListOptions{All: true, Filters: fts}) - if err != nil { - loger.Error("Failed to get container_list", zap.Any("err", err)) - } + fts.Add("status", "running") + for i := 0; i < 100; i++ { if config.CasaOSGlobalVariables.AppChange { config.CasaOSGlobalVariables.AppChange = false @@ -479,6 +475,10 @@ func (a *appStruct) GetHardwareUsageSteam() { return true }) } + containers, err := cli.ContainerList(context.Background(), types.ContainerListOptions{All: true, Filters: fts}) + if err != nil { + loger.Error("Failed to get container_list", zap.Any("err", err)) + } var wg sync.WaitGroup for _, v := range containers { wg.Add(1) @@ -486,6 +486,7 @@ 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) @@ -501,6 +502,7 @@ func (a *appStruct) GetHardwareUsageSteam() { dockerStats.Data = data dockerStats.Icon = v.Labels["icon"] dockerStats.Title = strings.ReplaceAll(v.Names[0], "/", "") + dataStats.Store(v.ID, dockerStats) if i == 99 { stats.Body.Close() @@ -509,7 +511,7 @@ func (a *appStruct) GetHardwareUsageSteam() { } wg.Wait() isFinish = true - time.Sleep(time.Second * 3) + time.Sleep(time.Second * 1) } isFinish = false cancel() diff --git a/web/index.html b/web/index.html index 8ee9d75ee..fc395183c 100644 --- a/web/index.html +++ b/web/index.html @@ -20,7 +20,7 @@ CasaOS - +