link преди 3 години
родител
ревизия
3c9b410693
променени са 7 файла, в които са добавени 17 реда и са изтрити 15 реда
  1. 6 3
      model/zima.go
  2. 1 0
      pkg/utils/command/command_helper.go
  3. 1 1
      route/route.go
  4. 2 2
      route/v1/system.go
  5. 3 2
      service/zima_info.go
  6. 2 4
      shell/assist.sh
  7. 2 3
      types/system.go

+ 6 - 3
model/zima.go

@@ -1,7 +1,10 @@
 package model
 
+import "time"
+
 type Path struct {
-	Name  string `json:"name"`
-	Path  string `json:"path"`
-	IsDir bool   `json:"is_dir"`
+	Name  string    `json:"name"`
+	Path  string    `json:"path"`
+	IsDir bool      `json:"is_dir"`
+	Date  time.Time `json:"date"`
 }

+ 1 - 0
pkg/utils/command/command_helper.go

@@ -101,6 +101,7 @@ func ExecSmartCTLByPath(path string) []byte {
 	output, err := exec.CommandContext(ctx, "smartctl", "-a", path, "-j").Output()
 	if err != nil {
 		fmt.Println("smartctl", err)
+		fmt.Println("output", string(output))
 		return nil
 	}
 	return output

+ 1 - 1
route/route.go

@@ -205,7 +205,7 @@ func InitRouter() *gin.Engine {
 			v1FileGroup.PUT("/rename", v1.RenamePath)
 			v1FileGroup.GET("/read", v1.GetFilerContent)
 			v1FileGroup.POST("/upload", v1.PostFileUpload)
-			v1FileGroup.GET("/dirpath", v1.DirPath)
+			v1FileGroup.GET("/catalog", v1.DirPath)
 			//创建目录
 			v1FileGroup.POST("/mkdir", v1.MkdirAll)
 			v1FileGroup.POST("/create", v1.PostCreateFile)

+ 2 - 2
route/v1/system.go

@@ -118,10 +118,10 @@ func GetSystemConfigDebug(c *gin.Context) {
 	for _, v := range *list {
 		systemAppStatus += v.Image + ",\n\t"
 	}
-	systemAppStatus += "Sync Key: " + config.SystemConfigInfo.SyncKey + "\n\t"
+
+	systemAppStatus += "Sync Key length: " + strconv.Itoa(len(config.SystemConfigInfo.SyncKey))
 
 	var bugContent string = fmt.Sprintf(`
-	**Desktop (please complete the following information):**
 	 - OS: %s
 	 - CasaOS Version: %s
 	 - Disk Total: %v 

+ 3 - 2
service/zima_info.go

@@ -7,6 +7,7 @@ import (
 	"runtime"
 	"strconv"
 	"strings"
+	"time"
 
 	"github.com/IceWhaleTech/CasaOS/model"
 	"github.com/IceWhaleTech/CasaOS/pkg/config"
@@ -86,10 +87,10 @@ func (c *zima) GetDirPath(path string) []model.Path {
 
 	if strings.Count(path, "/") > 0 {
 		for _, l := range ls {
-			dirs = append(dirs, model.Path{Name: l.Name(), Path: path + "/" + l.Name(), IsDir: l.IsDir()})
+			dirs = append(dirs, model.Path{Name: l.Name(), Path: path + "/" + l.Name(), IsDir: l.IsDir(), Date: l.ModTime()})
 		}
 	} else {
-		dirs = append(dirs, model.Path{Name: "DATA", Path: "/DATA/", IsDir: true})
+		dirs = append(dirs, model.Path{Name: "DATA", Path: "/DATA/", IsDir: true, Date: time.Now()})
 	}
 	return dirs
 }

+ 2 - 4
shell/assist.sh

@@ -10,11 +10,9 @@ version_0_2_3() {
 }
 
 # add in v0.2.5
-readonly CASA_DEPANDS="curl smartmontools"
-version_0_2_5{
+readonly CASA_DEPANDS="curl smartmontools parted fdisk partprobe"
+version_0_2_5() {
   install_depends "$CASA_DEPANDS"
-
-
 }
 
 

+ 2 - 3
types/system.go

@@ -1,6 +1,5 @@
 package types
 
-const CURRENTVERSION = "0.2.5"
-
-const BODY = "<li>Storage Manager</li><li>File synchronization issues</li><li>Fix the app store classification problem</li>"
+const CURRENTVERSION = "0.2.6"
 
+const BODY = "<li>Fix a disk that cannot be formatted under certain circumstances</li>"