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
7c725661
Commit
7c725661
authored
Jun 28, 2021
by
yzddmr6
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(Enhance: core)简化新类型Shell创建步骤
parent
961b9e62
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
76 deletions
+42
-76
app.entry.js
source/app.entry.js
+24
-34
index.js
source/core/index.js
+1
-2
encoders.js
source/modules/settings/encoders.js
+17
-40
No files found.
source/app.entry.js
View file @
7c725661
...
...
@@ -75,6 +75,11 @@ const antSword = window.antSword = {
* @type {Object}
*/
core
:
{},
/**
* 核心模块类型列表
* @type {Object}
*/
core_types
:
{},
/**
* 插件列表
* @type {Object}
...
...
@@ -162,6 +167,9 @@ const antSword = window.antSword = {
}
};
//核心模块类型列表
antSword
[
'core_types'
]
=
[
'asp'
,
'aspx'
,
'php'
,
'php4'
,
'jsp'
,
'jspjs'
,
'custom'
];
// 加载核心模板
antSword
[
'core'
]
=
require
(
'./core/'
);
...
...
@@ -170,28 +178,19 @@ antSword['language'] = require('./language/');
// 加载编码
antSword
[
'encoders'
]
=
(
function
()
{
var
encoders
=
{
asp
:
[],
aspx
:
[],
jsp
:
[],
jspjs
:
[],
php
:
[],
custom
:
[]
};
var
encoders_path
=
{
asp
:
[],
aspx
:
[],
jsp
:
[],
jspjs
:
[],
php
:
[],
custom
:
[]
};
var
encoders
=
{};
var
encoders_path
=
{};
for
(
var
i
in
antSword
[
'core_types'
])
{
encoders
[
antSword
[
'core_types'
][
i
]]
=
[];
encoders_path
[
antSword
[
'core_types'
][
i
]]
=
[];
}
let
userencoder_path
=
path
.
join
(
remote
.
process
.
env
.
AS_WORKDIR
,
'antData/encoders'
);
// 初始化
!
fs
.
existsSync
(
userencoder_path
)
?
fs
.
mkdirSync
(
userencoder_path
)
:
null
;
[
'asp'
,
'aspx'
,
'php'
,
'jsp'
,
'jspjs'
,
'custom
'
].
map
((
t
)
=>
{
antSword
[
'core_types
'
].
map
((
t
)
=>
{
!
fs
.
existsSync
(
path
.
join
(
userencoder_path
,
`
${
t
}
`
))
?
fs
.
mkdirSync
(
path
.
join
(
userencoder_path
,
`
${
t
}
`
))
:
null
;
...
...
@@ -227,28 +226,19 @@ antSword['encoders'] = (function () {
// 加载解码器
antSword
[
'decoders'
]
=
(
function
()
{
var
decoders
=
{
asp
:
[],
aspx
:
[],
php
:
[],
jsp
:
[],
jspjs
:
[],
custom
:
[]
};
var
decoders_path
=
{
asp
:
[],
aspx
:
[],
php
:
[],
jsp
:
[],
jspjs
:
[],
custom
:
[]
};
var
decoders
=
{};
var
decoders_path
=
{};
for
(
var
i
in
antSword
[
'core_types'
])
{
decoders
[
antSword
[
'core_types'
][
i
]]
=
[];
decoders_path
[
antSword
[
'core_types'
][
i
]]
=
[];
}
let
userdecoder_path
=
path
.
join
(
remote
.
process
.
env
.
AS_WORKDIR
,
'antData/encoders'
);
// 初始化
!
fs
.
existsSync
(
userdecoder_path
)
?
fs
.
mkdirSync
(
userdecoder_path
)
:
null
;
[
'asp'
,
'aspx'
,
'php'
,
'jsp'
,
'jspjs'
,
'custom
'
].
map
((
t
)
=>
{
antSword
[
'core_types
'
].
map
((
t
)
=>
{
!
fs
.
existsSync
(
path
.
join
(
userdecoder_path
,
`
${
t
}
`
))
?
fs
.
mkdirSync
(
path
.
join
(
userdecoder_path
,
`
${
t
}
`
))
:
null
;
...
...
source/core/index.js
View file @
7c725661
...
...
@@ -5,7 +5,6 @@
* 作者:蚁逅 <https://github.com/antoor>
*/
'use strict'
;
class
Core
{
/**
* AntSword Core init
...
...
@@ -14,7 +13,7 @@ class Core {
constructor
()
{
// 加载子模块列表
let
cores
=
{};
[
'php'
,
'asp'
,
'aspx'
,
'jsp'
,
'jspjs'
,
'custom'
,
'php4
'
].
map
((
_
)
=>
{
antSword
[
'core_types
'
].
map
((
_
)
=>
{
cores
[
_
]
=
require
(
`./
${
_
}
/index`
);
});
// 返回子模块对象
...
...
source/modules/settings/encoders.js
View file @
7c725661
...
...
@@ -207,12 +207,9 @@ class Encoders {
grid
.
setColAlign
(
"center,left,center,center"
);
grid
.
enableMultiselect
(
true
);
var
combobox
=
grid
.
getCombo
(
2
);
combobox
.
put
(
"asp"
,
"ASP"
);
combobox
.
put
(
"aspx"
,
"ASPX"
);
combobox
.
put
(
"php"
,
"PHP"
);
combobox
.
put
(
"jsp"
,
"JSP"
);
combobox
.
put
(
"jspjs"
,
"JSPJS"
);
combobox
.
put
(
"custom"
,
"CUSTOM"
);
antSword
[
'core_types'
].
map
((
t
)
=>
{
combobox
.
put
(
t
,
t
.
toUpperCase
());
});
grid
.
attachEvent
(
"onEditCell"
,
function
(
stage
,
rId
,
cInd
,
nValue
,
oValue
)
{
// 2 编辑完成
...
...
@@ -778,28 +775,18 @@ module.exports = {
// 同步到全局编码器
syncencoders
()
{
antSword
[
'encoders'
]
=
(
function
()
{
var
encoders
=
{
asp
:
[],
aspx
:
[],
php
:
[],
jsp
:
[],
jspjs
:
[],
custom
:
[],
};
var
encoders_path
=
{
asp
:
[],
aspx
:
[],
php
:
[],
jsp
:
[],
jspjs
:
[],
custom
:
[],
};
var
encoders
=
{};
var
encoders_path
=
{};
for
(
var
i
in
antSword
[
'core_types'
])
{
encoders
[
antSword
[
'core_types'
][
i
]]
=
[];
encoders_path
[
antSword
[
'core_types'
][
i
]]
=
[];
}
let
userencoder_path
=
path
.
join
(
remote
.
process
.
env
.
AS_WORKDIR
,
'antData/encoders'
);
// 初始化
!
fs
.
existsSync
(
userencoder_path
)
?
fs
.
mkdirSync
(
userencoder_path
)
:
null
;
[
'asp'
,
'aspx'
,
'php'
,
'jsp'
,
'jspjs'
,
'custom
'
].
map
((
t
)
=>
{
antSword
[
'core_types
'
].
map
((
t
)
=>
{
!
fs
.
existsSync
(
path
.
join
(
userencoder_path
,
`
${
t
}
`
))
?
fs
.
mkdirSync
(
path
.
join
(
userencoder_path
,
`
${
t
}
`
))
:
null
;
...
...
@@ -829,28 +816,18 @@ module.exports = {
// 同步到全局编码器
syncdecoders
()
{
antSword
[
'decoders'
]
=
(
function
()
{
var
decoders
=
{
asp
:
[],
aspx
:
[],
php
:
[],
jsp
:
[],
jspjs
:
[],
custom
:
[]
};
var
decoders_path
=
{
asp
:
[],
aspx
:
[],
php
:
[],
jsp
:
[],
jspjs
:
[],
custom
:
[]
};
var
decoders
=
{};
var
decoders_path
=
{};
for
(
var
i
in
antSword
[
'core_types'
])
{
decoders
[
antSword
[
'core_types'
][
i
]]
=
[];
decoders_path
[
antSword
[
'core_types'
][
i
]]
=
[];
}
let
userdecoder_path
=
path
.
join
(
remote
.
process
.
env
.
AS_WORKDIR
,
'antData/encoders'
);
// 初始化
!
fs
.
existsSync
(
userdecoder_path
)
?
fs
.
mkdirSync
(
userdecoder_path
)
:
null
;
[
'asp'
,
'aspx'
,
'php'
,
'jsp'
,
'jspjs'
,
'custom
'
].
map
((
t
)
=>
{
antSword
[
'core_types
'
].
map
((
t
)
=>
{
!
fs
.
existsSync
(
path
.
join
(
userdecoder_path
,
`
${
t
}
`
))
?
fs
.
mkdirSync
(
path
.
join
(
userdecoder_path
,
`
${
t
}
`
))
:
null
;
...
...
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