@page "/settings/about" @using System.Text @using Iceshrimp.Frontend.Core.InMemoryLogger @using Iceshrimp.Frontend.Core.Services; @using Iceshrimp.Frontend.Localization; @using Microsoft.Extensions.Localization; @layout SettingsLayout; @inject VersionService Version; @inject IStringLocalizer Loc; @inject IJSRuntime Js; @inject InMemoryLogService LogService;

@Loc["Version Information"]

Iceshrimp.NET @Version.Version Codename @Version.Codename @if (Version.CommitHash != null) { Commit @Version.CommitHash }

@Loc["Logs"]

@Loc["These logs may contain sensitive information, please do not post them publicly.\n" + "Providing them to developers upon request may help with debugging."]
@code { private IJSInProcessObjectReference _module = null!; protected override async Task OnInitializedAsync() { _module = (IJSInProcessObjectReference) await Js.InvokeAsync("import", "./Components/ErrorUi.razor.js"); } private void DownloadLogs() { var logBytes = LogService.GetLogs().SelectMany(p => Encoding.UTF8.GetBytes(p)).ToArray(); _module.InvokeVoid("DownloadFile", "log.txt", "text/plain", logBytes); } }