mirror of
https://github.com/chylex/Minecraft-Phantom-Panel.git
synced 2025-08-16 21:31:45 +02:00
.config
.run
.workdir
Agent
Common
Docker
Server
Phantom.Server
Phantom.Server.Database
Phantom.Server.Database.Postgres
Phantom.Server.Rpc
Phantom.Server.Services
Phantom.Server.Web
Layout
Pages
Shared
InstanceLog.razor
InstanceLog.razor.css
InstanceLog.razor.js
InstanceStatusText.razor
wwwroot
App.razor
Configuration.cs
Launcher.cs
Phantom.Server.Web.csproj
_Imports.razor
appsettings.json
Phantom.Server.Web.Bootstrap
Phantom.Server.Web.Components
Utils
.gitattributes
.gitignore
AddMigration.bat
AddMigration.sh
PhantomPanel.sln
global.json
35 lines
680 B
JavaScript
35 lines
680 B
JavaScript
// noinspection JSUnusedGlobalSymbols
|
|
|
|
let log;
|
|
let shouldAutoScroll = false;
|
|
let isAutoScrolling = false;
|
|
|
|
export function initLog() {
|
|
log = document.getElementById("log");
|
|
|
|
if (log) {
|
|
shouldAutoScroll = true;
|
|
log.scrollTop = log.scrollHeight;
|
|
log.addEventListener("scroll", function() {
|
|
if (isAutoScrolling) {
|
|
isAutoScrolling = false;
|
|
}
|
|
else {
|
|
setTimeout(function() {
|
|
shouldAutoScroll = log.scrollHeight - log.scrollTop - log.clientHeight < 5;
|
|
}, 10);
|
|
}
|
|
});
|
|
}
|
|
else {
|
|
console.error("Missing log element.");
|
|
}
|
|
}
|
|
|
|
export function scrollLog() {
|
|
if (shouldAutoScroll) {
|
|
isAutoScrolling = true;
|
|
log.scrollTop = log.scrollHeight;
|
|
}
|
|
}
|