mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-08-21 04:12:56 +00:00
Simplify Pandoc button text binding logic
This commit is contained in:
parent
bfcb012dec
commit
55e2911ad9
@ -28,19 +28,9 @@
|
|||||||
<MudButton Variant="Variant.Filled" Color="Color.Info" StartIcon="@Icons.Material.Filled.Update" OnClick="() => this.CheckForUpdate()">
|
<MudButton Variant="Variant.Filled" Color="Color.Info" StartIcon="@Icons.Material.Filled.Update" OnClick="() => this.CheckForUpdate()">
|
||||||
@T("Check for updates")
|
@T("Check for updates")
|
||||||
</MudButton>
|
</MudButton>
|
||||||
@if (this.pandocInstallation != default && !this.pandocInstallation.IsAvailable)
|
|
||||||
{
|
|
||||||
<MudButton Variant="Variant.Filled" Color="Color.Default" StartIcon="@Icons.Material.Filled.Download" OnClick="async () => await this.ShowPandocDialog()">
|
<MudButton Variant="Variant.Filled" Color="Color.Default" StartIcon="@Icons.Material.Filled.Download" OnClick="async () => await this.ShowPandocDialog()">
|
||||||
@if (string.IsNullOrWhiteSpace(this.pandocInstallation.Version))
|
@this.PandocButtonText
|
||||||
{
|
|
||||||
@T("Install Pandoc")
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
@T("Update Pandoc")
|
|
||||||
}
|
|
||||||
</MudButton>
|
</MudButton>
|
||||||
}
|
|
||||||
</MudStack>
|
</MudStack>
|
||||||
</ExpansionPanel>
|
</ExpansionPanel>
|
||||||
|
|
||||||
|
@ -95,15 +95,23 @@ public partial class About : MSGComponentBase
|
|||||||
this.StateHasChanged();
|
this.StateHasChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private string PandocButtonText
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.pandocInstallation switch
|
||||||
|
{
|
||||||
|
{ IsAvailable: true, CheckWasSuccessful: true } => this.T("Check Pandoc Installation"),
|
||||||
|
{ IsAvailable: false, CheckWasSuccessful: true } => this.T("Update Pandoc"),
|
||||||
|
|
||||||
|
_ => this.T("Install Pandoc")
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private async Task ShowPandocDialog()
|
private async Task ShowPandocDialog()
|
||||||
{
|
{
|
||||||
var dialogParameters = new DialogParameters<PandocDialog>
|
await this.DialogService.ShowAsync<PandocDialog>(T("Pandoc Installation"), DialogOptions.FULLSCREEN);
|
||||||
{
|
|
||||||
{ x => x.ShowInstallationPage, true },
|
|
||||||
{ x => x.ShowInitialResultInSnackbar, false },
|
|
||||||
};
|
|
||||||
|
|
||||||
await this.DialogService.ShowAsync<PandocDialog>(T("Pandoc Installation"), dialogParameters, DialogOptions.FULLSCREEN);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task CopyStartupLogPath()
|
private async Task CopyStartupLogPath()
|
||||||
|
Loading…
Reference in New Issue
Block a user