1
0
mirror of synced 2024-12-18 17:35:55 +01:00
TaikoLocalServer/TaikoWebUI/Pages/Dashboard.razor

45 lines
1.1 KiB
Plaintext
Raw Normal View History

2022-09-11 18:28:12 +02:00
@page "/"
@inject HttpClient Http
@using Markdig
2022-09-05 23:42:13 +02:00
<MudText Typo="Typo.h4">@Localizer["Dashboard"]</MudText>
<MudGrid Class="my-8">
<MudItem xs="12">
<MudPaper Elevation="0" Outlined="true">
<div class="markdown-container">
@if (isLoading)
{
<MudCircularProgress />
}
else
{
<div class="markdown-content">
@((MarkupString)markdownContent)
</div>
}
</div>
</MudPaper>
</MudItem>
</MudGrid>
2022-09-05 23:42:13 +02:00
@code {
private string markdownContent = string.Empty;
private bool isLoading = true;
protected override async Task OnInitializedAsync()
{
2024-06-06 05:53:33 +02:00
var pipeline = new MarkdownPipelineBuilder()
.UseAdvancedExtensions()
.UseEmojiAndSmiley()
.Build();
var markdown = await Http.GetStringAsync("Dashboard.md");
if (!string.IsNullOrWhiteSpace(markdown))
{
2024-06-06 05:53:33 +02:00
markdownContent = Markdown.ToHtml(markdown, pipeline);
}
isLoading = false;
}
}