mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-05-13 14:44:15 +00:00
added skeletens to indicate running audit
This commit is contained in:
parent
6933a19df7
commit
d094f38dc7
@ -48,7 +48,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</TitleContent>
|
</TitleContent>
|
||||||
<ChildContent>
|
<ChildContent>
|
||||||
<MudAlert Severity="Severity.Info"></MudAlert>
|
|
||||||
@{
|
@{
|
||||||
var promptBuilder = this.plugin.HasCustomPromptBuilder;
|
var promptBuilder = this.plugin.HasCustomPromptBuilder;
|
||||||
var sortDirection = promptBuilder ? SortDirection.Ascending : SortDirection.Descending;
|
var sortDirection = promptBuilder ? SortDirection.Ascending : SortDirection.Descending;
|
||||||
@ -220,38 +219,81 @@
|
|||||||
<MudStack Spacing="2">
|
<MudStack Spacing="2">
|
||||||
@foreach (var finding in this.audit.Findings)
|
@foreach (var finding in this.audit.Findings)
|
||||||
{
|
{
|
||||||
<MudAlert Severity="@this.GetFindingSeverity(finding.Severity)"
|
var severityUi = finding.Severity switch
|
||||||
Variant="Variant.Text"
|
{
|
||||||
Dense="true"
|
AssistantAuditLevel.UNKNOWN => (
|
||||||
Icon="@this.GetFindingIcon(finding.Severity)"
|
AlertStyling: "color: rgb(12,128,223); background-color: rgba(33,150,243,0.06);",
|
||||||
Class="pa-3"
|
AlertIcon: Icons.Material.Filled.QuestionMark,
|
||||||
Elevation="3">
|
ChipColor: Color.Info
|
||||||
<MudStack Spacing="1" Class="mt-n2">
|
),
|
||||||
|
AssistantAuditLevel.DANGEROUS => (
|
||||||
|
AlertStyling: "color: rgb(242,28,13); background-color: rgba(244,67,54,0.06);",
|
||||||
|
AlertIcon: Icons.Material.Filled.Dangerous,
|
||||||
|
ChipColor: Color.Error
|
||||||
|
),
|
||||||
|
AssistantAuditLevel.CAUTION => (
|
||||||
|
AlertStyling: "color: rgb(214,129,0); background-color: rgba(255,152,0,0.06);",
|
||||||
|
AlertIcon: Icons.Material.Filled.Warning,
|
||||||
|
ChipColor: Color.Warning
|
||||||
|
),
|
||||||
|
AssistantAuditLevel.SAFE => (
|
||||||
|
AlertStyling: "color: rgb(0,163,68); background-color: rgba(0,200,83,0.06);",
|
||||||
|
AlertIcon: Icons.Material.Filled.Verified,
|
||||||
|
ChipColor: Color.Success
|
||||||
|
),
|
||||||
|
_ => (
|
||||||
|
AlertStyling: "color: rgb(12,128,223); background-color: rgba(33,150,243,0.06);",
|
||||||
|
AlertIcon: Icons.Material.Filled.QuestionMark,
|
||||||
|
ChipColor: Color.Info
|
||||||
|
)
|
||||||
|
};
|
||||||
|
|
||||||
|
<MudCard Class="pa-1 mud-alert mud-alert-text-error" Elevation="3" Style="@severityUi.AlertStyling">
|
||||||
|
<MudCardContent>
|
||||||
|
<MudStack Row="true" AlignItems="AlignItems.Start" Justify="Justify.FlexStart">
|
||||||
|
<MudElement HtmlTag="div" Class="mt-1 me-1">
|
||||||
|
<MudIcon Icon="@severityUi.AlertIcon" Title="@finding.SeverityText" />
|
||||||
|
</MudElement>
|
||||||
|
<MudStack Spacing="1" Style="width: 100%">
|
||||||
<MudStack Row="true" AlignItems="AlignItems.Center" Justify="Justify.SpaceBetween">
|
<MudStack Row="true" AlignItems="AlignItems.Center" Justify="Justify.SpaceBetween">
|
||||||
<MudText Typo="Typo.subtitle2">@finding.Category</MudText>
|
<MudText Typo="Typo.subtitle2">@finding.Category</MudText>
|
||||||
<MudChip T="string"
|
<MudChip T="string" Variant="Variant.Text" Class="pt-n2" Size="Size.Small" Color="@severityUi.ChipColor">@finding.Severity.GetName()</MudChip>
|
||||||
Variant="Variant.Text"
|
|
||||||
Color="@this.GetFindingColor(finding.Severity)"
|
|
||||||
Size="Size.Small">
|
|
||||||
@finding.Severity.GetName()
|
|
||||||
</MudChip>
|
|
||||||
</MudStack>
|
</MudStack>
|
||||||
|
<MudText Typo="Typo.caption" Class="mt-n3 mb-3">@finding.Location</MudText>
|
||||||
|
<MudText Typo="Typo.body2" Class="mt-n2 mb-2">@finding.Description</MudText>
|
||||||
|
</MudStack>
|
||||||
|
</MudStack>
|
||||||
|
</MudCardContent>
|
||||||
|
</MudCard>
|
||||||
|
}
|
||||||
|
</MudStack>
|
||||||
|
}
|
||||||
|
</MudStack>
|
||||||
|
}
|
||||||
|
</MudStack>
|
||||||
|
}
|
||||||
|
|
||||||
@if (!string.IsNullOrEmpty(finding.Location))
|
@if (this.isAuditing)
|
||||||
{
|
{
|
||||||
<MudText Typo="Typo.caption">@finding.Location</MudText>
|
<MudCard Class="pa-1 mt-4" Elevation="3" Style="width: 100%">
|
||||||
|
<MudCardContent>
|
||||||
|
<MudStack Row="true" AlignItems="AlignItems.Start" Justify="Justify.FlexStart">
|
||||||
|
<MudElement HtmlTag="div" Class="mt-1 me-1">
|
||||||
|
<MudSkeleton SkeletonType="SkeletonType.Circle" Width="25px" Height="25px"/>
|
||||||
|
</MudElement>
|
||||||
|
<MudStack Spacing="1" Style="width: 100%">
|
||||||
|
<MudStack Row="true" AlignItems="AlignItems.Center" Justify="Justify.SpaceBetween">
|
||||||
|
<MudSkeleton SkeletonType="SkeletonType.Text" Width="50%"/>
|
||||||
|
<MudSkeleton SkeletonType="SkeletonType.Rectangle" Width="15%" Height="25px" Class="pt-n2" Style="border-radius: 15px"/>
|
||||||
|
</MudStack>
|
||||||
|
<MudSkeleton SkeletonType="SkeletonType.Text" Width="25%" Class="mt-n2 mb-2"/>
|
||||||
|
<MudSkeleton SkeletonType="SkeletonType.Rectangle" Width="100%" Height="30px"/>
|
||||||
|
</MudStack>
|
||||||
|
</MudStack>
|
||||||
|
</MudCardContent>
|
||||||
|
</MudCard>
|
||||||
}
|
}
|
||||||
|
|
||||||
<MudText Typo="Typo.body2">@finding.Description</MudText>
|
|
||||||
</MudStack>
|
|
||||||
</MudAlert>
|
|
||||||
}
|
|
||||||
</MudStack>
|
|
||||||
}
|
|
||||||
</MudStack>
|
|
||||||
}
|
|
||||||
</MudStack>
|
|
||||||
}
|
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
<DialogActions>
|
<DialogActions>
|
||||||
<MudButton OnClick="@this.CloseWithoutActivation" Variant="Variant.Filled">
|
<MudButton OnClick="@this.CloseWithoutActivation" Variant="Variant.Filled">
|
||||||
|
|||||||
@ -52,8 +52,7 @@ public partial class AssistantPluginAuditDialog : MSGComponentBase
|
|||||||
|
|
||||||
private string MinimumLevelLabel => this.MinimumLevel.GetName();
|
private string MinimumLevelLabel => this.MinimumLevel.GetName();
|
||||||
|
|
||||||
private bool CanRunAudit => this.plugin is not null && this.CurrentProvider != AIStudio.Settings.Provider.NONE &&
|
private bool CanRunAudit => this.plugin is not null && this.CurrentProvider != AIStudio.Settings.Provider.NONE && !this.isAuditing;
|
||||||
!this.isAuditing;
|
|
||||||
|
|
||||||
private bool IsAuditBelowMinimum => this.audit is not null && this.audit.Level < this.MinimumLevel;
|
private bool IsAuditBelowMinimum => this.audit is not null && this.audit.Level < this.MinimumLevel;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user