mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-03-29 23:31:40 +00:00
removed uneccessary method
This commit is contained in:
parent
dea9c9ed6f
commit
d05dd35d20
@ -67,7 +67,7 @@
|
|||||||
case AssistantComponentType.WEB_CONTENT_READER:
|
case AssistantComponentType.WEB_CONTENT_READER:
|
||||||
if (component is AssistantWebContentReader webContent && this.webContentFields.TryGetValue(webContent.Name, out var webState))
|
if (component is AssistantWebContentReader webContent && this.webContentFields.TryGetValue(webContent.Name, out var webState))
|
||||||
{
|
{
|
||||||
<div class="@webContent.Class" style="@webContent.Style">
|
<div class="@webContent.Class" style="@this.GetOptionalStyle(webContent.Style)">
|
||||||
<ReadWebContent @bind-Content="@webState.Content"
|
<ReadWebContent @bind-Content="@webState.Content"
|
||||||
ProviderSettings="@this.providerSettings"
|
ProviderSettings="@this.providerSettings"
|
||||||
@bind-AgentIsRunning="@webState.AgentIsRunning"
|
@bind-AgentIsRunning="@webState.AgentIsRunning"
|
||||||
@ -79,7 +79,7 @@
|
|||||||
case AssistantComponentType.FILE_CONTENT_READER:
|
case AssistantComponentType.FILE_CONTENT_READER:
|
||||||
if (component is AssistantFileContentReader fileContent && this.fileContentFields.TryGetValue(fileContent.Name, out var fileState))
|
if (component is AssistantFileContentReader fileContent && this.fileContentFields.TryGetValue(fileContent.Name, out var fileState))
|
||||||
{
|
{
|
||||||
<div class="@fileContent.Class" style="@fileContent.Style">
|
<div class="@fileContent.Class" style="@this.GetOptionalStyle(fileContent.Style)">
|
||||||
<ReadFileContent @bind-FileContent="@fileState.Content" />
|
<ReadFileContent @bind-FileContent="@fileState.Content" />
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
@ -207,7 +207,7 @@
|
|||||||
Wrap="@(AssistantComponentPropHelper.GetWrap(stack.Wrap) ?? Wrap.Wrap)"
|
Wrap="@(AssistantComponentPropHelper.GetWrap(stack.Wrap) ?? Wrap.Wrap)"
|
||||||
Spacing="@stack.Spacing"
|
Spacing="@stack.Spacing"
|
||||||
Class="@stack.Class"
|
Class="@stack.Class"
|
||||||
Style="@this.GetOptionalStyle(this.GetRawStyle(stack))">
|
Style="@this.GetOptionalStyle(stack.Style)">
|
||||||
@this.RenderChildren(stack.Children)
|
@this.RenderChildren(stack.Children)
|
||||||
</MudStack>
|
</MudStack>
|
||||||
}
|
}
|
||||||
@ -262,7 +262,7 @@
|
|||||||
case AssistantComponentType.PROVIDER_SELECTION:
|
case AssistantComponentType.PROVIDER_SELECTION:
|
||||||
if (component is AssistantProviderSelection providerSelection)
|
if (component is AssistantProviderSelection providerSelection)
|
||||||
{
|
{
|
||||||
<div class="@providerSelection.Class" style="@providerSelection.Style">
|
<div class="@providerSelection.Class" style="@this.GetOptionalStyle(providerSelection.Style)">
|
||||||
<ProviderSelection @bind-ProviderSettings="@this.providerSettings" ValidateProvider="@this.ValidatingProvider" />
|
<ProviderSelection @bind-ProviderSettings="@this.providerSettings" ValidateProvider="@this.ValidatingProvider" />
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
@ -271,7 +271,7 @@
|
|||||||
if (component is AssistantProfileSelection profileSelection)
|
if (component is AssistantProfileSelection profileSelection)
|
||||||
{
|
{
|
||||||
var selection = profileSelection;
|
var selection = profileSelection;
|
||||||
<div class="@selection.Class" style="@selection.Style">
|
<div class="@selection.Class" style="@this.GetOptionalStyle(selection.Style)">
|
||||||
<ProfileFormSelection Validation="@((Profile profile) => this.ValidateProfileSelection(selection, profile))" @bind-Profile="@this.currentProfile" />
|
<ProfileFormSelection Validation="@((Profile profile) => this.ValidateProfileSelection(selection, profile))" @bind-Profile="@this.currentProfile" />
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
@ -371,14 +371,6 @@
|
|||||||
}
|
}
|
||||||
</text>;
|
</text>;
|
||||||
|
|
||||||
private string? GetRawStyle(IAssistantComponent component)
|
|
||||||
{
|
|
||||||
if (!component.Props.TryGetValue("Style", out var rawStyle) || rawStyle is null)
|
|
||||||
return null;
|
|
||||||
|
|
||||||
return rawStyle as string ?? rawStyle.ToString();
|
|
||||||
}
|
|
||||||
|
|
||||||
private string? BuildPaperStyle(AssistantPaper paper)
|
private string? BuildPaperStyle(AssistantPaper paper)
|
||||||
{
|
{
|
||||||
List<string> styles = [];
|
List<string> styles = [];
|
||||||
@ -390,7 +382,7 @@
|
|||||||
this.AddStyle(styles, "max-width", paper.MaxWidth);
|
this.AddStyle(styles, "max-width", paper.MaxWidth);
|
||||||
this.AddStyle(styles, "min-width", paper.MinWidth);
|
this.AddStyle(styles, "min-width", paper.MinWidth);
|
||||||
|
|
||||||
var customStyle = this.GetRawStyle(paper);
|
var customStyle = paper.Style;
|
||||||
if (!string.IsNullOrWhiteSpace(customStyle))
|
if (!string.IsNullOrWhiteSpace(customStyle))
|
||||||
styles.Add(customStyle.Trim().TrimEnd(';'));
|
styles.Add(customStyle.Trim().TrimEnd(';'));
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user