Refactored ui. Improved console experience. Added command endpoint
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
@using MoonCore.Helpers
|
||||
@using Moonlight.Shared.Http.Responses.Admin.Users
|
||||
@using MoonlightServers.Shared.Http.Requests.Admin.Servers
|
||||
@using MoonlightServers.Frontend.UI.Components.Servers.CreateServerPartials
|
||||
@using MoonlightServers.Frontend.UI.Components.Servers.CreatePartials
|
||||
@using MoonlightServers.Shared.Http.Responses.Admin.NodeAllocations
|
||||
@using MoonlightServers.Shared.Http.Responses.Admin.Nodes
|
||||
@using MoonlightServers.Shared.Http.Responses.Admin.Stars
|
||||
@@ -18,11 +18,11 @@
|
||||
|
||||
<PageHeader Title="Create Server">
|
||||
<a href="/admin/servers/all" class="btn btn-secondary">
|
||||
<i class="icon-chevron-left mr-1"></i>
|
||||
<i class="icon-chevron-left"></i>
|
||||
Back
|
||||
</a>
|
||||
<WButton OnClick="_ => Form.Submit()" CssClasses="btn btn-primary">
|
||||
<i class="icon-check mr-1"></i>
|
||||
<i class="icon-check"></i>
|
||||
Create
|
||||
</WButton>
|
||||
</PageHeader>
|
||||
@@ -31,16 +31,16 @@
|
||||
<HandleForm @ref="Form" Model="Request" OnValidSubmit="OnSubmit">
|
||||
<Tabs>
|
||||
<Tab Name="General">
|
||||
<GeneralServerCreate Request="Request" Parent="this" />
|
||||
<General Request="Request" Parent="this" />
|
||||
</Tab>
|
||||
<Tab Name="Allocations">
|
||||
<AllocationsServerCreate Request="Request" Parent="this" />
|
||||
<Allocations Request="Request" Parent="this" />
|
||||
</Tab>
|
||||
<Tab Name="Variables">
|
||||
<VariablesServerCreate Request="Request" Parent="this" />
|
||||
<Variables Request="Request" Parent="this" />
|
||||
</Tab>
|
||||
<Tab Name="Advanced">
|
||||
<AdvancedServerCreate Request="Request" />
|
||||
<Advanced Request="Request" />
|
||||
</Tab>
|
||||
</Tabs>
|
||||
</HandleForm>
|
||||
|
||||
@@ -33,7 +33,13 @@
|
||||
<Pagination TItem="ServerResponse" ItemSource="LoadData" />
|
||||
|
||||
<DataTableColumn TItem="ServerResponse" Field="@(x => x.Id)" Name="Id"/>
|
||||
<DataTableColumn TItem="ServerResponse" Field="@(x => x.Name)" Name="Name"/>
|
||||
<DataTableColumn TItem="ServerResponse" Field="@(x => x.Name)" Name="Name">
|
||||
<ColumnTemplate>
|
||||
<a class="text-primary" href="/admin/servers/all/update/@context.Id">
|
||||
@context.Name
|
||||
</a>
|
||||
</ColumnTemplate>
|
||||
</DataTableColumn>
|
||||
<DataTableColumn TItem="ServerResponse" Field="@(x => x.NodeId)" Name="Node">
|
||||
<ColumnTemplate>
|
||||
@{
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
@using Moonlight.Shared.Http.Responses.Admin.Users
|
||||
@using MoonlightServers.Shared.Http.Requests.Admin.Servers
|
||||
@using MoonlightServers.Shared.Http.Responses.Admin.Servers
|
||||
@using MoonlightServers.Frontend.UI.Components.Servers.UpdateServerPartials
|
||||
@using MoonlightServers.Frontend.UI.Components.Servers.UpdatePartials
|
||||
@using MoonlightServers.Shared.Http.Responses.Admin.NodeAllocations
|
||||
|
||||
@inject HttpApiClient ApiClient
|
||||
@@ -18,11 +18,11 @@
|
||||
<LazyLoader Load="Load">
|
||||
<PageHeader Title="Update Server">
|
||||
<a href="/admin/servers/all" class="btn btn-secondary">
|
||||
<i class="icon-chevron-left mr-1"></i>
|
||||
<i class="icon-chevron-left"></i>
|
||||
Back
|
||||
</a>
|
||||
<WButton OnClick="_ => Form.Submit()" CssClasses="btn btn-primary">
|
||||
<i class="icon-check mr-1"></i>
|
||||
<i class="icon-check"></i>
|
||||
Update
|
||||
</WButton>
|
||||
</PageHeader>
|
||||
@@ -31,16 +31,16 @@
|
||||
<HandleForm @ref="Form" Model="Request" OnValidSubmit="OnSubmit">
|
||||
<Tabs>
|
||||
<Tab Name="General">
|
||||
<GeneralServerUpdate Request="Request" Owner="Owner"/>
|
||||
<General Request="Request" Parent="this"/>
|
||||
</Tab>
|
||||
<Tab Name="Allocations">
|
||||
<AllocationsServerUpdate Request="Request" Server="Server" Allocations="Allocations"/>
|
||||
<Allocations Request="Request" Server="Server" Parent="this"/>
|
||||
</Tab>
|
||||
<Tab Name="Variables">
|
||||
<VariablesServerUpdate Request="Request" Server="Server"/>
|
||||
<Variables Request="Request" Server="Server"/>
|
||||
</Tab>
|
||||
<Tab Name="Advanced">
|
||||
<AdvancedServerUpdate Request="Request"/>
|
||||
<Advanced Request="Request"/>
|
||||
</Tab>
|
||||
</Tabs>
|
||||
</HandleForm>
|
||||
@@ -55,8 +55,8 @@
|
||||
private UpdateServerRequest Request;
|
||||
private ServerResponse Server;
|
||||
|
||||
private List<NodeAllocationResponse> Allocations = new();
|
||||
private UserResponse Owner;
|
||||
public List<NodeAllocationResponse> Allocations = new();
|
||||
public UserResponse Owner;
|
||||
|
||||
private async Task Load(LazyLoader _)
|
||||
{
|
||||
|
||||
@@ -13,11 +13,11 @@
|
||||
|
||||
<PageHeader Title="Create Node">
|
||||
<a href="/admin/servers/nodes" class="btn btn-secondary">
|
||||
<i class="icon-chevron-left mr-1"></i>
|
||||
<i class="icon-chevron-left"></i>
|
||||
Back
|
||||
</a>
|
||||
<WButton OnClick="_ => Form.Submit()" CssClasses="btn btn-primary">
|
||||
<i class="icon-check mr-1"></i>
|
||||
<i class="icon-check"></i>
|
||||
Create
|
||||
</WButton>
|
||||
</PageHeader>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
@using MoonCore.Helpers
|
||||
@using MoonlightServers.Shared.Http.Requests.Admin.Nodes
|
||||
@using MoonlightServers.Shared.Http.Responses.Admin.Nodes
|
||||
@using MoonlightServers.Frontend.UI.Components.Nodes.UpdateNodePartials
|
||||
@using MoonlightServers.Frontend.UI.Components.Nodes.UpdatePartials
|
||||
|
||||
@inject HttpApiClient ApiClient
|
||||
@inject NavigationManager Navigation
|
||||
@@ -16,11 +16,11 @@
|
||||
<LazyLoader Load="Load">
|
||||
<PageHeader Title="@Node.Name">
|
||||
<a href="/admin/servers/nodes" class="btn btn-secondary">
|
||||
<i class="icon-chevron-left mr-1"></i>
|
||||
<i class="icon-chevron-left"></i>
|
||||
Back
|
||||
</a>
|
||||
<WButton OnClick="_ => Form.Submit()" CssClasses="btn btn-primary">
|
||||
<i class="icon-check mr-1"></i>
|
||||
<i class="icon-check"></i>
|
||||
Update
|
||||
</WButton>
|
||||
</PageHeader>
|
||||
@@ -30,19 +30,19 @@
|
||||
|
||||
<Tabs>
|
||||
<Tab Name="Overview">
|
||||
<OverviewNodeUpdate Node="Node" />
|
||||
<Overview Node="Node" />
|
||||
</Tab>
|
||||
|
||||
<Tab Name="Settings">
|
||||
<GeneralNodeUpdate Request="Request"/>
|
||||
<General Request="Request"/>
|
||||
</Tab>
|
||||
|
||||
<Tab Name="Allocations">
|
||||
<AllocationsNodeUpdate Node="Node"/>
|
||||
<Allocations Node="Node"/>
|
||||
</Tab>
|
||||
|
||||
<Tab Name="Advanced Settings">
|
||||
<AdvancedNodeUpdate Request="Request"/>
|
||||
<Advanced Request="Request"/>
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
|
||||
@@ -14,11 +14,11 @@
|
||||
|
||||
<PageHeader Title="Create Star">
|
||||
<a href="/admin/servers/stars" class="btn btn-secondary">
|
||||
<i class="icon-chevron-left mr-1"></i>
|
||||
<i class="icon-chevron-left"></i>
|
||||
Back
|
||||
</a>
|
||||
<WButton OnClick="_ => Form.Submit()" CssClasses="btn btn-primary">
|
||||
<i class="icon-check mr-1"></i>
|
||||
<i class="icon-check"></i>
|
||||
Create
|
||||
</WButton>
|
||||
</PageHeader>
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<PageHeader Title="Stars">
|
||||
<InputFile id="import-file" hidden="" multiple OnChange="OnImportFiles"/>
|
||||
<label for="import-file" class="btn btn-accent cursor-pointer">
|
||||
<i class="icon-file-up mr-2"></i>
|
||||
<i class="icon-file-up"></i>
|
||||
Import
|
||||
</label>
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
@using MoonCore.Helpers
|
||||
@using MoonlightServers.Shared.Http.Requests.Admin.Stars
|
||||
@using MoonlightServers.Shared.Http.Responses.Admin.Stars
|
||||
@using MoonlightServers.Frontend.UI.Components.Stars.UpdateStarPartials
|
||||
@using MoonlightServers.Frontend.UI.Components.Stars.UpdatePartials
|
||||
|
||||
@inject HttpApiClient ApiClient
|
||||
@inject NavigationManager Navigation
|
||||
@@ -16,11 +16,11 @@
|
||||
<LazyLoader Load="Load">
|
||||
<PageHeader Title="Update Star">
|
||||
<a href="/admin/servers/stars" class="btn btn-secondary">
|
||||
<i class="icon-chevron-left mr-1"></i>
|
||||
<i class="icon-chevron-left"></i>
|
||||
Back
|
||||
</a>
|
||||
<WButton OnClick="_ => Form.Submit()" CssClasses="btn btn-primary">
|
||||
<i class="icon-check mr-1"></i>
|
||||
<i class="icon-check"></i>
|
||||
Update
|
||||
</WButton>
|
||||
</PageHeader>
|
||||
@@ -30,31 +30,31 @@
|
||||
|
||||
<Tabs>
|
||||
<Tab Name="General">
|
||||
<GeneralStarUpdate Request="Request" />
|
||||
<General Request="Request" />
|
||||
</Tab>
|
||||
|
||||
<Tab Name="Start, Stop & Status">
|
||||
<StartStopStatusStarUpdate Request="Request" />
|
||||
<StartStopStatus Request="Request" />
|
||||
</Tab>
|
||||
|
||||
<Tab Name="Parse Configuration">
|
||||
<ParseConfigStarUpdate Request="Request" />
|
||||
<ParseConfig Request="Request" />
|
||||
</Tab>
|
||||
|
||||
<Tab Name="Installation">
|
||||
<InstallationStarUpdate Request="Request" />
|
||||
<Installation Request="Request" />
|
||||
</Tab>
|
||||
|
||||
<Tab Name="Variables">
|
||||
<VariablesStarUpdate Star="Detail" />
|
||||
<Variables Star="Detail" />
|
||||
</Tab>
|
||||
|
||||
<Tab Name="Docker Images">
|
||||
<DockerImageStarUpdate Star="Detail" />
|
||||
<DockerImage Star="Detail" />
|
||||
</Tab>
|
||||
|
||||
<Tab Name="Miscellaneous">
|
||||
<MiscStarUpdate Star="Detail" Request="Request" />
|
||||
<Misc Star="Detail" Request="Request" />
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
|
||||
@@ -64,14 +64,14 @@
|
||||
@if (State == ServerState.Offline)
|
||||
{
|
||||
<WButton CssClasses="btn btn-success" OnClick="_ => Start()">
|
||||
<i class="icon-play me-1 align-middle"></i>
|
||||
<i class="icon-play align-middle"></i>
|
||||
<span class="align-middle">Start</span>
|
||||
</WButton>
|
||||
}
|
||||
else
|
||||
{
|
||||
<button type="button" class="btn btn-success" disabled="disabled">
|
||||
<i class="icon-play me-1 align-middle"></i>
|
||||
<i class="icon-play align-middle"></i>
|
||||
<span class="align-middle">Start</span>
|
||||
</button>
|
||||
}
|
||||
@@ -79,14 +79,14 @@
|
||||
@if (State == ServerState.Online)
|
||||
{
|
||||
<button type="button" class="btn btn-primary">
|
||||
<i class="icon-rotate-ccw me-1 align-middle"></i>
|
||||
<i class="icon-rotate-ccw align-middle"></i>
|
||||
<span class="align-middle">Restart</span>
|
||||
</button>
|
||||
}
|
||||
else
|
||||
{
|
||||
<button type="button" class="btn btn-primary" disabled="disabled">
|
||||
<i class="icon-rotate-ccw me-1 align-middle"></i>
|
||||
<i class="icon-rotate-ccw align-middle"></i>
|
||||
<span class="align-middle">Restart</span>
|
||||
</button>
|
||||
}
|
||||
@@ -96,14 +96,14 @@
|
||||
if (State == ServerState.Stopping)
|
||||
{
|
||||
<WButton CssClasses="btn btn-error" OnClick="_ => Kill()">
|
||||
<i class="icon-bomb me-1 align-middle"></i>
|
||||
<i class="icon-bomb align-middle"></i>
|
||||
<span class="align-middle">Kill</span>
|
||||
</WButton>
|
||||
}
|
||||
else
|
||||
{
|
||||
<WButton CssClasses="btn btn-error" OnClick="_ => Stop()">
|
||||
<i class="icon-squircle me-1 align-middle"></i>
|
||||
<i class="icon-squircle align-middle"></i>
|
||||
<span class="align-middle">Stop</span>
|
||||
</WButton>
|
||||
}
|
||||
@@ -111,7 +111,7 @@
|
||||
else
|
||||
{
|
||||
<button type="button" class="btn btn-error" disabled="disabled">
|
||||
<i class="icon-squircle me-1 align-middle"></i>
|
||||
<i class="icon-squircle align-middle"></i>
|
||||
<span class="align-middle">Stop</span>
|
||||
</button>
|
||||
}
|
||||
@@ -119,17 +119,17 @@
|
||||
else
|
||||
{
|
||||
<button type="button" class="btn btn-success" disabled="disabled">
|
||||
<i class="icon-play me-1 align-middle"></i>
|
||||
<i class="icon-play align-middle"></i>
|
||||
<span class="align-middle">Start</span>
|
||||
</button>
|
||||
|
||||
<button type="button" class="btn btn-primary" disabled="disabled">
|
||||
<i class="icon-rotate-ccw me-1 align-middle"></i>
|
||||
<i class="icon-rotate-ccw align-middle"></i>
|
||||
<span class="align-middle">Restart</span>
|
||||
</button>
|
||||
|
||||
<button type="button" class="btn btn-error" disabled="disabled">
|
||||
<i class="icon-squircle me-1 align-middle"></i>
|
||||
<i class="icon-squircle align-middle"></i>
|
||||
<span class="align-middle">Stop</span>
|
||||
</button>
|
||||
}
|
||||
@@ -138,28 +138,20 @@
|
||||
</div>
|
||||
|
||||
<div class="mt-3">
|
||||
<ul class="flex flex-wrap -m-1">
|
||||
|
||||
<nav class="tabs space-x-2 overflow-x-auto" aria-label="Tabs" role="tablist" aria-orientation="horizontal">
|
||||
@foreach (var tab in Tabs)
|
||||
{
|
||||
<li class="m-1">
|
||||
@if (tab == CurrentTab)
|
||||
{
|
||||
<a href="/servers/@(ServerId)/@(tab.Path)"
|
||||
class="inline-flex items-center justify-center text-sm font-medium leading-5 rounded-full px-3 py-1 border border-transparent shadow-sm bg-gray-100 text-gray-800 transition">
|
||||
@tab.Name
|
||||
</a>
|
||||
}
|
||||
else
|
||||
{
|
||||
<a href="/servers/@(ServerId)/@(tab.Path)" @onclick:preventDefault
|
||||
@onclick="() => SwitchTab(tab)"
|
||||
class="inline-flex items-center justify-center text-sm font-medium leading-5 rounded-full px-3 py-1 border border-gray-700/60 hover:border-gray-600 shadow-sm bg-gray-800 text-base-content/60 transition">
|
||||
@tab.Name
|
||||
</a>
|
||||
}
|
||||
</li>
|
||||
<a href="/servers/@(ServerId)/@(tab.Path)"
|
||||
class="btn btn-text active-tab:bg-primary active-tab:text-primary-content hover:text-primary hover:bg-primary/20 bg-base-150 text-sm py-0.5 px-3 rounded-xl @(tab == CurrentTab ? "active" : "")"
|
||||
data-tab="na"
|
||||
role="tab"
|
||||
@onclick:preventDefault
|
||||
@onclick="() => SwitchTab(tab)">
|
||||
@tab.Name
|
||||
</a>
|
||||
}
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
<div class="mt-5">
|
||||
@if (CurrentTab == null)
|
||||
@@ -201,6 +193,8 @@
|
||||
|
||||
private HubConnection? HubConnection;
|
||||
|
||||
public ConcurrentList<string> CommandHistory = new();
|
||||
|
||||
private async Task Load(LazyLoader _)
|
||||
{
|
||||
try
|
||||
|
||||
Reference in New Issue
Block a user