浏览代码

Merge pull request #3 from IceWhaleTech/v0.2.1

Optimize installation process
link 3 年之前
父节点
当前提交
c5d824c4ba
共有 4 个文件被更改,包括 8 次插入11 次删除
  1. 1 1
      UI
  2. 4 2
      service/docker.go
  3. 2 7
      service/zima_info.go
  4. 1 1
      types/system.go

+ 1 - 1
UI

@@ -1 +1 @@
-Subproject commit 0a78d55a82dbeb10e617189358f8747629045377
+Subproject commit 645e6cac7dcc188d310b7fa7add3d03688021d23

+ 4 - 2
service/docker.go

@@ -7,6 +7,7 @@ import (
 	"encoding/binary"
 	json2 "encoding/json"
 	"fmt"
+	"regexp"
 	"syscall"
 
 	model2 "github.com/IceWhaleTech/CasaOS/service/model"
@@ -417,9 +418,10 @@ func (ds *dockerService) DockerContainerCreate(imageName string, containerDbId s
 			if len(path) == 0 {
 				continue
 			}
-
 		}
-		if strings.HasSuffix(path, "/") {
+		reg1 := regexp.MustCompile(`([^<>/\\\|:""\*\?]+\.\w+$)`)
+		result1 := reg1.FindAllStringSubmatch(path, -1)
+		if len(result1) == 0 {
 			err = file.IsNotExistMkDir(path)
 			if err != nil {
 				ds.log.Error("mkdir error", err)

+ 2 - 7
service/zima_info.go

@@ -84,14 +84,9 @@ func (c *zima) GetDirPath(path string) []model.Path {
 	ls, _ := ioutil.ReadDir(path)
 	dirs := []model.Path{}
 
-	if strings.Count(path, "/") > 1 {
+	if strings.Count(path, "/") > 0 {
 		for _, l := range ls {
-			pathTemp := path + l.Name()
-			if l.IsDir() {
-				pathTemp += "/"
-			}
-
-			dirs = append(dirs, model.Path{Name: l.Name(), Path: pathTemp, IsDir: l.IsDir()})
+			dirs = append(dirs, model.Path{Name: l.Name(), Path: path + "/" + l.Name(), IsDir: l.IsDir()})
 		}
 	} else {
 		dirs = append(dirs, model.Path{Name: "DATA", Path: "/DATA/", IsDir: true})

+ 1 - 1
types/system.go

@@ -1,4 +1,4 @@
 package types
 
 const CURRENTVERSION = "0.1.6"
-const BODY = "<li>Add a file selector for app install.</li> <li>Fixed an issue with the app were it would disappear when the app was modified.</li>"
+const BODY = "<li>Modify import reminder.</li><li>Add app icon auto-fill via docker image name.</li><li>Add a file selector for app install.</li> <li>Fixed an issue with the app were it would disappear when the app was modified.</li>"