52 lines
1.3 KiB
Plaintext
52 lines
1.3 KiB
Plaintext
@page "/"
|
|
@inject HttpClient Http
|
|
@using Markdig
|
|
|
|
<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>
|
|
|
|
@code {
|
|
private string markdownContent = string.Empty;
|
|
private bool isLoading = true;
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
{
|
|
var pipeline = new MarkdownPipelineBuilder()
|
|
.UseAdvancedExtensions()
|
|
.UseEmojiAndSmiley()
|
|
.Build();
|
|
|
|
try
|
|
{
|
|
var markdown = await Http.GetStringAsync("Dashboard.md");
|
|
|
|
if (!string.IsNullOrWhiteSpace(markdown))
|
|
{
|
|
markdownContent = Markdown.ToHtml(markdown, pipeline);
|
|
}
|
|
}
|
|
catch (HttpRequestException)
|
|
{
|
|
markdownContent = "Error loading dashboard content.";
|
|
}
|
|
|
|
isLoading = false;
|
|
}
|
|
} |