Commit aaee1832 authored by antoor's avatar antoor

Delete command cache function

删除命令执行缓存功能
parent 64440cc3
......@@ -136,14 +136,15 @@ 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)
);
return term.resume();
};
// 最后想了想,这个命令执行结果的缓存还是暂时不需要了吧
// 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();
// };
// 开始执行命令
this.core.request(
......@@ -175,7 +176,7 @@ class Terminal {
});
if (output.length > 0) {
term.echo(
antSword.noxss(output)
antSword.noxss(output, false)
);
// 保存最大100kb数据
if (output.length < (1024 * 1024)) {
......@@ -183,8 +184,8 @@ class Terminal {
};
};
term.resume();
}).catch((e) => {
term.error('ERR: ' + (_ instanceof Object) ? JSON.stringify(_) : String(_));
}).catch((_) => {
// term.error('ERR: ' + (_ instanceof Object) ? JSON.stringify(_) : String(_));
term.resume();
});
}, {
......
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