Minecraft-Realms-Emulator/Panel/wwwroot/js/serverLogsStream.js

13 lines
335 B
JavaScript
Raw Normal View History

window.serverLogsStream = {
2024-05-30 08:42:18 -04:00
logs: "x",
start: (dotNetObject, serverId) => {
2024-12-18 08:00:05 -05:00
logs = new EventSource(`http://localhost:8080/api/admin/servers/${serverId}/logs`);
logs.onmessage = event => {
dotNetObject.invokeMethodAsync("ReceiveLog", event.data);
}
2024-05-30 08:42:18 -04:00
},
stop: () => logs.close()
}