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
c32a6334
Commit
c32a6334
authored
Jun 29, 2016
by
Antoor
Committed by
GitHub
Jun 29, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #68 from antoor/v2.0-beta-terminal-nocache
v2.0-beta::terminal nocache
parents
f7a1178f
cd476f09
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
14 deletions
+14
-14
en.js
source/language/en.js
+1
-1
zh.js
source/language/zh.js
+1
-1
form.js
source/modules/shellmanager/list/form.js
+2
-2
index.js
source/modules/terminal/index.js
+10
-10
No files found.
source/language/en.js
View file @
c32a6334
...
...
@@ -154,7 +154,7 @@ module.exports = {
},
otherConf
:
{
nohttps
:
'Ignore HTTPS certificate'
,
notermcache
:
"Don't u
se the terminal's cache"
terminalCache
:
"U
se the terminal's cache"
}
}
},
...
...
source/language/zh.js
View file @
c32a6334
...
...
@@ -155,7 +155,7 @@ module.exports = {
},
otherConf
:
{
nohttps
:
'忽略HTTPS证书'
,
notermcache
:
"虚拟终端不
使用缓存"
terminalCache
:
"虚拟终端
使用缓存"
}
}
},
...
...
source/modules/shellmanager/list/form.js
View file @
c32a6334
...
...
@@ -270,7 +270,7 @@ class Form {
_createOtherForm
(
arg
)
{
const
opt
=
Object
.
assign
({},
{
'ignore-https'
:
0
,
'terminal-cache'
:
1
,
'terminal-cache'
:
0
,
'request-timeout'
:
'10000'
},
arg
.
otherConf
);
const
form
=
this
.
accordion
.
cells
(
'other'
).
attachForm
([{
...
...
@@ -281,7 +281,7 @@ class Form {
type
:
"checkbox"
,
name
:
'ignore-https'
,
label
:
LANG
[
'list'
][
'otherConf'
][
'nohttps'
],
checked
:
opt
[
'ignore-https'
]
===
1
},
{
type
:
"checkbox"
,
name
:
'terminal-cache'
,
label
:
LANG
[
'list'
][
'otherConf'
][
'
notermc
ache'
],
type
:
"checkbox"
,
name
:
'terminal-cache'
,
label
:
LANG
[
'list'
][
'otherConf'
][
'
terminalC
ache'
],
checked
:
opt
[
'terminal-cache'
]
===
1
},
{
type
:
"label"
,
label
:
'请求超时'
...
...
source/modules/terminal/index.js
View file @
c32a6334
...
...
@@ -136,16 +136,16 @@ class Terminal {
if
(
cmd
===
'exit'
||
cmd
===
'quit'
)
{
return
this
.
cell
.
close
()
};
term
.
pause
();
// 是否有缓存
// 最后想了想,这个命令执行结果的缓存还是暂时不需要了吧
// let cacheTag = 'command-' + new Buffer(this.path + cmd).toString('base64'
);
// let cacheCmd;
// if (cacheCmd = this.cache.get(cacheTag)) {
// term.echo(
// antSword.noxss(cacheCmd, false)
// );
// return term.resume(
);
// }
;
let
cacheTag
=
'command-'
+
new
Buffer
(
this
.
path
+
cmd
).
toString
(
'base64'
);
let
cacheCmd
=
this
.
cache
.
get
(
cacheTag
);
if
(
(
this
.
opts
.
otherConf
||
{})[
'terminal-cache'
]
===
1
&&
cacheCmd
)
{
term
.
echo
(
antSword
.
noxss
(
cacheCmd
,
false
)
);
return
term
.
resume
()
;
};
// 开始执行命令
this
.
core
.
request
(
this
.
core
.
command
.
exec
({
...
...
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