mirror of
https://github.com/CyberL1/Minecraft-Realms-Emulator.git
synced 2024-12-22 04:18:21 -05:00
fix: logs in admin panel
This commit is contained in:
parent
967518dc71
commit
0a89b6ade1
@ -33,6 +33,14 @@ builder.Services.AddDbContext<DataContext>(options =>
|
|||||||
options.UseNpgsql(dataSource);
|
options.UseNpgsql(dataSource);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
builder.Services.AddCors(options =>
|
||||||
|
{
|
||||||
|
options.AddDefaultPolicy(policy =>
|
||||||
|
{
|
||||||
|
policy.WithOrigins("http://localhost:5192");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
var app = builder.Build();
|
var app = builder.Build();
|
||||||
|
|
||||||
// Initialize database
|
// Initialize database
|
||||||
@ -48,6 +56,7 @@ if (app.Environment.IsDevelopment())
|
|||||||
var scope = app.Services.CreateScope();
|
var scope = app.Services.CreateScope();
|
||||||
var db = scope.ServiceProvider.GetRequiredService<DataContext>();
|
var db = scope.ServiceProvider.GetRequiredService<DataContext>();
|
||||||
|
|
||||||
|
app.UseCors();
|
||||||
app.MapControllers();
|
app.MapControllers();
|
||||||
|
|
||||||
var mode = Environment.GetEnvironmentVariable("WORKMODE");
|
var mode = Environment.GetEnvironmentVariable("WORKMODE");
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
logs: "x",
|
logs: "x",
|
||||||
|
|
||||||
start: (dotNetObject, serverId) => {
|
start: (dotNetObject, serverId) => {
|
||||||
logs = new EventSource(`http://localhost:8080/api/admin/servers/${serverId}/logs`, { withCredentials: true });
|
logs = new EventSource(`http://localhost:8080/api/admin/servers/${serverId}/logs`);
|
||||||
|
|
||||||
logs.onmessage = event => {
|
logs.onmessage = event => {
|
||||||
dotNetObject.invokeMethodAsync("ReceiveLog", event.data);
|
dotNetObject.invokeMethodAsync("ReceiveLog", event.data);
|
||||||
|
Loading…
Reference in New Issue
Block a user