mirror of
https://github.com/IceWhaleTech/CasaOS.git
synced 2025-11-07 07:09:46 +00:00
Merge branch 'main' into oscs_fix_cjri788au51vtpiu8um0
This commit is contained in:
commit
d3e9f13acd
@ -83,7 +83,7 @@ Furthermore, the personal cloud could combine personal data to train personalize
|
|||||||
- Multiple hardware and base system support
|
- Multiple hardware and base system support
|
||||||
- ZimaBoard, NUC, RPi, old computers, whatever is available.
|
- ZimaBoard, NUC, RPi, old computers, whatever is available.
|
||||||
- Selected apps in the app store, one-click installation
|
- Selected apps in the app store, one-click installation
|
||||||
- Nextcloud, HomeAssiant, AdGuard, Jellyfin, *arr and more!
|
- Nextcloud, HomeAssistant, AdGuard, Jellyfin, *arr and more!
|
||||||
- Easily install numerous Docker apps
|
- Easily install numerous Docker apps
|
||||||
- Over 100,000 apps from the Docker ecosystem can be easily installed
|
- Over 100,000 apps from the Docker ecosystem can be easily installed
|
||||||
- Elegant drive and file management
|
- Elegant drive and file management
|
||||||
|
|||||||
@ -20,10 +20,11 @@ servers:
|
|||||||
tags:
|
tags:
|
||||||
- name: Health methods
|
- name: Health methods
|
||||||
description: |-
|
description: |-
|
||||||
(TODO)
|
These methods are used to check the health and status of the CasaOS API and associated services.
|
||||||
- name: File methods
|
|
||||||
|
- name: File methods
|
||||||
description: |-
|
description: |-
|
||||||
(TODO)
|
The File methods allow you to interact with files and directories on the CasaOS system.
|
||||||
|
|
||||||
x-tagGroups:
|
x-tagGroups:
|
||||||
- name: Methods
|
- name: Methods
|
||||||
@ -232,4 +233,4 @@ components:
|
|||||||
example: "CasaOS"
|
example: "CasaOS"
|
||||||
status:
|
status:
|
||||||
type: string
|
type: string
|
||||||
example: "online"
|
example: "online"
|
||||||
|
|||||||
@ -2,7 +2,7 @@ package common
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
SERVICENAME = "casaos"
|
SERVICENAME = "casaos"
|
||||||
VERSION = "0.4.4.2"
|
VERSION = "0.4.4.3"
|
||||||
BODY = " "
|
BODY = " "
|
||||||
RANW_NAME = "IceWhale-RemoteAccess"
|
RANW_NAME = "IceWhale-RemoteAccess"
|
||||||
)
|
)
|
||||||
|
|||||||
@ -33,7 +33,7 @@ import (
|
|||||||
func InitFunction() {
|
func InitFunction() {
|
||||||
go InitNetworkMount()
|
go InitNetworkMount()
|
||||||
go InitInfo()
|
go InitInfo()
|
||||||
go InitZerotier()
|
//go InitZerotier()
|
||||||
}
|
}
|
||||||
|
|
||||||
func InitInfo() {
|
func InitInfo() {
|
||||||
|
|||||||
@ -102,16 +102,20 @@ func FileOperate(k string) {
|
|||||||
os.RemoveAll(temp.To + "/" + lastPath)
|
os.RemoveAll(temp.To + "/" + lastPath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
err := os.Rename(v.From, temp.To+"/"+lastPath)
|
err := file.CopyDir(v.From, temp.To, temp.Style)
|
||||||
if err != nil {
|
if err == nil {
|
||||||
logger.Error("file move error", zap.Any("err", err))
|
err = os.RemoveAll(v.From)
|
||||||
err = file.MoveFile(v.From, temp.To+"/"+lastPath)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error("MoveFile error", zap.Any("err", err))
|
logger.Error("file move error", zap.Any("err", err))
|
||||||
continue
|
err = file.MoveFile(v.From, temp.To+"/"+lastPath)
|
||||||
}
|
if err != nil {
|
||||||
|
logger.Error("MoveFile error", zap.Any("err", err))
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if temp.Type == "copy" {
|
} else if temp.Type == "copy" {
|
||||||
err := file.CopyDir(v.From, temp.To, temp.Style)
|
err := file.CopyDir(v.From, temp.To, temp.Style)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@ -473,6 +473,7 @@ func GetCPUThermalZone() string {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Cache.SetDefault(keyName, path)
|
Cache.SetDefault(keyName, path)
|
||||||
return path
|
return path
|
||||||
}
|
}
|
||||||
@ -483,7 +484,10 @@ func (s *systemService) GetCPUTemperature() int {
|
|||||||
if len(path) > 0 {
|
if len(path) > 0 {
|
||||||
outPut = string(file.ReadFullFile(path + "/temp"))
|
outPut = string(file.ReadFullFile(path + "/temp"))
|
||||||
} else {
|
} else {
|
||||||
outPut = "0"
|
outPut = string(file.ReadFullFile("/sys/class/hwmon/hwmon0/temp1_input"))
|
||||||
|
if len(outPut) == 0 {
|
||||||
|
outPut = "0"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
celsius, _ := strconv.Atoi(strings.TrimSpace(outPut))
|
celsius, _ := strconv.Atoi(strings.TrimSpace(outPut))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user