-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLlmSettingsWindow.xaml
More file actions
143 lines (130 loc) · 8.13 KB
/
LlmSettingsWindow.xaml
File metadata and controls
143 lines (130 loc) · 8.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<Window x:Class="TimeTask.LlmSettingsWindow"
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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:TimeTask"
mc:Ignorable="d"
Title="LLM Settings" Height="550" MaxHeight="600" Width="400"
WindowStartupLocation="CenterOwner" ResizeMode="NoResize" Background="#E5E5E5">
<Window.Resources>
<Style TargetType="TextBox">
<Setter Property="Padding" Value="3,2"/>
<Setter Property="BorderBrush" Value="#AAAAAA"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Background" Value="White"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="TextBox">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="3">
<ScrollViewer x:Name="PART_ContentHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="DialogButtonStyle" TargetType="Button">
<Setter Property="Width" Value="85"/>
<Setter Property="Height" Value="30"/>
<Setter Property="Background" Value="#DDDDDD"/>
<Setter Property="BorderBrush" Value="#AAAAAA"/>
<Setter Property="Foreground" Value="#333333"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="1"
CornerRadius="15">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#EEEEEE"/>
</Trigger>
</Style.Triggers>
</Style>
<Style TargetType="Label">
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Foreground" Value="#333333"/>
</Style>
</Window.Resources>
<ScrollViewer VerticalScrollBarVisibility="Auto">
<Grid Margin="15">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/> <!-- Row 0 -->
<RowDefinition Height="Auto"/> <!-- Row 1 -->
<RowDefinition Height="Auto"/> <!-- Row 2 -->
<RowDefinition Height="Auto"/> <!-- Row 3 -->
<RowDefinition Height="Auto"/> <!-- Row 4: LLM Request Timeout (New) -->
<RowDefinition Height="Auto"/> <!-- Row 5: Test Button (New) -->
<RowDefinition Height="Auto"/> <!-- Row 6: Test Result TextBlock (New) -->
<RowDefinition Height="Auto"/> <!-- Row 7: Separator (was Row 4) -->
<RowDefinition Height="Auto"/> <!-- Row 8: Team Task Sync TextBlock (was Row 5) -->
<RowDefinition Height="Auto"/> <!-- Row 9: StackPanel for Team Sync Settings (was Row 6) -->
<RowDefinition Height="*"/> <!-- Row 10: Spacer (was Row 7) -->
<RowDefinition Height="Auto"/> <!-- Row 11: Buttons (was Row 8) -->
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Label Grid.Row="0" Grid.Column="0" Content="API Key:" VerticalAlignment="Center" Margin="0,0,10,0"/>
<TextBox Grid.Row="0" Grid.Column="1" x:Name="ApiKeyTextBox" Margin="0,5"/>
<Label Grid.Row="1" Grid.Column="0" Content="API Base URL (Optional):" VerticalAlignment="Center" Margin="0,0,10,0"/>
<TextBox Grid.Row="1" Grid.Column="1" x:Name="ApiBaseUrlTextBox" Margin="0,5" ToolTip="Leave empty for OpenAI default. For other providers, specify their base URL."/>
<TextBlock Grid.Row="2" Grid.Column="1" Text="Example: https://api.openai.com/v1" FontStyle="Italic" Foreground="Gray" Margin="0,0,0,5"/>
<Label Grid.Row="3" Grid.Column="0" Content="Model Name:" VerticalAlignment="Center" Margin="0,0,10,0"/>
<TextBox Grid.Row="3" Grid.Column="1" x:Name="ModelNameTextBox" Margin="0,5" ToolTip="Default: gpt-3.5-turbo"/>
<!-- LLM Request Timeout Setting -->
<StackPanel Grid.Row="4" Grid.ColumnSpan="2" Orientation="Horizontal" Margin="0,5,0,5">
<Label Content="LLM Request Timeout (s):" Width="180" VerticalAlignment="Center"/>
<TextBox x:Name="TimeoutTextBox" Width="100" VerticalAlignment="Center"/>
</StackPanel>
<!-- New Test Button -->
<Button x:Name="TestLlmConnectionButton" Content="Test LLM Connection"
Grid.Row="5" Grid.Column="0" Grid.ColumnSpan="2"
HorizontalAlignment="Left" Margin="0,10,0,5"
Click="TestLlmConnectionButton_Click" Style="{StaticResource DialogButtonStyle}" Width="180"/>
<!-- New Test Result TextBlock -->
<TextBlock x:Name="TestResultTextBlock" Text="Test results will appear here..."
Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="2"
Margin="0,5,0,10" TextWrapping="Wrap" MinHeight="40"
Background="WhiteSmoke" VerticalAlignment="Top" Padding="5" Foreground="#333333"/>
<!-- Team Task Synchronization Settings -->
<Separator Grid.Row="7" Grid.ColumnSpan="2" Margin="0,10"/>
<TextBlock Grid.Row="8" Grid.ColumnSpan="2" Text="Team Task Synchronization" FontWeight="Bold" FontSize="14" Margin="0,0,0,5"/>
<StackPanel Grid.Row="9" Grid.ColumnSpan="2" Margin="10,0,10,10"> <!-- Adjusted margin for bottom spacing -->
<CheckBox Name="EnableTeamSyncCheckBox" Content="Enable Team Task Synchronization" Margin="0,5"/>
<StackPanel Name="TeamSyncDetailsPanel" Margin="10,0,0,0">
<TextBlock Text="Team Role:" Margin="0,5,0,0"/>
<ComboBox Name="TeamRoleComboBox" Margin="0,0,0,5"/>
<TextBlock Text="Database Host:" Margin="0,5,0,0"/>
<TextBox Name="DbHostTextBox" Margin="0,0,0,5"/>
<TextBlock Text="Database Port:" Margin="0,5,0,0"/>
<TextBox Name="DbPortTextBox" Margin="0,0,0,5"/>
<TextBlock Text="Database Name:" Margin="0,5,0,0"/>
<TextBox Name="DbNameTextBox" Margin="0,0,0,5"/>
<TextBlock Text="Database User:" Margin="0,5,0,0"/>
<TextBox Name="DbUserTextBox" Margin="0,0,0,5"/>
<TextBlock Text="Database Password:" Margin="0,5,0,0"/>
<PasswordBox Name="DbPasswordBox" Margin="0,0,0,5"/>
<TextBlock Text="Sync Interval (minutes):" Margin="0,5,0,0"/>
<TextBox Name="SyncIntervalTextBox" Margin="0,0,0,5"/>
</StackPanel>
</StackPanel>
<StackPanel Grid.Row="11" Grid.Column="0" Grid.ColumnSpan="2" Orientation="Horizontal" HorizontalAlignment="Right"> <!-- Changed Grid.Row to 11 -->
<Button x:Name="SaveButton" Content="Save" Margin="0,0,10,0" Click="SaveButton_Click" Style="{StaticResource DialogButtonStyle}"/>
<Button x:Name="CancelButton" Content="Cancel" IsCancel="True" Click="CancelButton_Click" Style="{StaticResource DialogButtonStyle}"/>
</StackPanel>
</Grid>
</ScrollViewer>
</Window>