瀏覽代碼

Dev (#290)

* fix bug

* updata UI

* 0.3.2

### Added

- [Files] Files can now be selected multiple files and downloaded, deleted, moved, etc.
- [Apps] Support to modify the application opening address.([#204](https://github.com/IceWhaleTech/CasaOS/issues/204))

### Changed

- [Apps] Hide the display of non-essential environment variables in the application.
- [System] Network, disk, cpu, memory, etc. information is modified to be pushed via socket.
- [System] Optimize opening speed.([#214](https://github.com/IceWhaleTech/CasaOS/issues/214))
### Fixed

- [System] Fixed the problem that sync data cannot submit the device ID ([#68](https://github.com/IceWhaleTech/CasaOS/issues/68))
- [Files] Fixed the code editor center alignment display problem.([#210](https://github.com/IceWhaleTech/CasaOS/issues/210))
- [Files] Fixed the problem of wrong name when downloading files.([#240](https://github.com/IceWhaleTech/CasaOS/issues/240))
- [System] Fixed the network display as a negative number problem.([#224](https://github.com/IceWhaleTech/CasaOS/issues/224))

* Modify log help class

* Fix some bugs in 0.3.2

* Solve the operation file queue problem

* Exclude web folders

* update UI

* add cancel file operate

* Update UI

* Merge sockets to transfer data

* Conflict Resolution

* Update send data interval

* Update UI

* fixed bug

- Fix the problem of application opening failure on non-80 ports
- Modify port failure problem
- Modify environment variables disappearing problem

* update version function

* Fix version update issues

* 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)

* update UI
link 3 年之前
父節點
當前提交
0297fe67af
共有 10 個文件被更改,包括 30 次插入12 次删除
  1. 10 4
      CHANGELOG.md
  2. 10 0
      model/docker.go
  3. 9 7
      service/app.go
  4. 1 1
      web/index.html
  5. 0 0
      web/js/11.js
  6. 0 0
      web/js/12.js
  7. 0 0
      web/js/3.js
  8. 0 0
      web/js/4.js
  9. 0 0
      web/js/8.js
  10. 0 0
      web/js/app.js

+ 10 - 4
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
 ## [0.3.2.1] - 2022-06-14
 
 
+### Changed
+
+- [System] Adjusted the display style.
+
 ### Fixed
 ### 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
 ## [0.3.2] - 2022-06-10
 
 

+ 10 - 0
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
 package model
 
 
 type DockerStatsModel struct {
 type DockerStatsModel struct {

+ 9 - 7
service/app.go

@@ -464,12 +464,8 @@ func (a *appStruct) GetHardwareUsageSteam() {
 
 
 	fts := filters.NewArgs()
 	fts := filters.NewArgs()
 	fts.Add("label", "casaos=casaos")
 	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++ {
 	for i := 0; i < 100; i++ {
 		if config.CasaOSGlobalVariables.AppChange {
 		if config.CasaOSGlobalVariables.AppChange {
 			config.CasaOSGlobalVariables.AppChange = false
 			config.CasaOSGlobalVariables.AppChange = false
@@ -479,6 +475,10 @@ func (a *appStruct) GetHardwareUsageSteam() {
 				return true
 				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
 		var wg sync.WaitGroup
 		for _, v := range containers {
 		for _, v := range containers {
 			wg.Add(1)
 			wg.Add(1)
@@ -486,6 +486,7 @@ func (a *appStruct) GetHardwareUsageSteam() {
 				defer wg.Done()
 				defer wg.Done()
 				stats, err := cli.ContainerStats(ctx, v.ID, true)
 				stats, err := cli.ContainerStats(ctx, v.ID, true)
 				if err != nil {
 				if err != nil {
+					dataStats.Delete(v.ID)
 					return
 					return
 				}
 				}
 				decode := json.NewDecoder(stats.Body)
 				decode := json.NewDecoder(stats.Body)
@@ -501,6 +502,7 @@ func (a *appStruct) GetHardwareUsageSteam() {
 				dockerStats.Data = data
 				dockerStats.Data = data
 				dockerStats.Icon = v.Labels["icon"]
 				dockerStats.Icon = v.Labels["icon"]
 				dockerStats.Title = strings.ReplaceAll(v.Names[0], "/", "")
 				dockerStats.Title = strings.ReplaceAll(v.Names[0], "/", "")
+
 				dataStats.Store(v.ID, dockerStats)
 				dataStats.Store(v.ID, dockerStats)
 				if i == 99 {
 				if i == 99 {
 					stats.Body.Close()
 					stats.Body.Close()
@@ -509,7 +511,7 @@ func (a *appStruct) GetHardwareUsageSteam() {
 		}
 		}
 		wg.Wait()
 		wg.Wait()
 		isFinish = true
 		isFinish = true
-		time.Sleep(time.Second * 3)
+		time.Sleep(time.Second * 1)
 	}
 	}
 	isFinish = false
 	isFinish = false
 	cancel()
 	cancel()

+ 1 - 1
web/index.html

@@ -20,7 +20,7 @@
   <title>
   <title>
     CasaOS
     CasaOS
   </title>
   </title>
-<link href="/ui/css/10.d72d6157.css" rel="prefetch"><link href="/ui/css/11.f8326b27.css" rel="prefetch"><link href="/ui/css/16.a16d5119.css" rel="prefetch"><link href="/ui/css/17.cf8c898a.css" rel="prefetch"><link href="/ui/css/8.11ecc7a4.css" rel="prefetch"><link href="/ui/css/9.e57f27f9.css" rel="prefetch"><link href="/ui/js/0.js" rel="prefetch"><link href="/ui/js/1.js" rel="prefetch"><link href="/ui/js/10.js" rel="prefetch"><link href="/ui/js/11.js" rel="prefetch"><link href="/ui/js/12.js" rel="prefetch"><link href="/ui/js/13.js" rel="prefetch"><link href="/ui/js/14.js" rel="prefetch"><link href="/ui/js/15.js" rel="prefetch"><link href="/ui/js/16.js" rel="prefetch"><link href="/ui/js/17.js" rel="prefetch"><link href="/ui/js/18.js" rel="prefetch"><link href="/ui/js/2.js" rel="prefetch"><link href="/ui/js/3.js" rel="prefetch"><link href="/ui/js/4.js" rel="prefetch"><link href="/ui/js/5.js" rel="prefetch"><link href="/ui/js/6.js" rel="prefetch"><link href="/ui/js/7.js" rel="prefetch"><link href="/ui/js/8.js" rel="prefetch"><link href="/ui/js/9.js" rel="prefetch"><link href="/ui/css/app.4293eecd.css" rel="preload" as="style"><link href="/ui/css/vendors~app.8a2c28d7.css" rel="preload" as="style"><link href="/ui/js/app.js" rel="preload" as="script"><link href="/ui/js/vendors~app.js" rel="preload" as="script"><link href="/ui/css/vendors~app.8a2c28d7.css" rel="stylesheet"><link href="/ui/css/app.4293eecd.css" rel="stylesheet"></head>
+<link href="/ui/css/10.32be8789.css" rel="prefetch"><link href="/ui/css/11.dc77452d.css" rel="prefetch"><link href="/ui/css/16.1f93b660.css" rel="prefetch"><link href="/ui/css/17.046fd3d8.css" rel="prefetch"><link href="/ui/css/8.332ce37a.css" rel="prefetch"><link href="/ui/css/9.e1b97a16.css" rel="prefetch"><link href="/ui/js/0.js" rel="prefetch"><link href="/ui/js/1.js" rel="prefetch"><link href="/ui/js/10.js" rel="prefetch"><link href="/ui/js/11.js" rel="prefetch"><link href="/ui/js/12.js" rel="prefetch"><link href="/ui/js/13.js" rel="prefetch"><link href="/ui/js/14.js" rel="prefetch"><link href="/ui/js/15.js" rel="prefetch"><link href="/ui/js/16.js" rel="prefetch"><link href="/ui/js/17.js" rel="prefetch"><link href="/ui/js/18.js" rel="prefetch"><link href="/ui/js/2.js" rel="prefetch"><link href="/ui/js/3.js" rel="prefetch"><link href="/ui/js/4.js" rel="prefetch"><link href="/ui/js/5.js" rel="prefetch"><link href="/ui/js/6.js" rel="prefetch"><link href="/ui/js/7.js" rel="prefetch"><link href="/ui/js/8.js" rel="prefetch"><link href="/ui/js/9.js" rel="prefetch"><link href="/ui/css/app.f66141f5.css" rel="preload" as="style"><link href="/ui/css/vendors~app.a048753d.css" rel="preload" as="style"><link href="/ui/js/app.js" rel="preload" as="script"><link href="/ui/js/vendors~app.js" rel="preload" as="script"><link href="/ui/css/vendors~app.a048753d.css" rel="stylesheet"><link href="/ui/css/app.f66141f5.css" rel="stylesheet"></head>
 
 
 <body>
 <body>
   <noscript>
   <noscript>

File diff suppressed because it is too large
+ 0 - 0
web/js/11.js


File diff suppressed because it is too large
+ 0 - 0
web/js/12.js


File diff suppressed because it is too large
+ 0 - 0
web/js/3.js


File diff suppressed because it is too large
+ 0 - 0
web/js/4.js


File diff suppressed because it is too large
+ 0 - 0
web/js/8.js


File diff suppressed because it is too large
+ 0 - 0
web/js/app.js


Some files were not shown because too many files changed in this diff