feat(panel): log stream stop funtion

This commit is contained in:
2024-05-30 14:42:18 +02:00
parent 1313f608ba
commit cc5adcffa3
2 changed files with 7 additions and 2 deletions

View File

@ -1,9 +1,13 @@
window.serverLogsStream = {
logs: "x",
start: (dotNetObject, serverId) => {
const logs = new EventSource(`http://localhost:8080/api/admin/servers/${serverId}/logs`, { withCredentials: true });
logs = new EventSource(`http://localhost:8080/api/admin/servers/${serverId}/logs`, { withCredentials: true });
logs.onmessage = event => {
dotNetObject.invokeMethodAsync("ReceiveLog", event.data);
}
}
},
stop: () => logs.close()
}