Compare commits

..

1 Commits

Author SHA1 Message Date
link
53157fbb1f Merge pull request #1 from IceWhaleTech/v0.2.1
add widget
2021-10-14 22:45:31 -05:00
6 changed files with 14 additions and 19 deletions

1
.gitignore vendored
View File

@@ -30,4 +30,3 @@ gen
/db/ /db/
/docs/ /docs/
/conf/conf.ini /conf/conf.ini
__debug_bin

2
UI

Submodule UI updated: 0a78d55a82...f2a5429db5

BIN
__debug_bin Executable file

Binary file not shown.

View File

@@ -10,9 +10,7 @@ const (
PWD_INVALID = 10001 PWD_INVALID = 10001
//system //system
DIR_ALREADY_EXISTS = 20001 DIR_ALREADY_EXISTS = 20001
FILE_ALREADY_EXISTS = 20002
FILE_OR_DIR_EXISTS = 20003
//zerotier //zerotier
GET_TOKEN_ERROR = 30001 GET_TOKEN_ERROR = 30001
@@ -40,9 +38,8 @@ var MsgFlags = map[int]string{
PWD_INVALID: "Password invalid", PWD_INVALID: "Password invalid",
//system //system
DIR_ALREADY_EXISTS: "Directory already exists", DIR_ALREADY_EXISTS: "Directory already exists",
FILE_ALREADY_EXISTS: "File already exists",
FILE_OR_DIR_EXISTS: "File or directory already exists",
//zerotier //zerotier
GET_TOKEN_ERROR: "Get token error,Please log in to zerotier's official website to confirm whether the account is available", GET_TOKEN_ERROR: "Get token error,Please log in to zerotier's official website to confirm whether the account is available",

View File

@@ -86,12 +86,7 @@ func (c *zima) GetDirPath(path string) []model.Path {
if strings.Count(path, "/") > 1 { if strings.Count(path, "/") > 1 {
for _, l := range ls { for _, l := range ls {
pathTemp := path + l.Name() dirs = append(dirs, model.Path{Name: l.Name(), Path: path + l.Name() + "/", IsDir: l.IsDir()})
if l.IsDir() {
pathTemp += "/"
}
dirs = append(dirs, model.Path{Name: l.Name(), Path: pathTemp, IsDir: l.IsDir()})
} }
} else { } else {
dirs = append(dirs, model.Path{Name: "DATA", Path: "/DATA/", IsDir: true}) dirs = append(dirs, model.Path{Name: "DATA", Path: "/DATA/", IsDir: true})
@@ -136,8 +131,6 @@ func (c *zima) MkdirAll(path string) (int, error) {
if os.IsNotExist(err) { if os.IsNotExist(err) {
os.MkdirAll(path, os.ModePerm) os.MkdirAll(path, os.ModePerm)
return oasis_err.SUCCESS, nil return oasis_err.SUCCESS, nil
} else if strings.Contains(err.Error(), ": not a directory") {
return oasis_err.FILE_OR_DIR_EXISTS, err
} }
} }
return oasis_err.ERROR, err return oasis_err.ERROR, err
@@ -147,7 +140,7 @@ func (c *zima) MkdirAll(path string) (int, error) {
func (c *zima) CreateFile(path string) (int, error) { func (c *zima) CreateFile(path string) (int, error) {
_, err := os.Stat(path) _, err := os.Stat(path)
if err == nil { if err == nil {
return oasis_err.FILE_OR_DIR_EXISTS, nil return oasis_err.DIR_ALREADY_EXISTS, nil
} else { } else {
if os.IsNotExist(err) { if os.IsNotExist(err) {
file.CreateFile(path) file.CreateFile(path)

View File

@@ -1,4 +1,10 @@
package types package types
const CURRENTVERSION = "0.1.6" const CURRENTVERSION = "0.1.5"
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>Add CPU RAM Status with widget</li>
<li>Add Disk Info with widget</li>
<li>Enhance the Docker cli import experience and automatically fill in the folders that need to be mounted</li>
<li>Realize automatic loading of widgets</li>
<li>Fix display bugs when windows size less than 1024px</li>
`