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

40 lines
1013 B
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()
{
var markdown = await Http.GetStringAsync("Dashboard.md");
if (!string.IsNullOrWhiteSpace(markdown))
{
markdownContent = Markdown.ToHtml(markdown);
}
isLoading = false;
}
}