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
30f365a1
Commit
30f365a1
authored
Aug 05, 2019
by
Medicean
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(Enhance: Settings) 默认设置新增「虚拟终端」缩放设置
parent
391433d3
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
105 additions
and
3 deletions
+105
-3
CHANGELOG.md
CHANGELOG.md
+13
-0
package.json
package.json
+1
-1
en.js
source/language/en.js
+4
-0
zh.js
source/language/zh.js
+4
-0
zh_hk.js
source/language/zh_hk.js
+4
-0
zh_tw.js
source/language/zh_tw.js
+4
-0
adefault.js
source/modules/settings/adefault.js
+66
-0
index.js
source/modules/terminal/index.js
+9
-2
No files found.
CHANGELOG.md
View file @
30f365a1
...
@@ -8,6 +8,19 @@
...
@@ -8,6 +8,19 @@
*
修复 PHP4 命令执行语法错误 #199 (thx @ier005)
*
修复 PHP4 命令执行语法错误 #199 (thx @ier005)
### 系统设置
*
「默认设置」新增「虚拟终端」配置块, 可设置默认字体缩放比例, 最小0.5倍, 最大2倍 (通过快捷键最大可到5倍)
> 拖动 slider bar 之后, 下方可实时预览效果, 点击保存后即可生效(无需重启)

