Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
antSword
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
HuangJunbo
antSword
Commits
aefac90e
Commit
aefac90e
authored
Nov 05, 2019
by
Medicean
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(Enhance:ShellManager) 新增「自定义数据分割符」配置
parent
df00fef8
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
220 additions
and
45 deletions
+220
-45
CHANGELOG.md
CHANGELOG.md
+11
-0
package.json
package.json
+1
-1
index.js
source/core/asp/index.js
+11
-8
index.js
source/core/aspx/index.js
+11
-8
index.js
source/core/custom/index.js
+11
-3
index.js
source/core/php/index.js
+11
-8
index.js
source/core/php4/index.js
+11
-9
en.js
source/language/en.js
+9
-1
zh.js
source/language/zh.js
+9
-1
zh_hk.js
source/language/zh_hk.js
+9
-1
zh_tw.js
source/language/zh_tw.js
+9
-1
form.js
source/modules/shellmanager/list/form.js
+117
-4
No files found.
CHANGELOG.md
View file @
aefac90e
...
...
@@ -2,6 +2,17 @@
> 有空会补补BUG、添添新功能。
> 同时也欢迎大家的参与!感谢各位朋友的支持! .TAT.
## `v(2.1.8)`
*
新增「自定义数据分割符」配置
> 你可以将任何你喜欢的字符组合定义成数据的「起始符」或「结束符」


