mirror of
https://github.com/MCSManager/MCSManager.git
synced 2024-11-21 03:12:10 +08:00
删除 - 历史日志记录器UI
This commit is contained in:
parent
1fe002fc7b
commit
fdccd2c4cf
@ -148,26 +148,6 @@
|
||||
|
||||
});
|
||||
|
||||
//获取控制台历史记录
|
||||
MI.routeListener('server/console/history', function (data) {
|
||||
var consoleSafe = terminalEncode(data.body);
|
||||
|
||||
var MinecraftConsole = document.getElementById('TerminalMinecraft');
|
||||
var ifyLoad =
|
||||
'<span style="color:#3af138;">[历史日志] </span>' +
|
||||
'<span style="color:rgb(212, 136, 30);">================<br></span>';
|
||||
|
||||
var oldTopV = 0;
|
||||
var oldHeightV = MinecraftConsole.scrollHeight;
|
||||
//incude
|
||||
MinecraftConsole.innerHTML = consoleSafe + ifyLoad + MinecraftConsole.innerHTML;
|
||||
var newTopV = MinecraftConsole.scrollTop;
|
||||
var newHeightV = MinecraftConsole.scrollHeight;
|
||||
|
||||
var resVTopLac = newHeightV - oldHeightV;
|
||||
MinecraftConsole.scrollTop = resVTopLac - 60;
|
||||
});
|
||||
|
||||
//普通用户主页
|
||||
MI.routeListener('genuser/home', function (data) {
|
||||
MI.routeCopy('GenHome', data.obj);
|
||||
|
@ -1,5 +1,4 @@
|
||||
<div id='Terminal'>
|
||||
<div id='TerminalLoad' v-if="historyIf" v-on:click="loadHistory()">更多历史日志</div>
|
||||
<div class="row" style="position: absolute;right: 25px;">
|
||||
<div class="col-sm-12 PanelItemF">
|
||||
<div class="PanelItem PanelItemBlack" v-on:click="RES.redirectPage('./template/component/console.html', 'server/console', MCSERVER.listenServername);">
|
||||
@ -59,12 +58,7 @@
|
||||
var ele = document.getElementById('TerminalMinecraft');
|
||||
ele.scrollTop = ele.scrollHeight;
|
||||
},
|
||||
loadHistory: function () {
|
||||
console.log('loading');
|
||||
var obj = {};
|
||||
obj.serverName = PAGE.serverName;
|
||||
WS.sendMsg('server/console/history', JSON.stringify(obj));
|
||||
},
|
||||
|
||||
toOpenServer: function () {
|
||||
WS.sendMsg('server/console/open', PAGE.serverName);
|
||||
},
|
||||
@ -108,41 +102,6 @@
|
||||
}
|
||||
});
|
||||
PAGE.mainC = document.getElementById('TerminalMinecraft');
|
||||
var jl = true;
|
||||
PAGE.mainC.onscroll = function () {
|
||||
VIEW_MODEL['Terminal'].historyIf = (PAGE.mainC.scrollTop - 100 <= 0);
|
||||
}
|
||||
|
||||
PAGE.maskTerminalLoad = function () {
|
||||
if (PAGE.mainC.scrollTop - 300 <= 0 && jl == true) {
|
||||
jl = false;
|
||||
var obj = {};
|
||||
obj.serverName = PAGE.serverName;
|
||||
WS.sendMsg('server/console/history', JSON.stringify(obj), function () {
|
||||
jl = true;
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
PAGE.terminalLoad = function (callback) {
|
||||
jl = false;
|
||||
var obj = {};
|
||||
obj.serverName = PAGE.serverName;
|
||||
WS.sendMsg('server/console/history', JSON.stringify(obj), function () {
|
||||
jl = true;
|
||||
callback && callback();
|
||||
});
|
||||
}
|
||||
|
||||
PAGE.terminalLoad(function () {
|
||||
//由于DOM插入时间不一定,所以此功能只能靠猜~
|
||||
setTimeout(function () {
|
||||
$("#TerminalMinecraft")[0].scrollTop = $("#TerminalMinecraft")[0].scrollHeight;
|
||||
}, 1000);
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
MI.rListener('onend', function () {
|
||||
|
Loading…
Reference in New Issue
Block a user