Merge pull request #291 from Moonlight-Panel/FixInitialInstallConsole

Fixed initial install console and added a better redirect handling when creating a server
This commit is contained in:
Marcel Baumgartner 2023-08-27 20:41:40 +02:00 committed by GitHub
commit 95ba81eab4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions

View file

@ -218,6 +218,16 @@ public class WingsConsole : IDisposable
break;
case "install output":
if (ServerState != ServerState.Installing)
{
// Because wings is sending "install output" events BEFORE
// sending the "install started" event,
// we need to set the install state here
// See https://github.com/pterodactyl/panel/issues/4853
// for more details
await UpdateServerState(ServerState.Installing);
}
foreach (var line in eventData.Args)
{
await SaveMessage(line);

View file

@ -229,7 +229,7 @@
{
try
{
await ServerService.Create(Model.Name, Model.Cpu, Model.Memory, Model.Disk, Model.Owner, Model.Image, Model.Node, server =>
var newServer = await ServerService.Create(Model.Name, Model.Cpu, Model.Memory, Model.Disk, Model.Owner, Model.Image, Model.Node, server =>
{
server.OverrideStartup = Model.OverrideStartup;
server.DockerImageIndex = Model.DockerImageIndex;
@ -242,7 +242,7 @@
});
await ToastService.Success(SmartTranslateService.Translate("Server successfully created"));
NavigationManager.NavigateTo("/admin/servers");
NavigationManager.NavigateTo($"/server/{newServer.Uuid}");
}
catch (DisplayException e)
{