UnRenderedMessageCache = new();
diff --git a/Moonlight/Features/Servers/UI/UserViews/Console.razor b/Moonlight/Features/Servers/UI/UserViews/Console.razor
index 478e546..e42a4f5 100644
--- a/Moonlight/Features/Servers/UI/UserViews/Console.razor
+++ b/Moonlight/Features/Servers/UI/UserViews/Console.razor
@@ -1,5 +1,9 @@
@using Moonlight.Features.Servers.Models.Abstractions
+@using Moonlight.Features.Servers.Services
@using Moonlight.Features.Servers.UI.Components
+@using Moonlight.Features.Servers.Entities
+
+@inject ServerService ServerService
@implements IDisposable
@@ -7,8 +11,8 @@
@@ -17,8 +21,12 @@
{
[CascadingParameter]
public ServerMeta Meta { get; set; }
+
+ [CascadingParameter]
+ public Server Server { get; set; }
private Terminal Terminal;
+ private string CommandInput = "";
protected override async Task OnAfterRenderAsync(bool firstRender)
{
@@ -40,10 +48,19 @@
{
await Terminal.WriteLine(message);
}
+
+ private async Task SendCommand()
+ {
+ await ServerService.SendCommand(Server, CommandInput);
+ CommandInput = "";
+
+ await InvokeAsync(StateHasChanged);
+ }
public void Dispose()
{
if(Meta != null)
Meta.OnConsoleMessage -= OnConsoleMessage;
}
+
}
\ No newline at end of file
diff --git a/Moonlight/Features/Servers/UI/UserViews/Reset.razor b/Moonlight/Features/Servers/UI/UserViews/Reset.razor
new file mode 100644
index 0000000..ccddd2e
--- /dev/null
+++ b/Moonlight/Features/Servers/UI/UserViews/Reset.razor
@@ -0,0 +1,53 @@
+@using Moonlight.Features.Servers.Entities
+@using Moonlight.Features.Servers.Models.Abstractions
+@using Moonlight.Features.Servers.Models.Enums
+@using Moonlight.Features.Servers.Services
+
+@implements IDisposable
+
+@inject ServerService ServerService
+
+
+ @if (Meta.State == ServerState.Offline)
+ {
+
+ }
+ else
+ {
+
+ }
+
+
+@code
+{
+ [CascadingParameter]
+ public Server Server { get; set; }
+
+ [CascadingParameter]
+ public ServerMeta Meta { get; set; }
+
+ protected override Task OnAfterRenderAsync(bool firstRender)
+ {
+ if (firstRender)
+ {
+ Meta.OnStateChanged += OnStateChanged;
+ }
+
+ return Task.CompletedTask;
+ }
+
+ private async Task ResetServer()
+ {
+ await ServerService.SendPowerAction(Server, PowerAction.Install);
+ }
+
+ private async Task OnStateChanged()
+ {
+ await InvokeAsync(StateHasChanged);
+ }
+
+ public void Dispose()
+ {
+ Meta.OnStateChanged -= OnStateChanged;
+ }
+}
\ No newline at end of file
diff --git a/Moonlight/Moonlight.csproj b/Moonlight/Moonlight.csproj
index 18a8ea8..ccf47d0 100644
--- a/Moonlight/Moonlight.csproj
+++ b/Moonlight/Moonlight.csproj
@@ -34,6 +34,7 @@
+
@@ -56,7 +57,7 @@
-
+
diff --git a/Moonlight/Pages/_Host.cshtml b/Moonlight/Pages/_Host.cshtml
index ee93fdb..14df0eb 100644
--- a/Moonlight/Pages/_Host.cshtml
+++ b/Moonlight/Pages/_Host.cshtml
@@ -60,9 +60,6 @@
-
-
-
@foreach (var theme in themes)
{