### 虚拟终端
*
新增
`options['tsize']`
可覆盖全局缩放设置
*
支持全局缩放配置 #203
## 2019/07/16 `v(2.1.4)`
## 2019/07/16 `v(2.1.4)`
### 核心模块
### 核心模块
...
...
package.json
View file @
30f365a1
{
{
"name"
:
"antsword"
,
"name"
:
"antsword"
,
"version"
:
"2.1.4.
1
"
,
"version"
:
"2.1.4.
2
"
,
"description"
:
"中国蚁剑是一款跨平台的开源网站管理工具"
,
"description"
:
"中国蚁剑是一款跨平台的开源网站管理工具"
,
"main"
:
"app.js"
,
"main"
:
"app.js"
,
"dependencies"
:
{
"dependencies"
:
{
...
...
source/language/en.js
View file @
30f365a1
...
@@ -938,6 +938,10 @@ Hot Keys:
...
@@ -938,6 +938,10 @@ Hot Keys:
nohttps
:
'Ignore HTTPS certificate'
,
nohttps
:
'Ignore HTTPS certificate'
,
requestTimeout
:
'Request timeout'
requestTimeout
:
'Request timeout'
}
}
},
terminal
:
{
title
:
'Terminal'
,
size
:
'Scale'
}
}
}
}
},
},
...
...
source/language/zh.js
View file @
30f365a1
...
@@ -938,6 +938,10 @@ module.exports = {
...
@@ -938,6 +938,10 @@ module.exports = {
nohttps
:
'忽略HTTPS证书'
,
nohttps
:
'忽略HTTPS证书'
,
requestTimeout
:
'请求超时'
requestTimeout
:
'请求超时'
}
}
},
terminal
:
{
title
:
'虚拟终端'
,
size
:
'缩放'
}
}
}
}
},
},
...
...
source/language/zh_hk.js
View file @
30f365a1
...
@@ -936,6 +936,10 @@ module.exports = {
...
@@ -936,6 +936,10 @@ module.exports = {
nohttps
:
'忽略HTTPS證書'
,
nohttps
:
'忽略HTTPS證書'
,
requestTimeout
:
'請求超時'
requestTimeout
:
'請求超時'
}
}
},
terminal
:
{
title
:
'虛擬終端'
,
size
:
'縮放'
}
}
}
}
},
},
...
...
source/language/zh_tw.js
View file @
30f365a1
...
@@ -937,6 +937,10 @@ module.exports = {
...
@@ -937,6 +937,10 @@ module.exports = {
nohttps
:
'忽略HTTPS證書'
,
nohttps
:
'忽略HTTPS證書'
,
requestTimeout
:
'請求超時'
requestTimeout
:
'請求超時'
}
}
},
terminal
:
{
title
:
'虛擬終端'
,
size
:
'縮放'
}
}
}
}
},
},
...
...
source/modules/settings/adefault.js
View file @
30f365a1
...
@@ -29,6 +29,9 @@ class ADefault {
...
@@ -29,6 +29,9 @@ class ADefault {
"ignore-https"
:
0
,
"ignore-https"
:
0
,
"request-timeout"
:
'10000'
"request-timeout"
:
'10000'
}
}
},
terminal
:
{
tsize
:
1
,
}
}
};
};
// 读取配置
// 读取配置
...
@@ -55,6 +58,10 @@ class ADefault {
...
@@ -55,6 +58,10 @@ class ADefault {
if
(
!
this
.
shellmanager_settings
.
others
)
{
if
(
!
this
.
shellmanager_settings
.
others
)
{
this
.
shellmanager_settings
.
others
=
default_config
.
shellmanager
.
others
;
this
.
shellmanager_settings
.
others
=
default_config
.
shellmanager
.
others
;
}
}
const
terminal_settings
=
JSON
.
parse
(
antSword
[
'storage'
](
"adefault_terminal"
,
false
,
JSON
.
stringify
(
default_config
.
terminal
)));
this
.
terminal_settings
=
terminal_settings
;
const
toolbar
=
cell
.
attachToolbar
();
const
toolbar
=
cell
.
attachToolbar
();
toolbar
.
loadStruct
([{
toolbar
.
loadStruct
([{
id
:
'save'
,
id
:
'save'
,
...
@@ -181,6 +188,31 @@ class ADefault {
...
@@ -181,6 +188,31 @@ class ADefault {
}]
}]
}]
}]
},
},
{
type
:
'fieldset'
,
label
:
`<i class="fa fa-terminal"></i>
${
LANG
[
'terminal'
][
'title'
]}
`
,
list
:
[{
type
:
'block'
,
list
:
[{
type
:
'label'
,
name
:
'terminal_size_label'
,
label
:
`
${
LANG
[
'terminal'
][
'size'
]}
x
${
parseFloat
(
this
.
terminal_settings
.
tsize
).
toFixed
(
2
)}
`
},
{
type
:
'newcolumn'
,
offset
:
20
},
{
type
:
'container'
,
name
:
'terminal_size'
,
inputWidth
:
300
,
inputHeight
:
30
},
{
type
:
'container'
,
name
:
'terminal_size_preview'
,
inputWidth
:
600
,
inputHeight
:
200
},
]
}]
},
// 后续其它模块
// 后续其它模块
]
]
}],
true
);
}],
true
);
...
@@ -360,10 +392,13 @@ class ADefault {
...
@@ -360,10 +392,13 @@ class ADefault {
config
.
shellmanager
.
bodys
=
self
.
shellmanager_settings
.
bodys
;
config
.
shellmanager
.
bodys
=
self
.
shellmanager_settings
.
bodys
;
config
.
shellmanager
.
others
[
"ignore-https"
]
=
_formvals
[
'shellmanager_ignore-https'
];
config
.
shellmanager
.
others
[
"ignore-https"
]
=
_formvals
[
'shellmanager_ignore-https'
];
config
.
shellmanager
.
others
[
"request-timeout"
]
=
_formvals
[
'shellmanager_request-timeout'
];
config
.
shellmanager
.
others
[
"request-timeout"
]
=
_formvals
[
'shellmanager_request-timeout'
];
config
.
terminal
.
tsize
=
self
.
terminal_settings
.
tsize
;
// save save 文件管理设置
// save save 文件管理设置
antSword
[
'storage'
](
'adefault_filemanager'
,
config
.
filemanager
);
antSword
[
'storage'
](
'adefault_filemanager'
,
config
.
filemanager
);
antSword
[
'storage'
](
'adefault_database'
,
config
.
database
);
antSword
[
'storage'
](
'adefault_database'
,
config
.
database
);
antSword
[
'storage'
](
'adefault_shellmanager'
,
config
.
shellmanager
);
antSword
[
'storage'
](
'adefault_shellmanager'
,
config
.
shellmanager
);
antSword
[
'storage'
](
'adefault_terminal'
,
config
.
terminal
);
toastr
.
success
(
LANG
[
'success'
],
LANG_T
[
'success'
]);
toastr
.
success
(
LANG
[
'success'
],
LANG_T
[
'success'
]);
// 重启应用
// 重启应用
layer
.
confirm
(
LANG
[
'confirm'
][
'content'
],
{
layer
.
confirm
(
LANG
[
'confirm'
][
'content'
],
{
...
@@ -536,6 +571,37 @@ class ADefault {
...
@@ -536,6 +571,37 @@ class ADefault {
shellmanager_bodys_grid
.
init
();
shellmanager_bodys_grid
.
init
();
this
.
shellmanager_bodys_grid
=
shellmanager_bodys_grid
;
this
.
shellmanager_bodys_grid
=
shellmanager_bodys_grid
;
// Terminal 部分
// preview
form
.
getContainer
(
'terminal_size_preview'
).
innerHTML
=
`<div id="div_terminal_preview" style="height:100%;margin:0;padding:0 5px 1px 5px;overflow:scroll;--size:
${
this
.
terminal_settings
.
tsize
}
;"></div>`
;
let
banner
=
`[[b;cyan;](*) Information]`
;
banner
+=
`\n[[b;#99A50D;]Path ]: [[;#C3C3C3;]/var/www/html]`
;
banner
+=
`\n[[b;#99A50D;]Driver]: [[;#C3C3C3;]/]`
;
banner
+=
`\n[[b;#99A50D;]System]: [[;#C3C3C3;]Linux 4.9.125-linuxkit #1 SMP Fri Sep 7 08:20:28 UTC 2018 x86_64]`
;
banner
+=
`\n[[b;#99A50D;]User ]: [[;#C3C3C3;]www-data]`
;
let
terminal_size_preview
=
$
(
"#div_terminal_preview"
);
let
term
=
terminal_size_preview
.
terminal
((
cmd
,
ter
)
=>
{
ter
.
reset
();
},
{
prompt
:
'([[b;#E80000;]www-data]:[[;#0F93D2;]/var/www/html]) $ '
,
greetings
:
banner
,
history
:
false
,
});
// size slider
let
terminal_size_slider
=
new
dhtmlXSlider
({
parent
:
form
.
getContainer
(
'terminal_size'
),
size
:
300
,
value
:
this
.
terminal_settings
.
tsize
,
step
:
0.05
,
min
:
0.5
,
max
:
2
,
});
terminal_size_slider
.
attachEvent
(
"onSlideEnd"
,
(
value
)
=>
{
this
.
terminal_settings
.
tsize
=
value
;
form
.
setItemLabel
(
'terminal_size_label'
,
`
${
LANG
[
'terminal'
][
'size'
]}
x
${
parseFloat
(
value
).
toFixed
(
2
)}
`
);
term
[
0
].
style
.
setProperty
(
'--size'
,
value
);
});
// grid右键
// grid右键
[
bookmark_grid
,
db_bookmark_grid
,
shellmanager_headers_grid
,
shellmanager_bodys_grid
].
forEach
((
g
)
=>
{
[
bookmark_grid
,
db_bookmark_grid
,
shellmanager_headers_grid
,
shellmanager_bodys_grid
].
forEach
((
g
)
=>
{
// 空白数据右键fix
// 空白数据右键fix
...
...
source/modules/terminal/index.js
View file @
30f365a1
...
@@ -25,15 +25,19 @@ class Terminal {
...
@@ -25,15 +25,19 @@ class Terminal {
.
focus
()
:
.
focus
()
:
0
;
0
;
});
});
let
config
=
{
tsize
:
1
,
};
this
.
config
=
JSON
.
parse
(
antSword
[
'storage'
](
"adefault_terminal"
,
false
,
JSON
.
stringify
(
config
)));
// 初始化UI::cell
// 初始化UI::cell
const
cell
=
tabbar
.
cells
(
`tab_terminal_
${
hash
}
`
);
const
cell
=
tabbar
.
cells
(
`tab_terminal_
${
hash
}
`
);
cell
.
attachHTMLString
(
`
cell
.
attachHTMLString
(
`
<div
<div
id="div_terminal_
${
hash
}
"
id="div_terminal_
${
hash
}
"
style="height:100%;margin:0;padding:0 5px 1px 5px;overflow:scroll;--size:
1
;"
style="height:100%;margin:0;padding:0 5px 1px 5px;overflow:scroll;--size:
${
parseFloat
(
this
.
config
.
tsize
)}
;"
></div>
></div>
`
);
`
);
this
.
path
=
''
;
this
.
path
=
''
;
this
.
opts
=
opts
;
this
.
opts
=
opts
;
this
.
options
=
options
||
{};
this
.
options
=
options
||
{};
...
@@ -64,6 +68,9 @@ class Terminal {
...
@@ -64,6 +68,9 @@ class Terminal {
if
(
this
.
options
.
hasOwnProperty
(
"exec"
))
{
if
(
this
.
options
.
hasOwnProperty
(
"exec"
))
{
this
.
core
.
command
.
exec
=
this
.
options
.
exec
;
this
.
core
.
command
.
exec
=
this
.
options
.
exec
;
}
}
if
(
this
.
options
.
hasOwnProperty
(
"tsize"
))
{
this
.
term
[
0
].
style
.
setProperty
(
"--size"
,
parseFloat
(
this
.
options
.
size
));
}
})
})
.
catch
((
err
)
=>
{
.
catch
((
err
)
=>
{
toastr
.
error
((
typeof
(
err
)
===
'object'
)
?
toastr
.
error
((
typeof
(
err
)
===
'object'
)
?
...
...
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