1
0
mirror of https://github.com/chylex/Minecraft-Phantom-Panel.git synced 2024-11-22 08:42:44 +01:00
Minecraft-Phantom-Panel/Server/Phantom.Server.Web/Pages/InstanceEdit.razor

29 lines
799 B
Plaintext

@page "/instances/{InstanceGuid:guid}/edit"
@attribute [Authorize(Permission.CreateInstancesPolicy)]
@using Phantom.Server.Services.Instances
@using Phantom.Common.Data.Instance
@inherits PhantomComponent
@inject InstanceManager InstanceManager
@if (InstanceConfiguration == null) {
<h1>Instance Not Found</h1>
<p>Return to <a href="instances">all instances</a>.</p>
}
else {
<h1>Edit Instance: @InstanceConfiguration.InstanceName</h1>
<InstanceAddOrEditForm EditedInstanceConfiguration="InstanceConfiguration" />
}
@code {
[Parameter]
public Guid InstanceGuid { get; set; }
private InstanceConfiguration? InstanceConfiguration { get; set; }
protected override void OnInitialized() {
InstanceConfiguration = InstanceManager.GetInstanceConfiguration(InstanceGuid);
}
}