Add a progress indicator for Pandoc installation steps

This commit is contained in:
Thorsten Sommer 2025-05-30 17:09:21 +02:00
parent 3c0d2cd6fb
commit 393dd7ec6a
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108
2 changed files with 20 additions and 2 deletions

View File

@ -1,6 +1,13 @@
<MudDialog> <MudDialog>
<DialogContent> <DialogContent>
@if (this.ShowInstallationPage) @if (this.isInstallationInProgress)
{
<MudText Typo="Typo.h4" Class="mb-3">
Please wait for the installation to complete...
</MudText>
<MudProgressLinear Color="Color.Primary" Indeterminate="@true" Size="Size.Large" Rounded="@true"/>
}
else if (this.ShowInstallationPage)
{ {
<div class="mb-4"> <div class="mb-4">
<MudJustifiedText Typo="Typo.body1" Class="mb-2"> <MudJustifiedText Typo="Typo.body1" Class="mb-2">
@ -177,7 +184,13 @@
} }
</DialogContent> </DialogContent>
<DialogActions> <DialogActions>
@if (this.ShowInstallationPage) @if (this.isInstallationInProgress)
{
<MudButton OnClick="@this.Cancel" Variant="Variant.Filled">
Close
</MudButton>
}
else if (this.ShowInstallationPage)
{ {
<MudButton OnClick="@this.Cancel" Variant="Variant.Filled"> <MudButton OnClick="@this.Cancel" Variant="Variant.Filled">
Cancel Cancel

View File

@ -39,6 +39,7 @@ public partial class PandocDialog : ComponentBase
private PandocInstallation pandocInstallation; private PandocInstallation pandocInstallation;
private string? licenseText; private string? licenseText;
private bool isLoadingLicence; private bool isLoadingLicence;
private bool isInstallationInProgress;
private int selectedInstallerIndex = SelectInstallerIndex(); private int selectedInstallerIndex = SelectInstallerIndex();
private int selectedArchiveIndex = SelectArchiveIndex(); private int selectedArchiveIndex = SelectArchiveIndex();
private string downloadUrlArchive = string.Empty; private string downloadUrlArchive = string.Empty;
@ -66,8 +67,12 @@ public partial class PandocDialog : ComponentBase
private async Task InstallPandocAsync() private async Task InstallPandocAsync()
{ {
this.isInstallationInProgress = true;
this.StateHasChanged();
await Pandoc.InstallAsync(this.RustService); await Pandoc.InstallAsync(this.RustService);
this.isInstallationInProgress = false;
this.MudDialog.Close(DialogResult.Ok(true)); this.MudDialog.Close(DialogResult.Ok(true));
await this.DialogService.ShowAsync<PandocDialog>("Pandoc Installation", DialogOptions.FULLSCREEN); await this.DialogService.ShowAsync<PandocDialog>("Pandoc Installation", DialogOptions.FULLSCREEN);
} }