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
befc6cd6
Commit
befc6cd6
authored
Mar 26, 2016
by
antoor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加 jsp shell 样本文件,修正 custom 模式数据库部分逻辑
parent
dcf037fe
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
384 additions
and
18 deletions
+384
-18
CHANGELOG.md
CHANGELOG.md
+3
-0
README.md
README.md
+1
-1
custom.jsp
shells/custom.jsp
+357
-0
default.jsx
source/core/custom/template/database/default.jsx
+10
-6
index.jsx
source/modules/database/custom/index.jsx
+13
-11
No files found.
CHANGELOG.md
View file @
befc6cd6
...
@@ -6,6 +6,9 @@
...
@@ -6,6 +6,9 @@
### /26
### /26
1.
文件管理双击:size < 100kb ? 编辑 : 下载
1.
文件管理双击:size < 100kb ? 编辑 : 下载
2.
调整 Custom 方式数据库部分代码
3.
添加 Shells 目录, 用于存放 shell 样本代码
4.
添加
`custom.jsp`
服务端样本代码
### /24
### /24
1.
文件管理双击文件进行编辑 //size < 100kb
1.
文件管理双击文件进行编辑 //size < 100kb
...
...
README.md
View file @
befc6cd6
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
**任何人不得将其用于非法用途以及盈利等目的,也禁止未经允许私自修改打包进行发布,否则后果自行承担并将追究其相关责任!**
**任何人不得将其用于非法用途以及盈利等目的,也禁止未经允许私自修改打包进行发布,否则后果自行承担并将追究其相关责任!**
[

](https://nodejs.org/en/download/)
[

](https://nodejs.org/en/download/)
[

](https://github.com/antoor/antSword/releases/tag/1.0
.0)
[

](https://github.com/antoor/antSword/releases/tag/1.1
.0)
## 设计思想
## 设计思想
> 中国蚁剑采用了[Electron](http://electron.atom.io/)作为外壳,`ES6`作为前端代码编写语言,搭配`Babel`&&`Webpack`进行组件化构建编译,外加`iconv-lite`编码解码模块以及`superagent`数据发送处理模块还有`nedb`数据存储模块,组成了这个年轻而又充满活力的新一代大杀器。
> 中国蚁剑采用了[Electron](http://electron.atom.io/)作为外壳,`ES6`作为前端代码编写语言,搭配`Babel`&&`Webpack`进行组件化构建编译,外加`iconv-lite`编码解码模块以及`superagent`数据发送处理模块还有`nedb`数据存储模块,组成了这个年轻而又充满活力的新一代大杀器。
...
...
shells/custom.jsp
0 → 100644
View file @
befc6cd6
This diff is collapsed.
Click to expand it.
source/core/custom/template/database/default.jsx
View file @
befc6cd6
//
//
// 默认代码模板
// 默认代码模板
//
//
// @params
// @params
// :encode SHELL编码
// :encode SHELL编码
// :conn 数据库连接字符串
// :conn 数据库连接字符串
// :sql 执行SQL语句
// :sql 执行SQL语句
//
// :db 数据库名
// :table 表名
module
.
exports
=
{
module
.
exports
=
{
show_databases
:
{
show_databases
:
{
...
@@ -16,12 +17,15 @@ module.exports = {
...
@@ -16,12 +17,15 @@ module.exports = {
show_tables
:
{
show_tables
:
{
_
:
'O'
,
_
:
'O'
,
'z0'
:
'#{encode}'
,
'z0'
:
'#{encode}'
,
'z1'
:
'#{conn}'
'z1'
:
'#{conn}'
,
'z2'
:
'#{db}'
},
},
show_columns
:
{
show_columns
:
{
_
:
'P'
,
_
:
'P'
,
'z0'
:
'#{encode}'
,
'z0'
:
'#{encode}'
,
'z1'
:
'#{conn}'
'z1'
:
'#{conn}'
,
'z2'
:
'#{db}'
,
'z3'
:
'#{table}'
},
},
query
:
{
query
:
{
_
:
'Q'
,
_
:
'Q'
,
...
@@ -29,4 +33,4 @@ module.exports = {
...
@@ -29,4 +33,4 @@ module.exports = {
'z1'
:
'#{conn}'
,
'z1'
:
'#{conn}'
,
'z2'
:
'#{sql}'
'z2'
:
'#{sql}'
}
}
}
}
\ No newline at end of file
source/modules/database/custom/index.jsx
View file @
befc6cd6
//
//
// 数据库驱动::ASP
// 数据库驱动::ASP
// 支持数据库:access,sqlserver,mysql
// 支持数据库:access,sqlserver,mysql
//
//
class
ASP
{
class
ASP
{
...
@@ -9,9 +9,9 @@ class ASP {
...
@@ -9,9 +9,9 @@ class ASP {
this
.
opt
=
opt
;
this
.
opt
=
opt
;
this
.
core
=
this
.
opt
.
core
;
this
.
core
=
this
.
opt
.
core
;
this
.
manager
=
this
.
opt
.
super
;
this
.
manager
=
this
.
opt
.
super
;
//
//
// * 数据库驱动列表
// * 数据库驱动列表
//
//
this
.
conns
=
{
this
.
conns
=
{
'mysql'
:
'com.mysql.jdbc.Driver
\
r
\
njdbc:mysql://localhost/test?user=root&password=123456'
,
'mysql'
:
'com.mysql.jdbc.Driver
\
r
\
njdbc:mysql://localhost/test?user=root&password=123456'
,
'sqlserver'
:
'com.microsoft.sqlserver.jdbc.SQLServerDriver
\
r
\
njdbc:sqlserver://127.0.0.1:1433;databaseName=test;user=sa;password=123456'
,
'sqlserver'
:
'com.microsoft.sqlserver.jdbc.SQLServerDriver
\
r
\
njdbc:sqlserver://127.0.0.1:1433;databaseName=test;user=sa;password=123456'
,
...
@@ -71,10 +71,11 @@ class ASP {
...
@@ -71,10 +71,11 @@ class ASP {
// 生成查询SQL语句
// 生成查询SQL语句
case
'column'
:
case
'column'
:
let
_co
=
arr
[
1
].
split
(
':'
);
let
_co
=
arr
[
1
].
split
(
':'
);
const
db
=
new
Buffer
(
_co
[
1
],
'base64'
).
toString
();
const
table
=
new
Buffer
(
_co
[
2
],
'base64'
).
toString
();
const
table
=
new
Buffer
(
_co
[
2
],
'base64'
).
toString
();
const
column
=
new
Buffer
(
_co
[
3
],
'base64'
).
toString
();
const
column
=
new
Buffer
(
_co
[
3
],
'base64'
).
toString
();
const
sql
=
`SELECT
TOP 20 [
${
column
}
] FROM [
${
table
}
]
ORDER BY 1 DESC;`
;
const
sql
=
`SELECT
${
column
}
FROM
${
db
}
.
${
table
}
ORDER BY 1 DESC;`
;
this
.
manager
.
query
.
editor
.
session
.
setValue
(
sql
);
this
.
manager
.
query
.
editor
.
session
.
setValue
(
sql
);
break
;
break
;
}
}
...
@@ -253,7 +254,7 @@ class ASP {
...
@@ -253,7 +254,7 @@ class ASP {
{
{
conn
:
conf
[
'conn'
],
conn
:
conf
[
'conn'
],
encode
:
this
.
manager
.
opt
.
encode
,
encode
:
this
.
manager
.
opt
.
encode
,
db
name
:
[
'access'
,
'microsoft_jet_oledb_4_0'
].
indexOf
(
conf
[
'type'
])
>
-
1
?
conf
[
'conn'
].
match
(
/
[\w]
+.mdb$/
)
:
'database'
db
:
[
'access'
,
'microsoft_jet_oledb_4_0'
].
indexOf
(
conf
[
'type'
])
>
-
1
?
conf
[
'conn'
].
match
(
/
[\w]
+.mdb$/
)
:
'database'
},
(
ret
)
=>
{
},
(
ret
)
=>
{
const
arr
=
ret
.
split
(
'
\
t'
);
const
arr
=
ret
.
split
(
'
\
t'
);
if
(
arr
.
length
===
1
&&
ret
===
''
)
{
if
(
arr
.
length
===
1
&&
ret
===
''
)
{
...
@@ -293,7 +294,7 @@ class ASP {
...
@@ -293,7 +294,7 @@ class ASP {
{
{
conn
:
conf
[
'conn'
],
conn
:
conf
[
'conn'
],
encode
:
this
.
manager
.
opt
.
encode
,
encode
:
this
.
manager
.
opt
.
encode
,
db
name
:
db
db
:
db
},
(
ret
)
=>
{
},
(
ret
)
=>
{
const
arr
=
ret
.
split
(
'
\
t'
);
const
arr
=
ret
.
split
(
'
\
t'
);
const
_db
=
new
Buffer
(
db
).
toString
(
'base64'
);
const
_db
=
new
Buffer
(
db
).
toString
(
'base64'
);
...
@@ -329,7 +330,8 @@ class ASP {
...
@@ -329,7 +330,8 @@ class ASP {
{
{
conn
:
conf
[
'conn'
],
conn
:
conf
[
'conn'
],
encode
:
this
.
manager
.
opt
.
encode
,
encode
:
this
.
manager
.
opt
.
encode
,
table
:
conf
[
'type'
]
===
'oracle'
?
`SELECT * FROM (SELECT A.*,ROWNUM N FROM
${
table
}
A) WHERE N=1`
:
`SELECT TOP 1 * FROM
${
table
}
`
db
:
db
,
table
:
table
},
(
ret
)
=>
{
},
(
ret
)
=>
{
const
arr
=
ret
.
split
(
'
\
t'
);
const
arr
=
ret
.
split
(
'
\
t'
);
const
_db
=
new
Buffer
(
db
).
toString
(
'base64'
);
const
_db
=
new
Buffer
(
db
).
toString
(
'base64'
);
...
@@ -352,8 +354,8 @@ class ASP {
...
@@ -352,8 +354,8 @@ class ASP {
// 更新编辑器SQL语句
// 更新编辑器SQL语句
this
.
manager
.
query
.
editor
.
session
.
setValue
(
this
.
manager
.
query
.
editor
.
session
.
setValue
(
conf
[
'type'
]
===
'oracle'
conf
[
'type'
]
===
'oracle'
?
`SELECT * FROM (SELECT A.*,ROWNUM N FROM
${
table
}
A ORDER BY 1 DESC) WHERE N>0 AND N<=20`
?
`SELECT * FROM (SELECT A.*,ROWNUM N FROM
${
db
}
.
${
table
}
A ORDER BY 1 DESC) WHERE N>0 AND N<=20`
:
`SELECT
TOP 20 * FROM
${
table
}
ORDER BY 1 DESC
;`
);
:
`SELECT
* FROM
${
db
}
.
${
table
}
ORDER BY 1 DESC LIMIT 0,20
;`
);
this
.
manager
.
list
.
layout
.
progressOff
();
this
.
manager
.
list
.
layout
.
progressOff
();
});
});
}
}
...
@@ -454,4 +456,4 @@ class ASP {
...
@@ -454,4 +456,4 @@ class ASP {
}
}
module
.
exports
=
ASP
;
module
.
exports
=
ASP
;
\ No newline at end of file
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