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
a5640c98
Commit
a5640c98
authored
Mar 06, 2019
by
Medicean
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(UE: Database) 优化检测和测试连接异常时提示
parent
74a67740
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
31 additions
and
5 deletions
+31
-5
index.js
source/core/php/index.js
+1
-1
en.js
source/language/en.js
+1
-0
zh.js
source/language/zh.js
+1
-0
index.js
source/modules/database/asp/index.js
+6
-0
index.js
source/modules/database/custom/index.js
+6
-0
index.js
source/modules/database/index.js
+6
-0
index.js
source/modules/database/php/index.js
+10
-4
No files found.
source/core/php/index.js
View file @
a5640c98
...
...
@@ -52,7 +52,7 @@ class PHP extends Base {
// 组合完整的代码
let
tmpCode
=
data
[
'_'
];
data
[
'_'
]
=
`@ini_set("display_errors", "0");@set_time_limit(0);echo "
${
tag_s
}
";
${
tmpCode
}
;echo "
${
tag_e
}
";die();`
;
data
[
'_'
]
=
`@ini_set("display_errors", "0");@set_time_limit(0);echo "
${
tag_s
}
";
try{
${
tmpCode
}
;}catch(Exception $e){echo "ERROR://".$e->getMessage();
};echo "
${
tag_e
}
";die();`
;
// 使用编码器进行处理并返回
return
this
.
encodeComplete
(
tag_s
,
tag_e
,
data
);
...
...
source/language/en.js
View file @
a5640c98
...
...
@@ -528,6 +528,7 @@ module.exports = {
},
probedb
:
{
title
:
'Detect database function support'
,
success
:
'Check completed'
,
coltype
:
'ConnType'
,
issupport
:
'Support'
,
}
...
...
source/language/zh.js
View file @
a5640c98
...
...
@@ -529,6 +529,7 @@ module.exports = {
},
probedb
:
{
title
:
'检测数据库函数支持'
,
success
:
'检测完毕'
,
coltype
:
'连接类型'
,
issupport
:
'状态'
,
}
...
...
source/modules/database/asp/index.js
View file @
a5640c98
...
...
@@ -245,6 +245,9 @@ class ASP {
})
).
then
((
res
)
=>
{
if
(
res
[
'text'
].
length
>
0
){
if
(
res
[
'text'
].
indexOf
(
"ERROR://"
)
>
-
1
)
{
throw
res
[
"text"
];
}
toastr
.
success
(
LANG
[
'form'
][
'test_success'
],
LANG_T
[
'success'
]);
}
else
{
toastr
.
warning
(
LANG
[
'form'
][
'test_warning'
],
LANG_T
[
'warning'
]);
...
...
@@ -360,6 +363,9 @@ class ASP {
})
).
then
((
res
)
=>
{
if
(
res
[
'text'
].
length
>
0
){
if
(
res
[
'text'
].
indexOf
(
"ERROR://"
)
>
-
1
)
{
throw
res
[
"text"
];
}
toastr
.
success
(
LANG
[
'form'
][
'test_success'
],
LANG_T
[
'success'
]);
}
else
{
toastr
.
warning
(
LANG
[
'form'
][
'test_warning'
],
LANG_T
[
'warning'
]);
...
...
source/modules/database/custom/index.js
View file @
a5640c98
...
...
@@ -241,6 +241,9 @@ class CUSTOM {
})
).
then
((
res
)
=>
{
if
(
res
[
'text'
].
length
>
0
){
if
(
res
[
'text'
].
indexOf
(
"ERROR://"
)
>
-
1
)
{
throw
res
[
"text"
];
}
toastr
.
success
(
LANG
[
'form'
][
'test_success'
],
LANG_T
[
'success'
]);
}
else
{
toastr
.
warning
(
LANG
[
'form'
][
'test_warning'
],
LANG_T
[
'warning'
]);
...
...
@@ -357,6 +360,9 @@ class CUSTOM {
})
).
then
((
res
)
=>
{
if
(
res
[
'text'
].
length
>
0
){
if
(
res
[
'text'
].
indexOf
(
"ERROR://"
)
>
-
1
)
{
throw
res
[
"text"
];
}
toastr
.
success
(
LANG
[
'form'
][
'test_success'
],
LANG_T
[
'success'
]);
}
else
{
toastr
.
warning
(
LANG
[
'form'
][
'test_warning'
],
LANG_T
[
'warning'
]);
...
...
source/modules/database/index.js
View file @
a5640c98
...
...
@@ -7,6 +7,7 @@
// import AceEditor from 'react-ace';
const
LANG
=
antSword
[
'language'
][
'database'
];
const
LANG_T
=
antSword
[
'language'
][
'toastr'
];
class
Database
{
...
...
@@ -238,6 +239,9 @@ class Database {
that
.
drive
.
core
.
request
(
that
.
drive
.
core
.
base
.
probedb
()
).
then
((
ret
)
=>
{
if
(
ret
[
'text'
].
indexOf
(
"ERROR://"
)
>
-
1
){
throw
res
[
"text"
];
}
let
_data
=
ret
[
'text'
].
split
(
'
\
n'
);
let
data_arr
=
[];
for
(
let
i
=
0
;
i
<
_data
.
length
;
i
++
)
{
...
...
@@ -255,8 +259,10 @@ class Database {
grid
.
parse
({
'rows'
:
data_arr
},
'json'
);
toastr
.
success
(
LANG
[
'probedb'
][
'success'
],
LANG_T
[
'success'
]);
win
.
progressOff
();
}).
catch
((
err
)
=>
{
toastr
.
error
(
JSON
.
stringify
(
err
),
LANG_T
[
'error'
]);
win
.
progressOff
();
});
}
...
...
source/modules/database/php/index.js
View file @
a5640c98
...
...
@@ -359,7 +359,7 @@ class PHP {
{
type
:
'label'
,
label
:
LANG
[
'form'
][
'encode'
]
},
{
type
:
'combo'
,
label
:
''
,
name
:
'encode'
,
options
:
(()
=>
{
let
ret
=
[];
[
'
gbk'
,
'gb2312'
,
'utf-8'
,
'big5'
,
'dec8'
,
'cp850'
,
'hp8'
,
'koi8r'
,
'latin1'
,
'latin2'
,
'ascii'
,
'euckr
'
].
map
((
_
)
=>
{
[
'
utf8'
,
'big5'
,
'dec8'
,
'cp850'
,
'hp8'
,
'koi8r'
,
'latin1'
,
'latin2'
,
'ascii'
,
'euckr'
,
'gb2312'
,
'gbk
'
].
map
((
_
)
=>
{
ret
.
push
({
text
:
_
,
value
:
_
,
...
...
@@ -373,7 +373,7 @@ class PHP {
{
type
:
'label'
,
label
:
LANG
[
'form'
][
'encode'
]
},
{
type
:
'combo'
,
label
:
''
,
name
:
'encode'
,
options
:
(()
=>
{
let
ret
=
[];
[
'
gbk'
,
'gb2312'
,
'utf-8'
,
'big5'
,
'dec8'
,
'cp850'
,
'hp8'
,
'koi8r'
,
'latin1'
,
'latin2'
,
'ascii'
,
'euckr
'
].
map
((
_
)
=>
{
[
'
utf8'
,
'big5'
,
'dec8'
,
'cp850'
,
'hp8'
,
'koi8r'
,
'latin1'
,
'latin2'
,
'ascii'
,
'euckr'
,
'gb2312'
,
'gbk
'
].
map
((
_
)
=>
{
ret
.
push
({
text
:
_
,
value
:
_
,
...
...
@@ -458,6 +458,9 @@ class PHP {
})
).
then
((
res
)
=>
{
if
(
res
[
'text'
].
length
>
0
){
if
(
res
[
'text'
].
indexOf
(
"ERROR://"
)
>
-
1
)
{
throw
res
[
"text"
];
}
toastr
.
success
(
LANG
[
'form'
][
'test_success'
],
LANG_T
[
'success'
]);
}
else
{
toastr
.
warning
(
LANG
[
'form'
][
'test_warning'
],
LANG_T
[
'warning'
]);
...
...
@@ -555,7 +558,7 @@ class PHP {
{
type
:
'label'
,
label
:
LANG
[
'form'
][
'encode'
]
},
{
type
:
'combo'
,
label
:
''
,
name
:
'encode'
,
options
:
(()
=>
{
let
ret
=
[];
[
'
gbk'
,
'gb2312'
,
'utf-8'
,
'big5'
,
'dec8'
,
'cp850'
,
'hp8'
,
'koi8r'
,
'latin1'
,
'latin2'
,
'ascii'
,
'euckr
'
].
map
((
_
)
=>
{
[
'
utf8'
,
'big5'
,
'dec8'
,
'cp850'
,
'hp8'
,
'koi8r'
,
'latin1'
,
'latin2'
,
'ascii'
,
'euckr'
,
'gb2312'
,
'gbk
'
].
map
((
_
)
=>
{
ret
.
push
({
text
:
_
,
value
:
_
,
...
...
@@ -569,7 +572,7 @@ class PHP {
{
type
:
'label'
,
label
:
LANG
[
'form'
][
'encode'
]
},
{
type
:
'combo'
,
label
:
''
,
name
:
'encode'
,
options
:
(()
=>
{
let
ret
=
[];
[
'
gbk'
,
'gb2312'
,
'utf-8'
,
'big5'
,
'dec8'
,
'cp850'
,
'hp8'
,
'koi8r'
,
'latin1'
,
'latin2'
,
'ascii'
,
'euckr
'
].
map
((
_
)
=>
{
[
'
utf8'
,
'big5'
,
'dec8'
,
'cp850'
,
'hp8'
,
'koi8r'
,
'latin1'
,
'latin2'
,
'ascii'
,
'euckr'
,
'gb2312'
,
'gbk
'
].
map
((
_
)
=>
{
ret
.
push
({
text
:
_
,
value
:
_
,
...
...
@@ -659,6 +662,9 @@ class PHP {
})
).
then
((
res
)
=>
{
if
(
res
[
'text'
].
length
>
0
){
if
(
res
[
'text'
].
indexOf
(
"ERROR://"
)
>
-
1
)
{
throw
res
[
"text"
];
}
toastr
.
success
(
LANG
[
'form'
][
'test_success'
],
LANG_T
[
'success'
]);
}
else
{
toastr
.
warning
(
LANG
[
'form'
][
'test_warning'
],
LANG_T
[
'warning'
]);
...
...
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