-
Notifications
You must be signed in to change notification settings - Fork 337
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved AdminPanel UI to manage connect servers
- Loading branch information
Showing
12 changed files
with
453 additions
and
41 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
src/Dapr/AdminPanel.Host/DockerConnectServerInstanceManager.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using MUnique.OpenMU.Interfaces; | ||
|
||
namespace MUnique.OpenMU.AdminPanel.Host; | ||
|
||
/// <summary> | ||
/// An implementation of <see cref="IConnectServerInstanceManager"/>. | ||
/// </summary> | ||
public class DockerConnectServerInstanceManager : IConnectServerInstanceManager | ||
{ | ||
private readonly IServerProvider _serverProvider; | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="DockerGameServerInstanceManager"/> class. | ||
/// </summary> | ||
/// <param name="serverProvider">The server provider.</param> | ||
public DockerConnectServerInstanceManager(IServerProvider serverProvider) | ||
{ | ||
this._serverProvider = serverProvider; | ||
} | ||
|
||
/// <inheritdoc /> | ||
public async ValueTask InitializeConnectServerAsync(byte serverId) | ||
{ | ||
// TODO: Implement this... by starting a new docker container | ||
|
||
} | ||
|
||
/// <inheritdoc /> | ||
public async ValueTask RemoveConnectServerAsync(byte serverId) | ||
{ | ||
var connectServers = this._serverProvider.Servers | ||
.Where(server => server.Type == ServerType.ConnectServer) | ||
.FirstOrDefault(server => server.Id == serverId); | ||
if (connectServers is not null) | ||
{ | ||
await connectServers.ShutdownAsync().ConfigureAwait(false); | ||
// TODO: Remove the docker container | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// <copyright file="IConnectServerInstanceManager.cs" company="MUnique"> | ||
// Licensed under the MIT License. See LICENSE file in the project root for full license information. | ||
// </copyright> | ||
|
||
namespace MUnique.OpenMU.Interfaces; | ||
|
||
/// <summary> | ||
/// Interface for an instance which manages connect servers. | ||
/// </summary> | ||
public interface IConnectServerInstanceManager | ||
{ | ||
/// <summary> | ||
/// Initializes a connect server with the specified definition. | ||
/// </summary> | ||
/// <param name="connectServerDefinitionId">The connect server definition identifier.</param> | ||
ValueTask InitializeConnectServerAsync(Guid connectServerDefinitionId); | ||
|
||
/// <summary> | ||
/// Removes the connect server instance of the specified definition. | ||
/// </summary> | ||
/// <param name="connectServerDefinitionId">The connect server definition identifier.</param> | ||
ValueTask RemoveConnectServerAsync(Guid connectServerDefinitionId); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
@page "/create-connect-server" | ||
|
||
@using MUnique.OpenMU.Persistence | ||
|
||
<h1>Create Connect Server Definition</h1> | ||
|
||
|
||
@if (this._viewModel is null) | ||
{ | ||
<span class="spinner-border" role="status" aria-hidden="true"></span> | ||
<span class="sr-only">Loading...</span> | ||
return; | ||
} | ||
|
||
@if (this._initState is { }) | ||
{ | ||
<span class="spinner-border" role="status" aria-hidden="true"></span> | ||
<span class="sr-only">@this._initState</span> | ||
return; | ||
} | ||
|
||
|
||
<AutoForm Model="this._viewModel" OnValidSubmit="this.OnSaveButtonClickAsync"></AutoForm> | ||
|
Oops, something went wrong.