优化 终端与历史窗口界面布局

This commit is contained in:
Suwings 2020-03-10 12:57:18 +08:00
parent 652efb29ed
commit 178386dea3
5 changed files with 35 additions and 23 deletions

View File

@ -40,6 +40,10 @@ class LogHistory {
if (!this.readPoints[demander]) {
this.readPoints[demander] = 0;
}
if (!fs.existsSync(this.path)) {
callback && callback('');
return this;
}
const demanderPoint = this.readPoints[demander];
const buffer = Buffer.alloc(size);
fs.open(this.path, 'r', (err, fd) => {
@ -67,6 +71,7 @@ class LogHistory {
fs.close(fd, () => { });
});
});
return this;
}
@ -74,6 +79,10 @@ class LogHistory {
if (!this.readPoints[demander]) {
this.readPoints[demander] = 0;
}
if (!fs.existsSync(this.path)) {
callback && callback('');
return this;
}
const demanderPoint = this.readPoints[demander];
const buffer = Buffer.alloc(size);
fs.open(this.path, 'r', (err, fd) => {
@ -102,6 +111,7 @@ class LogHistory {
fs.close(fd, () => { });
});
});
return this;
}
setPoint(demander, v) {
@ -109,9 +119,11 @@ class LogHistory {
}
delete() {
fs.unlink(this.path, (err) => {
if (err) MCSERVER.log('实例', this.id, '日志历史记录文件删除错误:', err.message);
});
if (fs.existsSync(this.path)) {
fs.unlink(this.path, (err) => {
if (err) MCSERVER.log('实例', this.id, '日志历史记录文件删除错误:', err.message);
});
}
return this;
}
}

View File

@ -270,14 +270,6 @@
line-height: 12px;
}
/* 手机时的命令输入框 */
/* .TerminalCommandWapper{
position: fixed;
bottom: 10px;
left: 10px;
right: 10px;
} */
}
#Terminal a {
@ -296,15 +288,7 @@
bottom: 50px;
}
/* 日志历史终端 */
#LogHistoryTerminal{
height: 80vh;
width: 100%;
background-color: rgb(0, 0, 0);
overflow-y: scroll;
color: rgb(207, 207, 207);
padding: 4px;
}
/* 黑色屏障 */

View File

@ -321,6 +321,16 @@ input {
.WebTerminalScreen{
overflow-y: auto;
}
/* 日志历史终端 */
#LogHistoryTerminal{
height: 80vh;
background-color: rgb(0, 0, 0);
overflow-y: scroll;
color: rgb(207, 207, 207);
padding: 4px;
font-size: 11px;
margin: 0;
}
@media (max-width:800px) {
#HeaderInfo {
@ -379,4 +389,12 @@ input {
.WebTerminalScreen{
margin: -10px -12px -9px -12px;
}
#LogHistoryTerminal{
font-size: 10px;
height: 70vh;
padding: 2px;
margin: -10px -12px -9px -12px;
overflow-x: scroll;
}
}

View File

@ -64,7 +64,7 @@
var rows = parseInt(clientHeight / 18) - 1;
var cols = parseInt(clientWidth / 8) - 4;
var fontSize = 14;
if (document.body.clientWidth <= 800) {
if (document.body.clientWidth <= 820) {
fontSize = 10;
rows = parseInt(clientHeight / 14);
cols = parseInt(clientWidth / 3);

View File

@ -9,8 +9,6 @@ const permssion = require('../../helper/Permission');
const { LogHistory } = require('../../helper/LogHistory');
const BASE_RECORD_DIR = "./server/record_tmp/";
//日志缓存记录器
MCSERVER.consoleLog = {};