## 2019/10/30 `v(2.1.7)`
### 安全更新
...
...
package.json
View file @
aefac90e
{
"name"
:
"antsword"
,
"version"
:
"2.1.7"
,
"version"
:
"2.1.7
.1
"
,
"description"
:
"中国蚁剑是一款跨平台的开源网站管理工具"
,
"main"
:
"app.js"
,
"dependencies"
:
{
...
...
source/core/asp/index.js
View file @
aefac90e
...
...
@@ -62,14 +62,17 @@ class ASP extends Base {
*/
complete
(
data
,
force_default
=
false
)
{
// 分隔符号
let
tag_s
=
Math
.
random
()
.
toString
(
16
)
.
substr
(
2
,
parseInt
(
Math
.
random
()
*
8
+
5
));
// '->|';
let
tag_e
=
Math
.
random
()
.
toString
(
16
)
.
substr
(
2
,
parseInt
(
Math
.
random
()
*
8
+
5
));
// '|<-';
let
tag_s
,
tag_e
;
if
(
this
.
__opts__
[
'otherConf'
].
hasOwnProperty
(
'use-custom-datatag'
)
&&
this
.
__opts__
[
'otherConf'
][
'use-custom-datatag'
]
==
1
&&
this
.
__opts__
[
'otherConf'
][
'custom-datatag-tags'
])
{
tag_s
=
this
.
__opts__
[
'otherConf'
][
'custom-datatag-tags'
];
}
else
{
tag_s
=
Math
.
random
().
toString
(
16
).
substr
(
2
,
parseInt
(
Math
.
random
()
*
8
+
5
));
// "->|";
}
if
(
this
.
__opts__
[
'otherConf'
].
hasOwnProperty
(
'use-custom-datatag'
)
&&
this
.
__opts__
[
'otherConf'
][
'use-custom-datatag'
]
==
1
&&
this
.
__opts__
[
'otherConf'
][
'custom-datatag-tage'
])
{
tag_e
=
this
.
__opts__
[
'otherConf'
][
'custom-datatag-tage'
];
}
else
{
tag_e
=
Math
.
random
().
toString
(
16
).
substr
(
2
,
parseInt
(
Math
.
random
()
*
8
+
5
));
// "|<-";
}
// let formatter = new this.format(this.__opts__['encode']);
let
formatter
=
Base
...
...
source/core/aspx/index.js
View file @
aefac90e
...
...
@@ -64,14 +64,17 @@ class ASPX extends Base {
*/
complete
(
data
,
force_default
=
false
)
{
// 分隔符号
let
tag_s
=
Math
.
random
()
.
toString
(
16
)
.
substr
(
2
,
parseInt
(
Math
.
random
()
*
8
+
5
));
// '->|';
let
tag_e
=
Math
.
random
()
.
toString
(
16
)
.
substr
(
2
,
parseInt
(
Math
.
random
()
*
8
+
5
));
// '|<-';
let
tag_s
,
tag_e
;
if
(
this
.
__opts__
[
'otherConf'
].
hasOwnProperty
(
'use-custom-datatag'
)
&&
this
.
__opts__
[
'otherConf'
][
'use-custom-datatag'
]
==
1
&&
this
.
__opts__
[
'otherConf'
][
'custom-datatag-tags'
])
{
tag_s
=
this
.
__opts__
[
'otherConf'
][
'custom-datatag-tags'
];
}
else
{
tag_s
=
Math
.
random
().
toString
(
16
).
substr
(
2
,
parseInt
(
Math
.
random
()
*
8
+
5
));
// "->|";
}
if
(
this
.
__opts__
[
'otherConf'
].
hasOwnProperty
(
'use-custom-datatag'
)
&&
this
.
__opts__
[
'otherConf'
][
'use-custom-datatag'
]
==
1
&&
this
.
__opts__
[
'otherConf'
][
'custom-datatag-tage'
])
{
tag_e
=
this
.
__opts__
[
'otherConf'
][
'custom-datatag-tage'
];
}
else
{
tag_e
=
Math
.
random
().
toString
(
16
).
substr
(
2
,
parseInt
(
Math
.
random
()
*
8
+
5
));
// "|<-";
}
// let formatter = new this.format(this.__opts__['encode']);
let
formatter
=
Base
...
...
source/core/custom/index.js
View file @
aefac90e
...
...
@@ -55,9 +55,17 @@ class CUSTOM extends Base {
*/
complete
(
data
,
force_default
=
false
)
{
// 分隔符号
let
tag_s
=
'->|'
;
let
tag_e
=
'|<-'
;
let
tag_s
,
tag_e
;
if
(
this
.
__opts__
[
'otherConf'
].
hasOwnProperty
(
'use-custom-datatag'
)
&&
this
.
__opts__
[
'otherConf'
][
'use-custom-datatag'
]
==
1
&&
this
.
__opts__
[
'otherConf'
][
'custom-datatag-tags'
])
{
tag_s
=
this
.
__opts__
[
'otherConf'
][
'custom-datatag-tags'
];
}
else
{
tag_s
=
"->|"
;
}
if
(
this
.
__opts__
[
'otherConf'
].
hasOwnProperty
(
'use-custom-datatag'
)
&&
this
.
__opts__
[
'otherConf'
][
'use-custom-datatag'
]
==
1
&&
this
.
__opts__
[
'otherConf'
][
'custom-datatag-tage'
])
{
tag_e
=
this
.
__opts__
[
'otherConf'
][
'custom-datatag-tage'
];
}
else
{
tag_e
=
"|<-"
;
}
// 使用编码器进行处理并返回
return
this
.
encodeComplete
(
tag_s
,
tag_e
,
data
);
}
...
...
source/core/php/index.js
View file @
aefac90e
...
...
@@ -62,15 +62,18 @@ class PHP extends Base {
*/
complete
(
data
,
force_default
=
false
)
{
// 分隔符号
let
tag_s
,
tag_e
;
if
(
this
.
__opts__
[
'otherConf'
].
hasOwnProperty
(
'use-custom-datatag'
)
&&
this
.
__opts__
[
'otherConf'
][
'use-custom-datatag'
]
==
1
&&
this
.
__opts__
[
'otherConf'
][
'custom-datatag-tags'
])
{
tag_s
=
this
.
__opts__
[
'otherConf'
][
'custom-datatag-tags'
];
}
else
{
tag_s
=
Math
.
random
().
toString
(
16
).
substr
(
2
,
parseInt
(
Math
.
random
()
*
8
+
5
));
// "->|";
}
if
(
this
.
__opts__
[
'otherConf'
].
hasOwnProperty
(
'use-custom-datatag'
)
&&
this
.
__opts__
[
'otherConf'
][
'use-custom-datatag'
]
==
1
&&
this
.
__opts__
[
'otherConf'
][
'custom-datatag-tage'
])
{
tag_e
=
this
.
__opts__
[
'otherConf'
][
'custom-datatag-tage'
];
}
else
{
tag_e
=
Math
.
random
().
toString
(
16
).
substr
(
2
,
parseInt
(
Math
.
random
()
*
8
+
5
));
// "|<-";
}
let
tag_s
=
Math
.
random
()
.
toString
(
16
)
.
substr
(
2
,
parseInt
(
Math
.
random
()
*
8
+
5
));
// "->|";
let
tag_e
=
Math
.
random
()
.
toString
(
16
)
.
substr
(
2
,
parseInt
(
Math
.
random
()
*
8
+
5
));
// "|<-";
let
asencCode
;
if
(
!
force_default
)
{
asencCode
=
this
.
__decoder__
[
this
.
__opts__
[
'decoder'
]
||
'default'
].
asoutput
();
...
...
source/core/php4/index.js
View file @
aefac90e
...
...
@@ -14,15 +14,17 @@ class PHP4 extends PHP {
*/
complete
(
data
,
force_default
=
false
)
{
// 分隔符号
let
tag_s
=
Math
.
random
()
.
toString
(
16
)
.
substr
(
2
,
parseInt
(
Math
.
random
()
*
8
+
5
));
// "->|";
let
tag_e
=
Math
.
random
()
.
toString
(
16
)
.
substr
(
2
,
parseInt
(
Math
.
random
()
*
8
+
5
));
// "|<-";
let
tag_s
,
tag_e
;
if
(
this
.
__opts__
[
'otherConf'
].
hasOwnProperty
(
'use-custom-datatag'
)
&&
this
.
__opts__
[
'otherConf'
][
'use-custom-datatag'
]
==
1
&&
this
.
__opts__
[
'otherConf'
][
'custom-datatag-tags'
])
{
tag_s
=
this
.
__opts__
[
'otherConf'
][
'custom-datatag-tags'
];
}
else
{
tag_s
=
Math
.
random
().
toString
(
16
).
substr
(
2
,
parseInt
(
Math
.
random
()
*
8
+
5
));
// "->|";
}
if
(
this
.
__opts__
[
'otherConf'
].
hasOwnProperty
(
'use-custom-datatag'
)
&&
this
.
__opts__
[
'otherConf'
][
'use-custom-datatag'
]
==
1
&&
this
.
__opts__
[
'otherConf'
][
'custom-datatag-tage'
])
{
tag_e
=
this
.
__opts__
[
'otherConf'
][
'custom-datatag-tage'
];
}
else
{
tag_e
=
Math
.
random
().
toString
(
16
).
substr
(
2
,
parseInt
(
Math
.
random
()
*
8
+
5
));
// "|<-";
}
let
asencCode
;
if
(
!
force_default
)
{
asencCode
=
this
.
__decoder__
[
this
.
__opts__
[
'decoder'
]
||
'default'
].
asoutput
();
...
...
source/language/en.js
View file @
aefac90e
...
...
@@ -191,7 +191,15 @@ module.exports = {
filemanagerCache
:
"Use the filemanager's cache"
,
uploadFragment
:
"Upload File Fragmentation Size"
,
requestTimeout
:
'Request timeout'
,
commandPath
:
'Custom terminal-execPath'
commandPath
:
'Custom terminal-execPath'
,
customDatatag
:
{
title
:
'Data separator'
,
usecustomdatatag
:
'Use custom data separator'
,
tags
:
'Start tag'
,
tage
:
'End tag'
,
exphint
:
'The data separator should be the same as other unrelated characters on the page'
,
valideq
:
'Start tag and End tag cannot be the same'
},
}
},
toolbar
:
{
...
...
source/language/zh.js
View file @
aefac90e
...
...
@@ -191,7 +191,15 @@ module.exports = {
filemanagerCache
:
'文件管理使用缓存'
,
uploadFragment
:
'上传文件分片大小'
,
requestTimeout
:
'请求超时'
,
commandPath
:
'自定义终端执行路径'
commandPath
:
'自定义终端执行路径'
,
customDatatag
:
{
title
:
'数据分割符'
,
usecustomdatatag
:
'开启自定义数据分割符'
,
tags
:
'开始标记'
,
tage
:
'结束标记'
,
exphint
:
'数据分割符请避免和页面中其它不相关的字符相同'
,
valideq
:
'开始标记与结束标记不能相同'
},
}
},
toolbar
:
{
...
...
source/language/zh_hk.js
View file @
aefac90e
...
...
@@ -190,7 +190,15 @@ module.exports = {
filemanagerCache
:
'文件管理使用緩存'
,
uploadFragment
:
'上傳文件分片大小'
,
requestTimeout
:
'請求超時'
,
commandPath
:
'自定義終端執行路徑'
commandPath
:
'自定義終端執行路徑'
,
customDatatag
:
{
title
:
'數據分割符'
,
usecustomdatatag
:
'開啟自定義數據分割符'
,
tags
:
'開始標記'
,
tage
:
'結束標記'
,
exphint
:
'數據分割符請避免和頁面中其它不相關的字符相同'
,
valideq
:
'開始標記與結束標記不能相同'
},
}
},
toolbar
:
{
...
...
source/language/zh_tw.js
View file @
aefac90e
...
...
@@ -190,7 +190,15 @@ module.exports = {
filemanagerCache
:
'文件管理使用緩存'
,
uploadFragment
:
'上傳文件分片大小'
,
requestTimeout
:
'請求超時'
,
commandPath
:
'自定義終端執行路徑'
commandPath
:
'自定義終端執行路徑'
,
customDatatag
:
{
title
:
'數據分割符'
,
usecustomdatatag
:
'開啟自定義數據分割符'
,
tags
:
'開始標記'
,
tage
:
'結束標記'
,
exphint
:
'數據分割符請避免和頁面中其它不相關的字符相同'
,
valideq
:
'開始標記與結束標記不能相同'
},
}
},
toolbar
:
{
...
...
source/modules/shellmanager/list/form.js
View file @
aefac90e
...
...
@@ -50,6 +50,11 @@ class Form {
"httpConf"
:
opts
.
http
,
"otherConf"
:
opts
.
other
}
if
(
opt
[
'otherConf'
][
'use-custom-datatag'
]
===
1
)
{
if
(
opt
[
'otherConf'
][
'custom-datatag-tags'
]
===
opt
[
'otherConf'
][
'custom-datatag-tage'
])
{
return
toastr
.
warning
(
LANG
[
'list'
][
'otherConf'
][
'customDatatag'
][
'valideq'
],
LANG_T
[
'warning'
]);
}
}
win
.
progressOn
();
let
core
=
new
antSword
[
"core"
][
opt
[
'type'
]](
opt
);
core
...
...
@@ -72,11 +77,27 @@ class Form {
if
(
!
this
.
baseForm
.
validate
()
||
!
this
.
httpForm
.
validate
()
||
!
this
.
otherForm
.
validate
())
{
return
toastr
.
warning
(
LANG
[
'list'
][
'add'
][
'warning'
],
LANG_T
[
'warning'
]);
};
let
_opts
=
this
.
_parseFormData
(
this
.
baseForm
.
getValues
(),
this
.
httpForm
.
getValues
(),
this
.
otherForm
.
getValues
());
let
_opt
=
{
"url"
:
_opts
.
base
[
'url'
],
"pwd"
:
_opts
.
base
[
'pwd'
],
"type"
:
_opts
.
base
[
'type'
],
"encode"
:
_opts
.
base
[
'encode'
],
"encoder"
:
_opts
.
base
[
'encoder'
],
"decoder"
:
_opts
.
base
[
'decoder'
],
"httpConf"
:
_opts
.
http
,
"otherConf"
:
_opts
.
other
}
if
(
_opt
[
'otherConf'
][
'use-custom-datatag'
]
===
1
)
{
if
(
_opt
[
'otherConf'
][
'custom-datatag-tags'
]
===
_opt
[
'otherConf'
][
'custom-datatag-tage'
])
{
return
toastr
.
warning
(
LANG
[
'list'
][
'otherConf'
][
'customDatatag'
][
'valideq'
],
LANG_T
[
'warning'
]);
}
}
// 回调数据
if
(
callback
)
{
win
.
progressOn
();
setTimeout
(()
=>
{
callback
(
this
.
_parseFormData
(
this
.
baseForm
.
getValues
(),
this
.
httpForm
.
getValues
(),
this
.
otherForm
.
getValues
())
).
then
((
msg
)
=>
{
callback
(
_opts
).
then
((
msg
)
=>
{
// 添加/保存完毕后回调
win
.
close
();
toastr
.
success
(
msg
,
LANG_T
[
'success'
]);
...
...
@@ -453,7 +474,10 @@ class Form {
'filemanager-cache'
:
1
,
'upload-fragment'
:
'500'
,
'request-timeout'
:
'10000'
,
'command-path'
:
''
'command-path'
:
''
,
'use-custom-datatag'
:
0
,
'custom-datatag-tags'
:
''
,
'custom-datatag-tage'
:
''
},
arg
.
otherConf
);
const
form
=
this
.
accordion
...
...
@@ -471,12 +495,12 @@ class Form {
name
:
'ignore-https'
,
label
:
LANG
[
'list'
][
'otherConf'
][
'nohttps'
],
checked
:
opt
[
'ignore-https'
]
===
1
},{
},
{
type
:
"checkbox"
,
name
:
'use-random-variable'
,
label
:
LANG
[
'list'
][
'otherConf'
][
'userandomvariable'
],
checked
:
opt
[
'use-random-variable'
]
===
1
},{
},
{
type
:
"checkbox"
,
name
:
'use-multipart'
,
label
:
LANG
[
'list'
][
'otherConf'
][
'usemultipart'
],
...
...
@@ -653,6 +677,87 @@ class Form {
});
return
ret
;
})([
'/bin/sh'
,
'cmd'
])
},
{
type
:
'fieldset'
,
offsetLeft
:
0
,
label
:
LANG
[
'list'
][
'otherConf'
][
'customDatatag'
][
'title'
],
list
:
[{
type
:
'block'
,
offsetLeft
:
0
,
list
:
[{
type
:
"checkbox"
,
name
:
'use-custom-datatag'
,
label
:
LANG
[
'list'
][
'otherConf'
][
'customDatatag'
][
'usecustomdatatag'
],
checked
:
opt
[
'use-custom-datatag'
]
===
1
}]
},
{
type
:
'block'
,
offsetLeft
:
0
,
list
:
[{
type
:
'label'
,
label
:
LANG
[
'list'
][
'otherConf'
][
'customDatatag'
][
'tags'
]
},
{
type
:
'newcolumn'
},
{
type
:
'combo'
,
label
:
''
,
validate
:
''
,
inputWidth
:
80
,
name
:
"custom-datatag-tags"
,
options
:
((
items
)
=>
{
let
ret
=
[];
// 如果自定义的路径不在items里,则++
if
(
items
.
indexOf
(
opt
[
'custom-datatag-tags'
])
===
-
1
)
{
items
.
unshift
(
opt
[
'custom-datatag-tags'
]);
}
items
.
map
((
_
)
=>
{
ret
.
push
({
text
:
_
,
value
:
_
,
selected
:
opt
[
'custom-datatag-tags'
]
===
_
})
});
return
ret
;
})([
'->|'
,
'~~>|'
,
'__}|'
])
},
{
type
:
'newcolumn'
},
{
type
:
'label'
,
label
:
LANG
[
'list'
][
'otherConf'
][
'customDatatag'
][
'tage'
],
offsetLeft
:
30
},
{
type
:
'newcolumn'
},
{
type
:
'combo'
,
label
:
''
,
validate
:
''
,
inputWidth
:
80
,
name
:
"custom-datatag-tage"
,
options
:
((
items
)
=>
{
let
ret
=
[];
// 如果自定义的路径不在items里,则++
if
(
items
.
indexOf
(
opt
[
'custom-datatag-tage'
])
===
-
1
)
{
items
.
unshift
(
opt
[
'custom-datatag-tage'
]);
}
items
.
map
((
_
)
=>
{
ret
.
push
({
text
:
_
,
value
:
_
,
selected
:
opt
[
'custom-datatag-tage'
]
===
_
})
});
return
ret
;
})([
'|<-'
,
'|<~~'
,
'|{~~'
])
}]
}]
}]
}],
true
);
form
.
attachEvent
(
'onChange'
,
(
name
,
value
,
state
)
=>
{
...
...
@@ -673,6 +778,14 @@ class Form {
});
}
break
;
case
'use-custom-datatag'
:
if
(
state
==
true
&&
form
.
isItemChecked
(
'use-custom-datatag'
))
{
layer
.
open
({
title
:
LANG_T
[
'info'
],
content
:
LANG
[
'list'
][
'otherConf'
][
'customDatatag'
][
'exphint'
]
})
}
break
;
default
:
break
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment