-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 初步添加 * update * 完成功能
- Loading branch information
Showing
36 changed files
with
1,933 additions
and
13 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
|
@@ -26,4 +26,9 @@ public enum InfoType | |
/// 成功消息. | ||
/// </summary> | ||
Success, | ||
|
||
/// <summary> | ||
/// 加载中. | ||
/// </summary> | ||
Loading, | ||
} |
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
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
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
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
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
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
34 changes: 34 additions & 0 deletions
34
src/Desktop/RodelAgent.UI/Controls/Internal/PromptTestExtraBody.xaml
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,34 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<local:PromptTestPageControlBase | ||
x:Class="RodelAgent.UI.Controls.Internal.PromptTestExtraBody" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:controls="using:RodelAgent.UI.Controls" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:ext="using:RodelAgent.UI.Extensions" | ||
xmlns:local="using:RodelAgent.UI.Controls.Internal" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:viewmodels="using:RodelAgent.UI.ViewModels" | ||
mc:Ignorable="d"> | ||
|
||
<Grid> | ||
<controls:EmptyHolder | ||
Title="{ext:Locale Name=ClickGenerate}" | ||
Description="{ext:Locale Name=ClickGenerateDescription}" | ||
Emoji="👋" | ||
Style="{StaticResource BasicEmptyHolderStyle}" | ||
Visibility="{x:Bind ViewModel.IsSessionsEmpty, Mode=OneWay}" /> | ||
<ScrollView Style="{StaticResource PageScrollViewStyle}" Visibility="{x:Bind ViewModel.IsSessionsEmpty, Mode=OneWay, Converter={StaticResource BoolToVisibilityReverseConverter}}"> | ||
<ItemsRepeater Margin="16,12" ItemsSource="{x:Bind ViewModel.Sessions, Mode=OneWay}"> | ||
<ItemsRepeater.ItemTemplate> | ||
<DataTemplate x:DataType="viewmodels:PromptTestSessionItemViewModel"> | ||
<local:PromptTestSessionItemControl ViewModel="{x:Bind}" /> | ||
</DataTemplate> | ||
</ItemsRepeater.ItemTemplate> | ||
<ItemsRepeater.Layout> | ||
<StackLayout Spacing="4" /> | ||
</ItemsRepeater.Layout> | ||
</ItemsRepeater> | ||
</ScrollView> | ||
</Grid> | ||
</local:PromptTestPageControlBase> |
14 changes: 14 additions & 0 deletions
14
src/Desktop/RodelAgent.UI/Controls/Internal/PromptTestExtraBody.xaml.cs
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,14 @@ | ||
// Copyright (c) Rodel. All rights reserved. | ||
|
||
namespace RodelAgent.UI.Controls.Internal; | ||
|
||
/// <summary> | ||
/// 提示词测试页面额外内容. | ||
/// </summary> | ||
public sealed partial class PromptTestExtraBody : PromptTestPageControlBase | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="PromptTestExtraBody"/> class. | ||
/// </summary> | ||
public PromptTestExtraBody() => InitializeComponent(); | ||
} |
39 changes: 39 additions & 0 deletions
39
src/Desktop/RodelAgent.UI/Controls/Internal/PromptTestExtraHeader.xaml
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,39 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<local:PromptTestPageControlBase | ||
x:Class="RodelAgent.UI.Controls.Internal.PromptTestExtraHeader" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:ext="using:RodelAgent.UI.Extensions" | ||
xmlns:ic="using:FluentIcons.WinUI" | ||
xmlns:local="using:RodelAgent.UI.Controls.Internal" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d"> | ||
|
||
<Grid Padding="16,0"> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition /> | ||
<ColumnDefinition Width="Auto" /> | ||
</Grid.ColumnDefinitions> | ||
<TextBlock | ||
HorizontalAlignment="Left" | ||
VerticalAlignment="Center" | ||
Style="{StaticResource BodyStrongTextBlockStyle}" | ||
Text="{ext:Locale Name=GenerateResult}" /> | ||
<Grid Grid.Column="1" Visibility="{x:Bind ViewModel.IsSessionsEmpty, Mode=OneWay, Converter={StaticResource BoolToVisibilityReverseConverter}}"> | ||
<HyperlinkButton | ||
VerticalAlignment="Center" | ||
Command="{x:Bind ViewModel.CancelGeneratingCommand}" | ||
Content="{ext:Locale Name=Cancel}" | ||
Visibility="{x:Bind ViewModel.IsGenerating, Mode=OneWay}" /> | ||
<Button | ||
VerticalAlignment="Center" | ||
Command="{x:Bind ViewModel.ExportResultCommand, Mode=OneWay}" | ||
Style="{StaticResource IconButtonStyle}" | ||
ToolTipService.ToolTip="{ext:Locale Name=Export}" | ||
Visibility="{x:Bind ViewModel.IsFinished, Mode=OneWay}"> | ||
<ic:SymbolIcon FontSize="14" Symbol="Share" /> | ||
</Button> | ||
</Grid> | ||
</Grid> | ||
</local:PromptTestPageControlBase> |
14 changes: 14 additions & 0 deletions
14
src/Desktop/RodelAgent.UI/Controls/Internal/PromptTestExtraHeader.xaml.cs
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,14 @@ | ||
// Copyright (c) Rodel. All rights reserved. | ||
|
||
namespace RodelAgent.UI.Controls.Internal; | ||
|
||
/// <summary> | ||
/// 提示词测试页面额外标题. | ||
/// </summary> | ||
public sealed partial class PromptTestExtraHeader : PromptTestPageControlBase | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="PromptTestExtraHeader"/> class. | ||
/// </summary> | ||
public PromptTestExtraHeader() => InitializeComponent(); | ||
} |
133 changes: 133 additions & 0 deletions
133
src/Desktop/RodelAgent.UI/Controls/Internal/PromptTestMainBody.xaml
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,133 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<local:PromptTestPageControlBase | ||
x:Class="RodelAgent.UI.Controls.Internal.PromptTestMainBody" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:base="using:Richasy.WinUI.Share.Base" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:ext="using:RodelAgent.UI.Extensions" | ||
xmlns:items="using:RodelAgent.UI.ViewModels.Items" | ||
xmlns:local="using:RodelAgent.UI.Controls.Internal" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d"> | ||
|
||
<Grid> | ||
<Grid.RowDefinitions> | ||
<RowDefinition /> | ||
<RowDefinition Height="Auto" /> | ||
<RowDefinition Height="Auto" /> | ||
<RowDefinition Height="Auto" /> | ||
<RowDefinition Height="Auto" /> | ||
</Grid.RowDefinitions> | ||
<TextBox | ||
Padding="18,12" | ||
HorizontalAlignment="Stretch" | ||
VerticalAlignment="Stretch" | ||
AcceptsReturn="True" | ||
FontSize="18" | ||
IsEnabled="{x:Bind ViewModel.IsGenerating, Mode=OneWay, Converter={StaticResource ObjectToBoolReverseConverter}}" | ||
Style="{StaticResource TransparentTextBoxStyle}" | ||
Text="{x:Bind ViewModel.CurrentSystemPrompt.Content, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" | ||
TextWrapping="Wrap" /> | ||
<Border | ||
Grid.Row="1" | ||
Height="1" | ||
HorizontalAlignment="Stretch" | ||
Background="{ThemeResource DividerStrokeColorDefaultBrush}" /> | ||
<TextBox | ||
Grid.Row="2" | ||
Padding="18,12" | ||
HorizontalAlignment="Stretch" | ||
VerticalAlignment="Stretch" | ||
AcceptsReturn="True" | ||
FontSize="18" | ||
IsEnabled="{x:Bind ViewModel.IsGenerating, Mode=OneWay, Converter={StaticResource ObjectToBoolReverseConverter}}" | ||
LostFocus="OnTextBoxLostFocus" | ||
Style="{StaticResource TransparentTextBoxStyle}" | ||
Text="{x:Bind ViewModel.UserPromptTemplate, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" | ||
TextWrapping="Wrap" /> | ||
<Border | ||
Grid.Row="3" | ||
Height="1" | ||
HorizontalAlignment="Stretch" | ||
Background="{ThemeResource DividerStrokeColorDefaultBrush}" /> | ||
<Grid Grid.Row="4" Padding="16,8"> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition /> | ||
<ColumnDefinition Width="Auto" /> | ||
</Grid.ColumnDefinitions> | ||
<Button | ||
HorizontalAlignment="Left" | ||
VerticalAlignment="Center" | ||
Content="{ext:Locale Name=Variables}" | ||
IsEnabled="{x:Bind ViewModel.IsGenerating, Mode=OneWay, Converter={StaticResource ObjectToBoolReverseConverter}}" | ||
Visibility="{x:Bind ViewModel.IsVariableEmpty, Mode=OneWay, Converter={StaticResource BoolToVisibilityReverseConverter}}"> | ||
<Button.Flyout> | ||
<Flyout Placement="Top" ShouldConstrainToRootBounds="False"> | ||
<Grid Width="380"> | ||
<ItemsRepeater ItemsSource="{x:Bind ViewModel.Variables}"> | ||
<ItemsRepeater.ItemTemplate> | ||
<DataTemplate x:DataType="items:VariableItemViewModel"> | ||
<Grid> | ||
<ComboBox | ||
x:Name="ValuesComboBox" | ||
HorizontalAlignment="Stretch" | ||
x:Load="{x:Bind Values, Mode=OneWay, Converter={StaticResource ObjectToBoolConverter}}" | ||
Header="{x:Bind Name}" | ||
ItemsSource="{x:Bind Values}" | ||
SelectedItem="{x:Bind Value, Mode=TwoWay}" | ||
Visibility="{x:Bind Values, Converter={StaticResource ObjectToVisibilityConverter}}"> | ||
<ComboBox.ItemTemplate> | ||
<DataTemplate x:DataType="x:String"> | ||
<base:TrimTextBlock MaxLines="1" Text="{x:Bind}" /> | ||
</DataTemplate> | ||
</ComboBox.ItemTemplate> | ||
</ComboBox> | ||
<TextBox | ||
x:Name="ValueBox" | ||
HorizontalAlignment="Stretch" | ||
x:Load="{x:Bind Values, Mode=OneWay, Converter={StaticResource ObjectToBoolReverseConverter}}" | ||
AcceptsReturn="True" | ||
Header="{x:Bind Name}" | ||
PlaceholderText="{x:Bind Name}" | ||
Text="{x:Bind Value, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" | ||
TextWrapping="Wrap" | ||
Visibility="{x:Bind Values, Converter={StaticResource ObjectToVisibilityReverseConverter}}" /> | ||
</Grid> | ||
</DataTemplate> | ||
</ItemsRepeater.ItemTemplate> | ||
<ItemsRepeater.Layout> | ||
<StackLayout Spacing="8" /> | ||
</ItemsRepeater.Layout> | ||
</ItemsRepeater> | ||
</Grid> | ||
</Flyout> | ||
</Button.Flyout> | ||
</Button> | ||
<Button | ||
Grid.Column="1" | ||
MinWidth="120" | ||
VerticalAlignment="Center" | ||
Command="{x:Bind ViewModel.GenerateCommand}" | ||
Content="{ext:Locale Name=Generate}" | ||
Style="{StaticResource AccentButtonStyle}" | ||
Visibility="{x:Bind ViewModel.IsGenerating, Mode=OneWay, Converter={StaticResource BoolToVisibilityReverseConverter}}" /> | ||
<Button | ||
Grid.Column="1" | ||
MinWidth="120" | ||
VerticalAlignment="Center" | ||
Command="{x:Bind ViewModel.CancelGeneratingCommand, Mode=OneWay}" | ||
Style="{StaticResource AccentButtonStyle}" | ||
Visibility="{x:Bind ViewModel.IsGenerating, Mode=OneWay}"> | ||
<StackPanel Orientation="Horizontal" Spacing="8"> | ||
<ProgressRing | ||
Width="16" | ||
Height="16" | ||
VerticalAlignment="Center" | ||
Foreground="{ThemeResource TextOnAccentFillColorPrimaryBrush}" /> | ||
<TextBlock VerticalAlignment="Center" Text="{ext:Locale Name=Cancel}" /> | ||
</StackPanel> | ||
</Button> | ||
</Grid> | ||
</Grid> | ||
</local:PromptTestPageControlBase> |
Oops, something went wrong.