-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWorkProfileSetupWindow.xaml
More file actions
256 lines (244 loc) · 16.1 KB
/
Copy pathWorkProfileSetupWindow.xaml
File metadata and controls
256 lines (244 loc) · 16.1 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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
<Window x:Class="CodexChannelLauncher.WorkProfileSetupWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:shell="clr-namespace:System.Windows.Shell;assembly=PresentationFramework"
Title="Codex 多开器 · 工作空间配置"
Width="780"
Height="760"
MinWidth="720"
MinHeight="680"
WindowStartupLocation="CenterOwner"
WindowStyle="None"
ResizeMode="CanResize"
Background="Transparent"
UseLayoutRounding="True"
SnapsToDevicePixels="True"
SourceInitialized="Window_SourceInitialized">
<shell:WindowChrome.WindowChrome>
<shell:WindowChrome CaptionHeight="56"
ResizeBorderThickness="6"
GlassFrameThickness="0"
CornerRadius="18"
UseAeroCaptionButtons="False" />
</shell:WindowChrome.WindowChrome>
<Window.Resources>
<Style x:Key="FieldLabel" TargetType="TextBlock">
<Setter Property="Foreground" Value="{StaticResource TextPrimaryBrush}" />
<Setter Property="FontSize" Value="11" />
<Setter Property="FontWeight" Value="SemiBold" />
<Setter Property="Margin" Value="0,0,0,7" />
</Style>
<Style x:Key="SectionHeader" TargetType="TextBlock">
<Setter Property="Foreground" Value="{StaticResource AccentBrightBrush}" />
<Setter Property="FontSize" Value="11" />
<Setter Property="FontWeight" Value="Bold" />
<Setter Property="Margin" Value="0,0,0,3" />
</Style>
<Style x:Key="SectionDesc" TargetType="TextBlock">
<Setter Property="Foreground" Value="{StaticResource TextSecondaryBrush}" />
<Setter Property="FontSize" Value="10.5" />
<Setter Property="TextWrapping" Value="Wrap" />
<Setter Property="Margin" Value="0,0,0,12" />
</Style>
<Style x:Key="HintText" TargetType="TextBlock">
<Setter Property="Foreground" Value="{StaticResource TextSecondaryBrush}" />
<Setter Property="FontSize" Value="11" />
<Setter Property="TextWrapping" Value="Wrap" />
</Style>
<Style x:Key="SectionCard" TargetType="Border">
<Setter Property="CornerRadius" Value="13" />
<Setter Property="Background" Value="{StaticResource Surface1Brush}" />
<Setter Property="BorderBrush" Value="{StaticResource StrokeBrush}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Padding" Value="16,14" />
<Setter Property="Margin" Value="0,0,0,15" />
</Style>
</Window.Resources>
<Border CornerRadius="18" BorderBrush="{StaticResource StrokeBrush}" BorderThickness="1"
Background="{StaticResource WindowBackgroundBrush}">
<Grid ClipToBounds="True">
<Grid.Background>
<RadialGradientBrush Center="0.82,0.08" GradientOrigin="0.82,0.08" RadiusX="1.1" RadiusY="1.1">
<GradientStop Color="#1F130A" Offset="0" />
<GradientStop Color="#0E0B08" Offset="0.42" />
<GradientStop Color="#090A0C" Offset="1" />
</RadialGradientBrush>
</Grid.Background>
<Grid.RowDefinitions>
<RowDefinition Height="56" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderBrush="{StaticResource StrokeBrush}" BorderThickness="0,0,0,1">
<Grid Margin="20,0,14,0" Background="Transparent">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Border Width="27" Height="27" CornerRadius="9" VerticalAlignment="Center"
Background="{StaticResource AccentBrush}">
<TextBlock Text="✦" Foreground="#1A120A" FontSize="13"
HorizontalAlignment="Center" VerticalAlignment="Center" />
</Border>
<TextBlock Grid.Column="1" Text="工作空间配置" Margin="11,0,0,0"
VerticalAlignment="Center" FontWeight="Bold" FontSize="12"
Foreground="{StaticResource TextPrimaryBrush}" />
<Button Grid.Column="2" Style="{StaticResource WindowButton}" Content="×"
shell:WindowChrome.IsHitTestVisibleInChrome="True" Click="CloseButton_Click" />
</Grid>
</Border>
<Grid Grid.Row="1" Margin="34,25,34,28">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<StackPanel>
<TextBlock x:Name="HeadingText" Text="创建隔离工作空间"
FontFamily="Segoe UI Variable Display, Segoe UI" FontSize="24" FontWeight="SemiBold" />
<TextBlock x:Name="SummaryText"
Text="认证仅写入本机隔离目录;不会修改个人 Codex Home。"
Margin="0,7,0,0" Foreground="{StaticResource TextSecondaryBrush}" FontSize="12" />
</StackPanel>
<ScrollViewer Grid.Row="1" Margin="0,22,0,20" VerticalScrollBarVisibility="Auto">
<StackPanel Margin="0,0,10,0">
<Border x:Name="ProblemPanel" Visibility="Collapsed" Padding="13,10" Margin="0,0,0,14"
CornerRadius="12" Background="#26110D" BorderBrush="#6E3524" BorderThickness="1">
<TextBlock x:Name="ProblemText" Foreground="#F0A68F" TextWrapping="Wrap" FontSize="11" />
</Border>
<Grid x:Name="ModePanel" Margin="0,0,0,15">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="18" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<StackPanel>
<TextBlock Text="配置方式" Style="{StaticResource FieldLabel}" />
<ComboBox x:Name="ModeBox" Style="{StaticResource InputComboBox}"
SelectionChanged="ModeBox_SelectionChanged">
<ComboBoxItem Content="新建工作空间" Tag="Create" IsSelected="True" />
<ComboBoxItem Content="使用已有工作空间" Tag="Attach" />
</ComboBox>
</StackPanel>
<StackPanel Grid.Column="2">
<TextBlock Text="显示名" Style="{StaticResource FieldLabel}" />
<TextBox x:Name="DisplayNameBox" Style="{StaticResource InputTextBox}" Text="工作空间" />
</StackPanel>
</Grid>
<Border x:Name="AuthenticationPanel" Style="{StaticResource SectionCard}">
<StackPanel>
<TextBlock Text="认证" Style="{StaticResource SectionHeader}" />
<TextBlock Style="{StaticResource SectionDesc}"
Text="选择该工作空间连接 Codex 的凭据来源;凭据只保存在此隔离目录内。" />
<TextBlock Text="认证方式" Style="{StaticResource FieldLabel}" />
<ComboBox x:Name="AuthModeBox" Style="{StaticResource InputComboBox}"
SelectionChanged="AuthModeBox_SelectionChanged">
<ComboBoxItem Content="ChatGPT 账号" Tag="ChatGptAccount" IsSelected="True" />
<ComboBoxItem Content="OpenAI API Key" Tag="OpenAiApiKey" />
<ComboBoxItem Content="自定义 Responses 服务" Tag="CustomResponses" />
</ComboBox>
</StackPanel>
</Border>
<Border x:Name="AttachPanel" Visibility="Collapsed"
Style="{StaticResource SectionCard}" Margin="0,0,0,15">
<StackPanel>
<TextBlock Text="接入已有工作空间" Style="{StaticResource SectionHeader}" />
<TextBlock Style="{StaticResource SectionDesc}"
Text="指向一个已存在的隔离目录,沿用其中的认证与设置。" />
<TextBlock Text="已有工作空间目录 / Codex Home" Style="{StaticResource FieldLabel}" />
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="12" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBox x:Name="ExistingPathBox" Style="{StaticResource InputTextBox}"
ToolTip="{Binding Text, RelativeSource={RelativeSource Self}}" />
<Button Grid.Column="2" Style="{StaticResource SecondaryButton}" Height="40"
Content="浏览…" Click="BrowseExistingButton_Click" />
</Grid>
<TextBlock Margin="0,9,0,0" Style="{StaticResource HintText}"
Text="原地接入,不复制任何配置、对话、数据库或界面状态。仅支持多开器本地 profiles 目录中保留的工作空间。" />
</StackPanel>
</Border>
<StackPanel x:Name="ProviderPanel">
<Border x:Name="CustomProviderPanel" Style="{StaticResource SectionCard}">
<StackPanel>
<TextBlock Text="自定义 Provider" Style="{StaticResource SectionHeader}" />
<TextBlock Style="{StaticResource SectionDesc}"
Text="连接兼容 Responses 接口的自建或第三方服务。" />
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="18" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<StackPanel>
<TextBlock Text="Provider ID" Style="{StaticResource FieldLabel}" />
<TextBox x:Name="ProviderIdBox" Style="{StaticResource InputTextBox}" Text="custom" />
</StackPanel>
<StackPanel Grid.Column="2">
<TextBlock Text="Provider 名称" Style="{StaticResource FieldLabel}" />
<TextBox x:Name="ProviderNameBox" Style="{StaticResource InputTextBox}" Text="Custom Provider" />
</StackPanel>
</Grid>
<StackPanel Margin="0,15,0,0">
<TextBlock Text="Base URL" Style="{StaticResource FieldLabel}" />
<TextBox x:Name="BaseUrlBox" Style="{StaticResource InputTextBox}"
ToolTip="必须使用 HTTPS;localhost 或回环地址可使用 HTTP。" />
</StackPanel>
</StackPanel>
</Border>
<Border x:Name="ModelSettingsPanel" Style="{StaticResource SectionCard}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="18" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<StackPanel>
<TextBlock Text="模型" Style="{StaticResource FieldLabel}" />
<TextBox x:Name="ModelBox" Style="{StaticResource InputTextBox}" />
</StackPanel>
<StackPanel Grid.Column="2">
<TextBlock Text="推理等级" Style="{StaticResource FieldLabel}" />
<ComboBox x:Name="ReasoningBox" Style="{StaticResource InputComboBox}" SelectedIndex="3">
<ComboBoxItem Content="minimal" />
<ComboBoxItem Content="low" />
<ComboBoxItem Content="medium" />
<ComboBoxItem Content="high" />
<ComboBoxItem Content="xhigh" />
</ComboBox>
</StackPanel>
</Grid>
</Border>
<Border x:Name="ApiKeyPanel" Style="{StaticResource SectionCard}">
<StackPanel>
<TextBlock Text="API Key" Style="{StaticResource FieldLabel}" />
<PasswordBox x:Name="ApiKeyBox" Style="{StaticResource InputPasswordBox}" />
<TextBlock x:Name="ApiKeyHintText"
Text="仅原子写入隔离 auth.json,不回显、不写日志、不进入快照。"
Margin="0,6,0,0" Foreground="{StaticResource TextSecondaryBrush}" FontSize="10.5" />
</StackPanel>
</Border>
</StackPanel>
</StackPanel>
</ScrollViewer>
<Grid Grid.Row="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="14" />
<ColumnDefinition Width="190" />
</Grid.ColumnDefinitions>
<TextBlock x:Name="FooterText" Text="配置保存在本机隔离目录"
Foreground="{StaticResource TextSecondaryBrush}" FontSize="10.5" VerticalAlignment="Center"
TextTrimming="CharacterEllipsis" />
<Button x:Name="SaveButton" Grid.Column="2" Style="{StaticResource PrimaryButton}"
Click="SaveButton_Click">
<TextBlock x:Name="SaveButtonText" Text="保存工作空间" Foreground="#1A120A" FontWeight="Bold" />
</Button>
</Grid>
</Grid>
</Grid>
</Border>
</Window>