2022-09-11 18:28:12 +02:00
|
|
|
@page "/"
|
2024-06-06 05:19:14 +02:00
|
|
|
@inject HttpClient Http
|
|
|
|
@using Markdig
|
2022-09-05 23:42:13 +02:00
|
|
|
|
2024-05-01 17:13:47 +02:00
|
|
|
<MudText Typo="Typo.h4">@Localizer["Dashboard"]</MudText>
|
2024-06-06 05:19:14 +02:00
|
|
|
<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
|
|
|
|
2024-06-06 05:19:14 +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();
|
|
|
|
|
2024-06-06 05:19:14 +02:00
|
|
|
var markdown = await Http.GetStringAsync("Dashboard.md");
|
|
|
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(markdown))
|
|
|
|
{
|
2024-06-06 05:53:33 +02:00
|
|
|
markdownContent = Markdown.ToHtml(markdown, pipeline);
|
2024-06-06 05:19:14 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
isLoading = false;
|
|
|
|
}
|
|
|
|
}
|