Skip to content

CasaOS - A simple, easy-to-use, elegant open-source Personal Cloud system.

Up json (#1186)

linkf48cddf92445
diff --git a/model/sys_common.go b/model/sys_common.go
index 859c2b4..90ff8ba 100644
--- a/model/sys_common.go
+++ b/model/sys_common.go
@@ -70,7 +70,8 @@ type FileSetting struct {
DownloadDir string `json:"download_dir"`
}
type BaseInfo struct {
- Hash string `json:"i"`
- Version string `json:"v"`
- Channel string `json:"c,omitempty"`
+ Hash string `json:"i"`
+ Version string `json:"v"`
+ Channel string `json:"c,omitempty"`
+ DriveModel string `json:"m,omitempty"`
}
diff --git a/route/init.go b/route/init.go
index 697d9ad..70d2628 100644
--- a/route/init.go
+++ b/route/init.go
@@ -17,6 +17,7 @@ import (
"strings"
"time"
+ file1 "github.com/IceWhaleTech/CasaOS-Common/utils/file"
"github.com/IceWhaleTech/CasaOS-Common/utils/logger"
"github.com/IceWhaleTech/CasaOS/common"
"github.com/IceWhaleTech/CasaOS/model"
@@ -53,6 +54,12 @@ func InitInfo() {
}
mb.Hash = encryption.GetMD5ByStr(mac)
mb.Version = common.VERSION
+ osRelease, _ := file1.ReadOSRelease()
+
+ mb.DriveModel = osRelease["MODEL"]
+ if len(mb.DriveModel) == 0 {
+ mb.DriveModel = "Casa"
+ }
os.Remove(config.AppInfo.DBPath + "/baseinfo.conf")
by, err := json.Marshal(mb)
if err != nil {