@page "/admin" @using LucideBlazor @using Moonlight.Shared.Http.Responses.Admin @using ShadcnBlazor.Buttons @using ShadcnBlazor.Cards @using ShadcnBlazor.Spinners @inject HttpClient HttpClient

Overview

Here you can see a quick overview of your moonlight instance
@if (IsInfoLoading || InfoResponse == null) { } else { CPU Usage @Math.Round(InfoResponse.CpuUsage, 2)% } @if (IsInfoLoading || InfoResponse == null) { } else { Memory Usage @Formatter.FormatSize(InfoResponse.MemoryUsage) } @if (IsInfoLoading || InfoResponse == null) { } else { Operating System @InfoResponse.OperatingSystem } @if (IsInfoLoading || InfoResponse == null) { } else { Uptime @Formatter.FormatDuration(InfoResponse.Uptime) } @if (IsInfoLoading || InfoResponse == null) { } else { Version @InfoResponse.VersionName } @if (IsInfoLoading || InfoResponse == null) { } else { Update Status @if (InfoResponse.IsUpToDate) { Up-to-date } else { Update available } }
@code { private bool IsInfoLoading = true; private SystemInfoResponse? InfoResponse; protected override async Task OnAfterRenderAsync(bool firstRender) { if(!firstRender) return; InfoResponse = await HttpClient.GetFromJsonAsync("api/admin/system/info", Constants.SerializerOptions); IsInfoLoading = false; await InvokeAsync(StateHasChanged); } }