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
03c5cf92
Commit
03c5cf92
authored
Sep 22, 2020
by
Medicean
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix jsp probedb bug
parent
1a30ec6e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
129 additions
and
78 deletions
+129
-78
index.js
source/modules/database/jsp/index.js
+55
-6
index.js
source/modules/filemanager/index.js
+74
-72
No files found.
source/modules/database/jsp/index.js
View file @
03c5cf92
...
...
@@ -6,6 +6,7 @@ const LANG = antSword['language']['database'];
const
LANG_T
=
antSword
[
'language'
][
'toastr'
];
const
dialog
=
antSword
.
remote
.
dialog
;
const
fs
=
require
(
'fs'
);
const
Decodes
=
antSword
.
Decodes
;
class
JSP
{
...
...
@@ -728,12 +729,50 @@ class JSP {
});
}
parseResult
(
data
)
{
// 1.分割数组
const
arr
=
data
.
split
(
'
\
n'
);
// 2.判断数据
if
(
arr
.
length
<
2
)
{
return
toastr
.
error
(
LANG
[
'result'
][
'error'
][
'parse'
],
LANG_T
[
'error'
]);
};
// 3.行头
let
header_arr
=
(
arr
[
0
]).
replace
(
/,/g
,
','
).
split
(
'
\
t|
\
t'
);
if
(
header_arr
.
length
===
1
)
{
return
toastr
.
warning
(
LANG
[
'result'
][
'error'
][
'noresult'
],
LANG_T
[
'warning'
]);
};
if
(
header_arr
[
header_arr
.
length
-
1
]
===
'
\
r'
)
{
header_arr
.
pop
();
};
arr
.
shift
();
// 4.数据
let
data_arr
=
[];
arr
.
map
((
_
)
=>
{
let
_data
=
_
.
split
(
'
\
t|
\
t'
);
for
(
let
i
=
0
;
i
<
_data
.
length
;
i
++
)
{
let
buff
=
Buffer
.
from
(
_data
[
i
],
"base64"
);
let
encoding
=
Decodes
.
detectEncoding
(
buff
,
{
defaultEncoding
:
"unknown"
});
if
(
encoding
==
"unknown"
)
{
encoding
=
this
.
dbconf
[
'encode'
]
||
''
;
}
encoding
=
encoding
!=
""
?
encoding
:
this
.
opt
.
core
.
__opts__
[
'encode'
];
let
text
=
Decodes
.
decode
(
buff
,
encoding
);
_data
[
i
]
=
antSword
.
noxss
(
text
);
}
data_arr
.
push
(
_data
);
});
data_arr
.
pop
();
return
{
headers
:
header_arr
,
datas
:
data_arr
}
}
// 更新SQL执行结果
updateResult
(
data
)
{
// 1.分割数组
const
arr
=
data
.
split
(
'
\
n'
);
// let arr = []; _arr.map((_) => { arr.push(antSword.noxss(_)); });
// console.log(_arr, arr); 2.判断数据
// 2.判断数据
if
(
arr
.
length
<
2
)
{
return
toastr
.
error
(
LANG
[
'result'
][
'error'
][
'parse'
],
LANG_T
[
'error'
]);
};
...
...
@@ -750,6 +789,16 @@ class JSP {
let
data_arr
=
[];
arr
.
map
((
_
)
=>
{
let
_data
=
_
.
split
(
'
\
t|
\
t'
);
for
(
let
i
=
0
;
i
<
_data
.
length
;
i
++
)
{
let
buff
=
new
Buffer
.
from
(
_data
[
i
],
"base64"
);
let
encoding
=
Decodes
.
detectEncoding
(
buff
,
{
defaultEncoding
:
"unknown"
});
if
(
encoding
==
"unknown"
)
{
encoding
=
this
.
dbconf
[
'encode'
]
||
''
;
}
encoding
=
encoding
!=
""
?
encoding
:
this
.
opt
.
core
.
__opts__
[
'encode'
];
let
text
=
Decodes
.
decode
(
buff
,
encoding
);
_data
[
i
]
=
antSword
.
noxss
(
text
,
false
);
}
data_arr
.
push
(
_data
);
});
data_arr
.
pop
();
...
...
source/modules/filemanager/index.js
View file @
03c5cf92
...
...
@@ -100,7 +100,7 @@ class FileManager {
this
.
isWin
=
false
;
}
else
{
// windows 盘符统一大写
info_path
=
`
${
info_path
.
substr
(
0
,
1
).
toUpperCase
()}${
info_path
.
substr
(
1
)}
`
;
info_path
=
`
${
info_path
.
substr
(
0
,
1
).
toUpperCase
()}${
info_path
.
substr
(
1
)}
`
;
info_drive
=
info_drive
.
toUpperCase
();
};
this
.
path
=
info_path
;
...
...
@@ -145,11 +145,11 @@ class FileManager {
let
self
=
this
;
if
(
self
.
isWin
)
{
// 处理输入为 f:\ 这种情况
p
=
p
.
replace
(
/
\\
/g
,
'/'
);
p
=
p
.
substr
(
1
,
2
)
==
":/"
?
`
${
p
.
substr
(
0
,
1
).
toUpperCase
()}${
p
.
substr
(
1
)}
`
:
p
;
p
=
p
.
substr
(
1
,
2
)
==
":/"
?
`
${
p
.
substr
(
0
,
1
).
toUpperCase
()}${
p
.
substr
(
1
)}
`
:
p
;
}
let
path
=
this
.
changePath
(
p
);
if
(
self
.
isWin
)
{
// 处理输入为 f: 这种情况
path
=
path
.
substr
(
1
,
2
)
==
":/"
?
`
${
path
.
substr
(
0
,
1
).
toUpperCase
()}${
path
.
substr
(
1
)}
`
:
path
;
path
=
path
.
substr
(
1
,
2
)
==
":/"
?
`
${
path
.
substr
(
0
,
1
).
toUpperCase
()}${
path
.
substr
(
1
)}
`
:
path
;
}
let
cache
;
...
...
@@ -208,6 +208,8 @@ class FileManager {
this
.
cache
.
set
(
cache_tag
,
JSON
.
stringify
(
data
));
}).
catch
((
err
)
=>
{
toastr
.
error
((
err
instanceof
Object
)
?
JSON
.
stringify
(
err
)
:
String
(
err
),
LANG_T
[
'error'
]);
this
.
folder
.
cell
.
progressOff
();
this
.
files
.
cell
.
progressOff
();
})
// this.core.filemanager.dir({
...
...
@@ -944,7 +946,7 @@ class FileManager {
icon: '
code
',
type: '
button
'
};
(_ === ext) ? _opt['
selected
'] = true: 0;
(_ === ext) ? _opt['
selected
'] = true
: 0;
_options.push(_opt);
}
toolbar.loadStruct([{
...
...
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