2026-07-15 21:00:25 +02:00
@inherits MSGComponentBase
<MudDialog DefaultFocus="DefaultFocus.None">
<DialogContent>
<MudStack Spacing="3">
@if (!string.IsNullOrWhiteSpace(this.issue))
{
<MudAlert Severity="Severity.Error" Dense="true">
@this.issue
</MudAlert>
}
@if (this.isLoading)
{
<MudProgressLinear Indeterminate="true" Color="Color.Primary" />
}
else if (this.assistantPlugin is not null)
{
<MudText Typo="Typo.h6">@this.assistantPlugin.AssistantTitle</MudText>
<MudText Typo="Typo.body2" Class="mud-text-secondary">@T("Describe what should change after trying the assistant. AI Studio will revise the installed plugin while keeping the same assistant ID.")</MudText>
<MudTextField T="string"
@bind-Text="@this.changeRequest"
Label="@T("Requested changes")"
Placeholder="@T("Add a field for the target audience and make the final answer shorter.")"
Variant="Variant.Outlined"
Lines="5"
2026-10-31 10:48:20 +01:00
Sizing="InputSizing.Auto"
2026-07-15 21:00:25 +02:00
MaxLines="12"
Immediate="true"
Disabled="@(this.isGenerating || this.isApplying)" />
<CascadingValue Value="Components.META_ASSISTANT">
<ProviderSelection @bind-ProviderSettings="@this.providerSettings" ValidateProvider="@this.ValidatingProvider" Disabled="@(this.isGenerating || this.isApplying)" />
</CascadingValue>
<MudButton Variant="Variant.Filled"
Color="Color.Primary"
StartIcon="@Icons.Material.Filled.AutoFixHigh"
Disabled="@(!this.CanGenerate)"
OnClick="@(async () => await this.GenerateRevisionAsync())">
@if (this.isGenerating)
{
@T("Creating revision...")
}
else
{
@T("Create revision")
}
</MudButton>
@if (this.isGenerating)
{
<MudProgressLinear Indeterminate="true" Color="Color.Primary" />
}
@if (this.revisionCheckResult?.Success is true)
{
<MudAlert Severity="Severity.Success" Dense="true" Icon="@Icons.Material.Filled.CheckCircle">
@string.Format(T("The revised assistant '{0}' is valid and ready to update."), string.IsNullOrWhiteSpace(this.revisedPluginName) ? this.revisionCheckResult.PluginName : this.revisedPluginName)
</MudAlert>
}
@if (!string.IsNullOrWhiteSpace(this.revisedLua))
{
2026-10-25 18:52:39 +01:00
<CompactExpansionPanel HeaderText="@T("Revised Lua plugin")" HeaderIcon="@Icons.Material.Filled.Code" IconColor="Color.Primary">
<MudTextField T="string" Text="@this.revisedLua" ReadOnly="true" Variant="Variant.Outlined" Lines="18" Class="mt-2" Style="font-family: monospace" />
</CompactExpansionPanel>
2026-07-15 21:00:25 +02:00
}
@if (this.isApplying || this.isAuditing)
{
<MudProgressLinear Indeterminate="true" Color="Color.Primary" />
<MudText Typo="Typo.body2">
@(this.isAuditing ? T("Running security audit...") : T("Updating assistant..."))
</MudText>
}
}
</MudStack>
</DialogContent>
<DialogActions>
<MudButton OnClick="@this.Cancel" Disabled="@(this.isGenerating || this.isApplying || this.isAuditing)" Size="Size.Small">
@T("Cancel")
</MudButton>
<MudButton OnClick="@(async () => await this.ApplyRevisionAsync())"
Disabled="@(!this.CanApply)"
Color="Color.Primary"
Variant="Variant.Filled"
StartIcon="@Icons.Material.Filled.Save"
Size="Size.Small">
@T("Update assistant")
</MudButton>
</DialogActions>
</MudDialog>