mirror of
https://github.com/chylex/Minecraft-Phantom-Panel.git
synced 2025-05-04 18:34:05 +02:00
38 lines
917 B
Plaintext
38 lines
917 B
Plaintext
@page "/instances/{InstanceGuid:guid}/edit"
|
|
@attribute [Authorize(Permission.CreateInstancesPolicy)]
|
|
@using Phantom.Common.Data.Web.Instance
|
|
@using Phantom.Common.Data.Web.Users
|
|
@using Phantom.Web.Services.Instances
|
|
@inherits PhantomComponent
|
|
@inject InstanceManager InstanceManager
|
|
|
|
@if (isLoading) {
|
|
<h1>Edit Instance</h1>
|
|
<p>Loading...</p>
|
|
return;
|
|
}
|
|
|
|
@if (Instance == null) {
|
|
<h1>Instance Not Found</h1>
|
|
<p>Return to <a href="instances">all instances</a>.</p>
|
|
return;
|
|
}
|
|
|
|
<h1>Edit Instance: @Instance.Configuration.InstanceName</h1>
|
|
<InstanceAddOrEditForm EditedInstance="Instance" />
|
|
|
|
@code {
|
|
|
|
[Parameter]
|
|
public Guid InstanceGuid { get; init; }
|
|
|
|
private Instance? Instance { get; set; }
|
|
private bool isLoading = true;
|
|
|
|
protected override async Task OnInitializedAsync() {
|
|
Instance = InstanceManager.GetByGuid(await GetAuthenticatedUser(), InstanceGuid);
|
|
isLoading = false;
|
|
}
|
|
|
|
}
|