Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
易企天创
zendata
提交
371b6d26
Z
zendata
项目概览
易企天创
/
zendata
9 个月 前同步成功
通知
17
Star
2
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Z
zendata
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
371b6d26
编写于
3月 10, 2021
作者:
陈
陈琦
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
close task#36575 服务模式下支持-T参数
#2
上级
565e60f1
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
18 addition
and
7 deletion
+18
-7
demo/01_range.yaml
demo/01_range.yaml
+2
-0
src/server/utils/gen.go
src/server/utils/gen.go
+12
-4
src/zd.go
src/zd.go
+1
-1
ui/src/views/data/mine/Edit.vue
ui/src/views/data/mine/Edit.vue
+1
-0
yaml/domain/domain.v1.yaml
yaml/domain/domain.v1.yaml
+2
-2
未找到文件。
demo/01_range.yaml
浏览文件 @
371b6d26
...
...
@@ -4,3 +4,5 @@ version: 1.0
fields
:
-
field
:
first
# 字段名
range
:
1-5,
30
# 1,2,3,4,5,30,1,2,3,4,5
prefix
:
"
=="
postfix
:
"
--"
\ No newline at end of file
src/server/utils/gen.go
浏览文件 @
371b6d26
...
...
@@ -6,14 +6,16 @@ import (
"github.com/easysoft/zendata/src/utils/vari"
"net/http"
"strconv"
"strings"
)
func
ParseGenParams
(
req
*
http
.
Request
)
(
defaultFile
,
configFile
,
fields
string
,
count
int
,
format
,
table
string
,
decode
bool
,
input
,
output
string
)
{
format
string
,
trim
bool
,
table
string
,
decode
bool
,
input
,
output
string
)
{
query
:=
req
.
URL
.
Query
()
defaultFile
=
ParserGetParams
(
query
,
"default"
,
"d"
)
configFile
=
ParserGetParams
(
query
,
"config"
,
"c"
)
trimStr
:=
ParserGetParams
(
query
,
"trim"
,
"T"
)
countStr
:=
ParserGetParams
(
query
,
"lines"
,
"n"
)
if
countStr
==
""
{
countStr
=
"10"
...
...
@@ -27,9 +29,10 @@ func ParseGenParams(req *http.Request) (defaultFile, configFile, fields string,
if
req
.
Method
==
http
.
MethodPost
{
req
.
ParseForm
()
countStr
=
ParserPostParams
(
req
,
"lines"
,
"n"
,
countStr
,
false
)
defaultDefContent
:=
ParserPostParams
(
req
,
"default"
,
"d"
,
""
,
true
)
configDefContent
:=
ParserPostParams
(
req
,
"config"
,
"c"
,
""
,
true
)
trimStr
=
ParserPostParams
(
req
,
"trim"
,
"T"
,
trimStr
,
false
)
countStr
=
ParserPostParams
(
req
,
"lines"
,
"n"
,
countStr
,
false
)
if
defaultDefContent
!=
""
{
defaultFile
=
vari
.
ZdPath
+
"tmp"
+
constant
.
PthSep
+
".default.yaml"
...
...
@@ -41,9 +44,14 @@ func ParseGenParams(req *http.Request) (defaultFile, configFile, fields string,
}
}
countFromPForm
,
err
:=
strconv
.
Atoi
(
countStr
)
trimStr
=
strings
.
ToLower
(
strings
.
TrimSpace
(
trimStr
))
if
trimStr
==
"t"
||
trimStr
==
"true"
{
trim
=
true
}
countFromForm
,
err
:=
strconv
.
Atoi
(
countStr
)
if
err
==
nil
{
count
=
countFrom
P
Form
count
=
countFromForm
}
return
...
...
src/zd.go
浏览文件 @
371b6d26
...
...
@@ -263,7 +263,7 @@ func DataHandler(writer http.ResponseWriter, req *http.Request) {
logUtils
.
HttpWriter
=
writer
defaultFile
,
configFile
,
fields
,
vari
.
Total
,
format
,
table
,
decode
,
input
,
output
=
serverUtils
.
ParseGenParams
(
req
)
format
,
vari
.
Trim
,
table
,
decode
,
input
,
output
=
serverUtils
.
ParseGenParams
(
req
)
if
decode
{
gen
.
Decode
(
defaultFile
,
configFile
,
fields
,
input
,
output
)
...
...
ui/src/views/data/mine/Edit.vue
浏览文件 @
371b6d26
...
...
@@ -75,6 +75,7 @@ export default {
},
watch
:
{
id
:
function
()
{
console
.
log
(
'
watch id
'
+
this
.
id
)
this
.
loadData
();
}
},
...
...
yaml/domain/domain.v1.yaml
浏览文件 @
371b6d26
...
...
@@ -127,7 +127,7 @@ instances:
note
:
字母和数字混合的域名
fields
:
-
field
:
numbers_and_letters
range
:
"
[a-z,0-9]
:R
"
range
:
"
[a-z,0-9]"
loop
:
5-8
postfix
:
"
."
-
field
:
domain_postfix
...
...
@@ -173,4 +173,4 @@ instances:
postfix
:
"
."
-
field
:
domain_postfix
from
:
domain.postfix.v1.yaml
use
:
new
\ No newline at end of file
use
:
cn
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录