Commit c32a6334 authored by Antoor's avatar Antoor Committed by GitHub

Merge pull request #68 from antoor/v2.0-beta-terminal-nocache

v2.0-beta::terminal nocache
parents f7a1178f cd476f09
......@@ -154,7 +154,7 @@ module.exports = {
},
otherConf: {
nohttps: 'Ignore HTTPS certificate',
notermcache: "Don't use the terminal's cache"
terminalCache: "Use the terminal's cache"
}
}
},
......
......@@ -155,7 +155,7 @@ module.exports = {
},
otherConf: {
nohttps: '忽略HTTPS证书',
notermcache: "虚拟终端不使用缓存"
terminalCache: "虚拟终端使用缓存"
}
}
},
......
......@@ -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']['notermcache'],
type: "checkbox", name: 'terminal-cache', label: LANG['list']['otherConf']['terminalCache'],
checked: opt['terminal-cache'] === 1
}, {
type: "label", label: '请求超时'
......
......@@ -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({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment