mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-05-22 21:32:16 +00:00
minor syntax styling fixes
This commit is contained in:
parent
d2981a3287
commit
96c2e8806f
@ -29,6 +29,7 @@ public sealed class AssistantAuditFinding
|
|||||||
AssistantAuditLevel.SAFE => "low",
|
AssistantAuditLevel.SAFE => "low",
|
||||||
_ => "unknown",
|
_ => "unknown",
|
||||||
};
|
};
|
||||||
|
|
||||||
init => this.Severity = value?.Trim().ToLowerInvariant() switch
|
init => this.Severity = value?.Trim().ToLowerInvariant() switch
|
||||||
{
|
{
|
||||||
"critical" => AssistantAuditLevel.DANGEROUS,
|
"critical" => AssistantAuditLevel.DANGEROUS,
|
||||||
|
|||||||
@ -96,6 +96,7 @@ else
|
|||||||
Style="@this.GetOptionalStyle(textArea.Style)" />
|
Style="@this.GetOptionalStyle(textArea.Style)" />
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case AssistantComponentType.IMAGE:
|
case AssistantComponentType.IMAGE:
|
||||||
if (component is AssistantImage assistantImage)
|
if (component is AssistantImage assistantImage)
|
||||||
{
|
{
|
||||||
@ -113,6 +114,7 @@ else
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case AssistantComponentType.WEB_CONTENT_READER:
|
case AssistantComponentType.WEB_CONTENT_READER:
|
||||||
if (component is AssistantWebContentReader webContent)
|
if (component is AssistantWebContentReader webContent)
|
||||||
{
|
{
|
||||||
@ -126,6 +128,7 @@ else
|
|||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case AssistantComponentType.FILE_CONTENT_READER:
|
case AssistantComponentType.FILE_CONTENT_READER:
|
||||||
if (component is AssistantFileContentReader fileContent)
|
if (component is AssistantFileContentReader fileContent)
|
||||||
{
|
{
|
||||||
@ -135,6 +138,7 @@ else
|
|||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case AssistantComponentType.DROPDOWN:
|
case AssistantComponentType.DROPDOWN:
|
||||||
if (component is AssistantDropdown assistantDropdown)
|
if (component is AssistantDropdown assistantDropdown)
|
||||||
{
|
{
|
||||||
@ -177,6 +181,7 @@ else
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case AssistantComponentType.BUTTON:
|
case AssistantComponentType.BUTTON:
|
||||||
if (component is AssistantButton assistantButton)
|
if (component is AssistantButton assistantButton)
|
||||||
{
|
{
|
||||||
@ -219,9 +224,9 @@ else
|
|||||||
Class="@buttonClass"
|
Class="@buttonClass"
|
||||||
Style="@style" />
|
Style="@style" />
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case AssistantComponentType.BUTTON_GROUP:
|
case AssistantComponentType.BUTTON_GROUP:
|
||||||
if (component is AssistantButtonGroup assistantButtonGroup)
|
if (component is AssistantButtonGroup assistantButtonGroup)
|
||||||
{
|
{
|
||||||
@ -238,6 +243,7 @@ else
|
|||||||
</MudButtonGroup>
|
</MudButtonGroup>
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case AssistantComponentType.LAYOUT_GRID:
|
case AssistantComponentType.LAYOUT_GRID:
|
||||||
if (component is AssistantGrid assistantGrid)
|
if (component is AssistantGrid assistantGrid)
|
||||||
{
|
{
|
||||||
@ -250,12 +256,14 @@ else
|
|||||||
</MudGrid>
|
</MudGrid>
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case AssistantComponentType.LAYOUT_ITEM:
|
case AssistantComponentType.LAYOUT_ITEM:
|
||||||
if (component is AssistantItem assistantItem)
|
if (component is AssistantItem assistantItem)
|
||||||
{
|
{
|
||||||
@this.RenderLayoutItem(assistantItem)
|
@this.RenderLayoutItem(assistantItem)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case AssistantComponentType.LAYOUT_PAPER:
|
case AssistantComponentType.LAYOUT_PAPER:
|
||||||
if (component is AssistantPaper assistantPaper)
|
if (component is AssistantPaper assistantPaper)
|
||||||
{
|
{
|
||||||
@ -269,6 +277,7 @@ else
|
|||||||
</MudPaper>
|
</MudPaper>
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case AssistantComponentType.LAYOUT_STACK:
|
case AssistantComponentType.LAYOUT_STACK:
|
||||||
if (component is AssistantStack assistantStack)
|
if (component is AssistantStack assistantStack)
|
||||||
{
|
{
|
||||||
@ -287,6 +296,7 @@ else
|
|||||||
</MudStack>
|
</MudStack>
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case AssistantComponentType.LAYOUT_ACCORDION:
|
case AssistantComponentType.LAYOUT_ACCORDION:
|
||||||
if (component is AssistantAccordion assistantAccordion)
|
if (component is AssistantAccordion assistantAccordion)
|
||||||
{
|
{
|
||||||
@ -303,6 +313,7 @@ else
|
|||||||
</MudExpansionPanels>
|
</MudExpansionPanels>
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case AssistantComponentType.LAYOUT_ACCORDION_SECTION:
|
case AssistantComponentType.LAYOUT_ACCORDION_SECTION:
|
||||||
if (component is AssistantAccordionSection assistantAccordionSection)
|
if (component is AssistantAccordionSection assistantAccordionSection)
|
||||||
{
|
{
|
||||||
@ -334,6 +345,7 @@ else
|
|||||||
</MudExpansionPanel>
|
</MudExpansionPanel>
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case AssistantComponentType.PROVIDER_SELECTION:
|
case AssistantComponentType.PROVIDER_SELECTION:
|
||||||
if (component is AssistantProviderSelection providerSelection)
|
if (component is AssistantProviderSelection providerSelection)
|
||||||
{
|
{
|
||||||
@ -342,6 +354,7 @@ else
|
|||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case AssistantComponentType.PROFILE_SELECTION:
|
case AssistantComponentType.PROFILE_SELECTION:
|
||||||
if (component is AssistantProfileSelection profileSelection)
|
if (component is AssistantProfileSelection profileSelection)
|
||||||
{
|
{
|
||||||
@ -351,6 +364,7 @@ else
|
|||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case AssistantComponentType.SWITCH:
|
case AssistantComponentType.SWITCH:
|
||||||
if (component is AssistantSwitch switchComponent)
|
if (component is AssistantSwitch switchComponent)
|
||||||
{
|
{
|
||||||
@ -368,27 +382,23 @@ else
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case AssistantComponentType.HEADING:
|
case AssistantComponentType.HEADING:
|
||||||
if (component is AssistantHeading assistantHeading)
|
if (component is AssistantHeading assistantHeading)
|
||||||
{
|
{
|
||||||
var heading = assistantHeading;
|
var heading = assistantHeading;
|
||||||
@switch (assistantHeading.Level)
|
var typo = heading.Level switch
|
||||||
{
|
{
|
||||||
case 1:
|
1 => Typo.h4,
|
||||||
<MudText Typo="Typo.h4" Class="@heading.Class" Style="@this.GetOptionalStyle(heading.Style)">@heading.Text</MudText>
|
2 => Typo.h5,
|
||||||
break;
|
3 => Typo.h6,
|
||||||
case 2:
|
_ => Typo.h5
|
||||||
<MudText Typo="Typo.h5" Class="@heading.Class" Style="@this.GetOptionalStyle(heading.Style)">@heading.Text</MudText>
|
};
|
||||||
break;
|
|
||||||
case 3:
|
<MudText Typo="@typo" Class="@heading.Class" Style="@this.GetOptionalStyle(heading.Style)">@heading.Text</MudText>
|
||||||
<MudText Typo="Typo.h6" Class="@heading.Class" Style="@this.GetOptionalStyle(heading.Style)">@heading.Text</MudText>
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
<MudText Typo="Typo.h4" Class="@heading.Class" Style="@this.GetOptionalStyle(heading.Style)">@heading.Text</MudText>
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case AssistantComponentType.TEXT:
|
case AssistantComponentType.TEXT:
|
||||||
if (component is AssistantText assistantText)
|
if (component is AssistantText assistantText)
|
||||||
{
|
{
|
||||||
@ -396,6 +406,7 @@ else
|
|||||||
<MudText Typo="Typo.body1" Class='@MergeClass(text.Class, "mb-3")' Style="@this.GetOptionalStyle(text.Style)">@text.Content</MudText>
|
<MudText Typo="Typo.body1" Class='@MergeClass(text.Class, "mb-3")' Style="@this.GetOptionalStyle(text.Style)">@text.Content</MudText>
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case AssistantComponentType.LIST:
|
case AssistantComponentType.LIST:
|
||||||
if (component is AssistantList assistantList)
|
if (component is AssistantList assistantList)
|
||||||
{
|
{
|
||||||
@ -418,6 +429,7 @@ else
|
|||||||
</MudList>
|
</MudList>
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case AssistantComponentType.COLOR_PICKER:
|
case AssistantComponentType.COLOR_PICKER:
|
||||||
if (component is AssistantColorPicker assistantColorPicker)
|
if (component is AssistantColorPicker assistantColorPicker)
|
||||||
{
|
{
|
||||||
@ -441,6 +453,7 @@ else
|
|||||||
</MudItem>
|
</MudItem>
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case AssistantComponentType.DATE_PICKER:
|
case AssistantComponentType.DATE_PICKER:
|
||||||
if (component is AssistantDatePicker assistantDatePicker)
|
if (component is AssistantDatePicker assistantDatePicker)
|
||||||
{
|
{
|
||||||
@ -464,6 +477,7 @@ else
|
|||||||
</MudPaper>
|
</MudPaper>
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case AssistantComponentType.DATE_RANGE_PICKER:
|
case AssistantComponentType.DATE_RANGE_PICKER:
|
||||||
if (component is AssistantDateRangePicker assistantDateRangePicker)
|
if (component is AssistantDateRangePicker assistantDateRangePicker)
|
||||||
{
|
{
|
||||||
@ -488,6 +502,7 @@ else
|
|||||||
</MudPaper>
|
</MudPaper>
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case AssistantComponentType.TIME_PICKER:
|
case AssistantComponentType.TIME_PICKER:
|
||||||
if (component is AssistantTimePicker assistantTimePicker)
|
if (component is AssistantTimePicker assistantTimePicker)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -35,15 +35,6 @@ public partial class AssistantPluginSecurityCard : MSGComponentBase
|
|||||||
await base.OnInitializedAsync();
|
await base.OnInitializedAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override Task OnAfterRenderAsync(bool firstRender)
|
|
||||||
{
|
|
||||||
if (!firstRender)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
return base.OnAfterRenderAsync(firstRender);
|
|
||||||
}
|
|
||||||
|
|
||||||
private async Task OpenAuditDialogAsync()
|
private async Task OpenAuditDialogAsync()
|
||||||
{
|
{
|
||||||
if (this.Plugin is null)
|
if (this.Plugin is null)
|
||||||
|
|||||||
@ -10,43 +10,62 @@ namespace AIStudio.Components
|
|||||||
{
|
{
|
||||||
public partial class DynamicAssistantDropdown : ComponentBase
|
public partial class DynamicAssistantDropdown : ComponentBase
|
||||||
{
|
{
|
||||||
[Parameter] public List<AssistantDropdownItem> Items { get; set; } = new();
|
[Parameter]
|
||||||
|
public List<AssistantDropdownItem> Items { get; set; } = new();
|
||||||
|
|
||||||
[Parameter] public AssistantDropdownItem Default { get; set; } = new();
|
[Parameter]
|
||||||
|
public AssistantDropdownItem Default { get; set; } = new();
|
||||||
|
|
||||||
[Parameter] public string Value { get; set; } = string.Empty;
|
[Parameter]
|
||||||
|
public string Value { get; set; } = string.Empty;
|
||||||
|
|
||||||
[Parameter] public EventCallback<string> ValueChanged { get; set; }
|
[Parameter]
|
||||||
|
public EventCallback<string> ValueChanged { get; set; }
|
||||||
|
|
||||||
[Parameter] public HashSet<string> SelectedValues { get; set; } = [];
|
[Parameter]
|
||||||
|
public HashSet<string> SelectedValues { get; set; } = [];
|
||||||
|
|
||||||
[Parameter] public EventCallback<HashSet<string>> SelectedValuesChanged { get; set; }
|
[Parameter]
|
||||||
|
public EventCallback<HashSet<string>> SelectedValuesChanged { get; set; }
|
||||||
|
|
||||||
[Parameter] public string Label { get; set; } = string.Empty;
|
[Parameter]
|
||||||
|
public string Label { get; set; } = string.Empty;
|
||||||
|
|
||||||
[Parameter] public string HelperText { get; set; } = string.Empty;
|
[Parameter]
|
||||||
|
public string HelperText { get; set; } = string.Empty;
|
||||||
|
|
||||||
[Parameter] public Func<string, string?> ValidateSelection { get; set; } = _ => null;
|
[Parameter]
|
||||||
|
public Func<string, string?> ValidateSelection { get; set; } = _ => null;
|
||||||
|
|
||||||
[Parameter] public string OpenIcon { get; set; } = Icons.Material.Filled.ArrowDropDown;
|
[Parameter]
|
||||||
|
public string OpenIcon { get; set; } = Icons.Material.Filled.ArrowDropDown;
|
||||||
|
|
||||||
[Parameter] public string CloseIcon { get; set; } = Icons.Material.Filled.ArrowDropUp;
|
[Parameter]
|
||||||
|
public string CloseIcon { get; set; } = Icons.Material.Filled.ArrowDropUp;
|
||||||
|
|
||||||
[Parameter] public Color IconColor { get; set; } = Color.Default;
|
[Parameter]
|
||||||
|
public Color IconColor { get; set; } = Color.Default;
|
||||||
|
|
||||||
[Parameter] public Adornment IconPosition { get; set; } = Adornment.End;
|
[Parameter]
|
||||||
|
public Adornment IconPosition { get; set; } = Adornment.End;
|
||||||
|
|
||||||
[Parameter] public Variant Variant { get; set; } = Variant.Outlined;
|
[Parameter]
|
||||||
|
public Variant Variant { get; set; } = Variant.Outlined;
|
||||||
|
|
||||||
[Parameter] public bool IsMultiselect { get; set; }
|
[Parameter]
|
||||||
|
public bool IsMultiselect { get; set; }
|
||||||
|
|
||||||
[Parameter] public bool HasSelectAll { get; set; }
|
[Parameter]
|
||||||
|
public bool HasSelectAll { get; set; }
|
||||||
|
|
||||||
[Parameter] public string SelectAllText { get; set; } = string.Empty;
|
[Parameter]
|
||||||
|
public string SelectAllText { get; set; } = string.Empty;
|
||||||
|
|
||||||
[Parameter] public string Class { get; set; } = string.Empty;
|
[Parameter]
|
||||||
|
public string Class { get; set; } = string.Empty;
|
||||||
|
|
||||||
[Parameter] public string Style { get; set; } = string.Empty;
|
[Parameter]
|
||||||
|
public string Style { get; set; } = string.Empty;
|
||||||
|
|
||||||
private async Task OnValueChanged(string newValue)
|
private async Task OnValueChanged(string newValue)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -496,5 +496,4 @@ public partial class AssistantPluginAuditDialog : MSGComponentBase
|
|||||||
var gigabyte = megabyte / BYTES_PER_KILOBYTE;
|
var gigabyte = megabyte / BYTES_PER_KILOBYTE;
|
||||||
return string.Format(this.currentCultureInfo, TB("{0:0.##} GB"), gigabyte);
|
return string.Format(this.currentCultureInfo, TB("{0:0.##} GB"), gigabyte);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user