forked from aliencube/azure-openai-sdk-proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move label component to slider and list
- Loading branch information
Showing
6 changed files
with
154 additions
and
119 deletions.
There are no files selected for viewing
30 changes: 0 additions & 30 deletions
30
src/AzureOpenAIProxy.PlaygroundApp/Components/UI/LabelWithTooltip.razor
This file was deleted.
Oops, something went wrong.
56 changes: 56 additions & 0 deletions
56
src/AzureOpenAIProxy.PlaygroundApp/Components/UI/ParameterListComponent.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
@inherits FluentComponentBase | ||
|
||
<div id="@Id"> | ||
<label id=@($"{Id}-label") for=@($"{Id}-content") | ||
style="display:inline-block;padding-left:5px;font-weight:bold;"> | ||
@LabelText | ||
|
||
@* Tooltip Image *@ | ||
<FluentIcon Id=@($"{Id}-anchor") Value="@(new Icons.Regular.Size12.Info())" /> | ||
<FluentTooltip Id=@($"{Id}-tooltip") | ||
Anchor=@($"{Id}-anchor") | ||
Position="TooltipPosition.End" | ||
UseTooltipService="false" | ||
MaxWidth="250px" | ||
Style="line-break:anywhere"> | ||
@TooltipText | ||
</FluentTooltip> | ||
</label> | ||
|
||
<div id=@($"{Id}-content")> | ||
<FluentAutocomplete TOption="string" Multiple="true" AutoComplete="false" | ||
ShowOverlayOnEmptyResults="false" | ||
SelectValueOnTab="true" | ||
MaximumOptionsSearch="1" | ||
@bind-SelectedOptions=stopSequenceValue | ||
OnOptionsSearch=OnSearchAsync | ||
Style="width:95%;padding:5px 0px;margin: 0 auto"> | ||
<OptionTemplate> | ||
<FluentLabel>Create "@(context)"</FluentLabel> | ||
</OptionTemplate> | ||
</FluentAutocomplete> | ||
</div> | ||
</div> | ||
|
||
@code { | ||
[Parameter, EditorRequired] | ||
public string LabelText { get; set; } = string.Empty; | ||
|
||
[Parameter, EditorRequired] | ||
public string TooltipText { get; set; } = string.Empty; | ||
|
||
private IEnumerable<string> stopSequenceValue = new List<string>(); | ||
private List<string> searchTextItems = new(); | ||
|
||
private Task OnSearchAsync(OptionsSearchEventArgs<string> e) | ||
{ | ||
searchTextItems.Clear(); | ||
if (string.IsNullOrEmpty(e.Text) || stopSequenceValue.Contains(e.Text)) | ||
return Task.CompletedTask; | ||
|
||
searchTextItems.Add(e.Text); | ||
e.Items = searchTextItems; | ||
|
||
return Task.CompletedTask; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/AzureOpenAIProxy.PlaygroundApp/Components/UI/ParameterSliderComponent.razor.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
::deep .parameter-label { | ||
display: inline-block; | ||
padding-left: 5px; | ||
font-weight: bold; | ||
font-size: 8px; | ||
} | ||
|
||
::deep .parameter-slider { | ||
width: 88%; | ||
padding-top: 15px; | ||
} | ||
|
||
::deep .parameter-textfield { | ||
width: 12%; | ||
font-size: 9px; | ||
padding-right: 5px; | ||
} | ||
|
||
::deep .parameter-error { | ||
padding: 10px; | ||
width: 95%; | ||
margin: 5px auto; | ||
border-color: crimson; | ||
background-color: lightcoral; | ||
color: black | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 0 additions & 9 deletions
9
src/AzureOpenAIProxy.PlaygroundApp/Components/UI/ParametersTabComponent.razor.css
This file was deleted.
Oops, something went wrong.