提交 541534d4 编写于 作者: aaronchen2k2k's avatar aaronchen2k2k

fix issues

上级 9a0e2f44
Version = 3.0
Version = 3
Language = zh
......@@ -95,10 +95,6 @@ func main() {
flagSet.BoolVar(&decode, "D", false, "")
flagSet.BoolVar(&decode, "decode", false, "")
flagSet.StringVar(&vari.Ip, "b", "", "")
flagSet.StringVar(&vari.Ip, "bind", "", "")
flagSet.IntVar(&vari.Port, "p", 0, "")
flagSet.IntVar(&vari.Port, "port", 0, "")
flagSet.StringVar(&root, "R", "", "")
flagSet.StringVar(&root, "root", "", "")
......
......@@ -41,10 +41,10 @@ func main() {
flagSet = flag.NewFlagSet("zd", flag.ContinueOnError)
flag.StringVar(&uuid, "uuid", "", "区分服务进程的唯一ID")
flagSet.StringVar(&uuid, "uuid", "", "区分服务进程的唯一ID")
flagSet.StringVar(&vari.Ip, "b", "", "")
flagSet.StringVar(&vari.Ip, "bind", "", "")
flagSet.StringVar(&vari.Ip, "i", "", "")
flagSet.StringVar(&vari.Ip, "ip", "", "")
flagSet.IntVar(&vari.Port, "p", 0, "")
flagSet.IntVar(&vari.Port, "port", 0, "")
flagSet.BoolVar(&vari.Verbose, "verbose", false, "")
......
......@@ -78,11 +78,13 @@ func ParseDesc(desc string) (items []string) {
return
}
/**
convert range item to entity, step, repeat
[user1,user2]{2} -> entry =>[user1,user2]
step =>1
repeat =>2
/*
*
convert range item to entity, step, repeat
[user1,user2]{2} -> entry =>[user1,user2]
step =>1
repeat =>2
*/
func ParseRangeSection(rang string) (entry string, step string, repeat int, repeatTag string) {
rang = strings.TrimSpace(rang)
......@@ -127,12 +129,14 @@ func ParseRangeSection(rang string) (entry string, step string, repeat int, repe
return entry, step, repeat, repeatTag
}
/**
get range item entity's type and desc
1-9 or [1-9] -> type => interval
desc => 1-9 or [1-9]
[user1,user2] -> type => literal
desc => user2,user3
/*
*
get range item entity's type and desc
1-9 or [1-9] -> type => interval
desc => 1-9 or [1-9]
[user1,user2] -> type => literal
desc => user2,user3
*/
func ParseRangeSectionDesc(str string) (typ string, desc string) {
desc = strings.TrimSpace(str)
......@@ -200,7 +204,7 @@ func removeBoundary(str string) string {
func isScopeStr(str string) bool {
arr := strings.Split(str, "-")
if len(arr) < 2 {
if len(arr) < 2 || strings.TrimSpace(str) == "-" {
return false
}
......
......@@ -7,7 +7,7 @@ const (
CheckUpgradeInterval = 30
AgentRunTime = 30 * 60
AgentLogDir = "log-zd"
AgentLogDir = "log"
QiNiuURL = "https://dl.cnezsoft.com/" + constant.AppName + "/"
AgentVersionURL = QiNiuURL + "version.txt"
......
......@@ -51,7 +51,7 @@ func PrintUsage() {
regx, _ = regexp.Compile(`zd.exe`)
usage = regx.ReplaceAllString(usage, "zd")
regx, _ = regexp.Compile(`d:\zd\config `)
regx, _ = regexp.Compile(`d:\\zd\\config `)
usage = regx.ReplaceAllString(usage, "/home/user/zd/config")
}
fmt.Printf("%s\n", usage)
......
......@@ -136,10 +136,14 @@ export default {
},
computed: {
hasSelected: function() {
if (!this.defs) return false
return this.defs.some(x => x.id == this.selected);
},
selectedRecord: function() {
return this.defs.find(x => x.id == this.selected);
if (!this.defs) return null
return this.defs?.find(x => x.id == this.selected);
}
},
created () {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册