Added changelog to the about and start pages

This commit is contained in:
Thorsten Sommer 2024-06-02 20:54:02 +02:00
parent b9f08578a0
commit 40a6e6c284
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108
3 changed files with 30 additions and 0 deletions

View File

@ -20,6 +20,10 @@
</MudList>
</ExpansionPanel>
<ExpansionPanel HeaderIcon="@Icons.Material.Filled.EventNote" HeaderText="Changelog">
<Changelog/>
</ExpansionPanel>
<ExpansionPanel HeaderIcon="@Icons.Material.Filled.Engineering" HeaderText="Motivation">
<Motivation/>
</ExpansionPanel>

View File

@ -25,6 +25,10 @@
</MudText>
</ExpansionPanel>
<ExpansionPanel HeaderIcon="@Icons.Material.Filled.EventNote" HeaderText="Last Changelog">
<MudMarkdown Value="@this.LastChangeContent" OverrideHeaderTypo="@Markdown.OverrideHeaderTypo"/>
</ExpansionPanel>
<ExpansionPanel HeaderIcon="@Icons.Material.Filled.Lightbulb" HeaderText="Vision">
<Vision/>
</ExpansionPanel>

View File

@ -6,6 +6,28 @@ namespace AIStudio.Components.Pages;
public partial class Home : ComponentBase
{
[Inject]
private HttpClient HttpClient { get; set; } = null!;
private string LastChangeContent { get; set; } = string.Empty;
#region Overrides of ComponentBase
protected override async Task OnInitializedAsync()
{
await this.ReadLastChangeAsync();
await base.OnInitializedAsync();
}
#endregion
private async Task ReadLastChangeAsync()
{
var latest = Changelog.LOGS.MaxBy(n => n.Build);
var response = await this.HttpClient.GetAsync($"changelog/{latest.Filename}");
this.LastChangeContent = await response.Content.ReadAsStringAsync();
}
private static readonly TextItem[] ITEMS_ADVANTAGES =
[
new TextItem("Free of charge", "The app is free to use, both for personal and commercial purposes."),