mirror of
https://github.com/CyberL1/Minecraft-Realms-Emulator.git
synced 2024-12-23 21:08:22 -05:00
feat(panel): log stream stop funtion
This commit is contained in:
parent
1313f608ba
commit
cc5adcffa3
@ -96,6 +96,7 @@ else
|
||||
HttpClient httpClient = new HttpClient();
|
||||
httpClient.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue(Environment.GetEnvironmentVariable("ADMIN_KEY"));
|
||||
|
||||
await JS.InvokeVoidAsync("serverLogsStream.stop");
|
||||
await httpClient.PutAsync($"http://localhost:8080/api/admin/servers/{wId}/close", new StringContent(""));
|
||||
await GetServer();
|
||||
}
|
||||
|
@ -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()
|
||||
}
|
Loading…
Reference in New Issue
Block a user