|
1 | 1 | <Page x:Class="Mikoto.SettingsPages.TranslatorPages.ChatGPTTransSettingsPage"
|
2 | 2 | xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
3 | 3 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
4 |
| - xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
| 4 | + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
5 | 5 | xmlns:hc="https://handyorg.github.io/handycontrol"
|
6 |
| - xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
| 6 | + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
7 | 7 | xmlns:local="clr-namespace:Mikoto.SettingsPages.TranslatorPages"
|
8 |
| - mc:Ignorable="d" |
9 |
| - d:DesignHeight="450" d:DesignWidth="594" |
| 8 | + mc:Ignorable="d" |
| 9 | + d:DesignHeight="450" |
| 10 | + d:DesignWidth="594" |
10 | 11 | Title="ChatGPTTransSettingsPage">
|
11 | 12 |
|
12 | 13 | <Grid>
|
13 | 14 | <hc:ScrollViewer HorizontalScrollBarVisibility="Disabled">
|
14 |
| - <StackPanel > |
15 |
| - <TextBlock Foreground="{DynamicResource PrimaryForeground}" Text="{DynamicResource ChatGPTTransSettingsPage_Introduce}" FontSize="16" Margin="10" TextWrapping="WrapWithOverflow"/> |
| 15 | + <StackPanel> |
| 16 | + <TextBlock Foreground="{DynamicResource PrimaryForeground}" |
| 17 | + Text="{DynamicResource ChatGPTTransSettingsPage_Introduce}" |
| 18 | + FontSize="16" |
| 19 | + Margin="10" |
| 20 | + TextWrapping="WrapWithOverflow" /> |
16 | 21 | <StackPanel Margin="20,20,20,0">
|
17 | 22 | <Grid Margin="0,10,0,0">
|
18 | 23 | <Grid.ColumnDefinitions>
|
19 |
| - <ColumnDefinition Width="*"/> |
20 |
| - <ColumnDefinition Width="Auto"/> |
| 24 | + <ColumnDefinition Width="*" /> |
| 25 | + <ColumnDefinition Width="Auto" /> |
21 | 26 | </Grid.ColumnDefinitions>
|
22 |
| - <Grid Grid.ColumnSpan="2"> |
23 |
| - <hc:TextBox hc:TitleElement.TitlePlacement="Left" hc:TitleElement.Title="{DynamicResource ChatGPTTransSettingsPage_secretKey}" Name="ChatGPTTransSecretKeyBox" hc:InfoElement.ShowClearButton="True" Margin="0,0,132,0"/> |
24 |
| - <!--Button Content="{DynamicResource API_authTestBtn}" Margin="432,0,0,0" Width="122" Click="AuthTestBtn_Click" HorizontalAlignment="Left" /--> |
25 |
| - </Grid> |
| 27 | + <hc:TextBox hc:TitleElement.TitlePlacement="Left" |
| 28 | + hc:TitleElement.Title="{DynamicResource ChatGPTTransSettingsPage_secretKey}" |
| 29 | + Name="ChatGPTTransSecretKeyBox" |
| 30 | + hc:InfoElement.ShowClearButton="True" /> |
26 | 31 | </Grid>
|
27 | 32 | <Grid Margin="0,10,0,0">
|
28 | 33 | <Grid.ColumnDefinitions>
|
29 |
| - <ColumnDefinition Width="*"/> |
30 |
| - <ColumnDefinition Width="Auto"/> |
| 34 | + <ColumnDefinition Width="*" /> |
| 35 | + <ColumnDefinition Width="Auto" /> |
31 | 36 | </Grid.ColumnDefinitions>
|
32 |
| - <Grid Grid.ColumnSpan="2"> |
33 |
| - <hc:TextBox hc:TitleElement.TitlePlacement="Left" hc:TitleElement.Title="{DynamicResource ChatGPTTransSettingsPage_apiUrl}" Name="ChatGPTTransUrlBox" hc:InfoElement.ShowClearButton="True" |
34 |
| - Text="https://api.openai.com/v1/chat/completions" Margin="0,0,132,0"/> |
35 |
| - <Button Content="{DynamicResource API_authTestBtn}" Margin="432,0,0,0" Width="122" Click="AuthTestBtn_Click" HorizontalAlignment="Left" /> |
36 |
| - </Grid> |
| 37 | + <hc:TextBox Grid.Column="0" |
| 38 | + hc:TitleElement.TitlePlacement="Left" |
| 39 | + hc:TitleElement.Title="{DynamicResource ChatGPTTransSettingsPage_apiUrl}" |
| 40 | + Name="ChatGPTTransUrlBox" |
| 41 | + hc:InfoElement.ShowClearButton="True" |
| 42 | + Text="https://api.openai.com/v1/chat/completions" /> |
37 | 43 | </Grid>
|
38 |
| - <hc:Divider/> |
39 |
| - <hc:TextBox hc:InfoElement.TitlePlacement="Left" hc:InfoElement.Title="{DynamicResource API_testSrcText}" Name="TestSrcText" hc:InfoElement.ShowClearButton="True" Text="{DynamicResource API_testCase}"/> |
40 | 44 | <Grid Margin="0,10,0,0">
|
41 | 45 | <Grid.ColumnDefinitions>
|
42 |
| - <ColumnDefinition Width="*"/> |
43 |
| - <ColumnDefinition Width="50"/> |
44 |
| - <ColumnDefinition Width="*"/> |
45 |
| - <ColumnDefinition Width="Auto"/> |
| 46 | + <ColumnDefinition Width="*" /> |
| 47 | + <ColumnDefinition Width="Auto" /> |
46 | 48 | </Grid.ColumnDefinitions>
|
47 |
| - <hc:TextBox hc:InfoElement.TitlePlacement="Left" hc:InfoElement.Title="{DynamicResource API_testSrcLang}" Name="TestSrcLang" hc:InfoElement.ShowClearButton="True" Text="ja" TextAlignment="Center"/> |
48 |
| - <hc:TextBox Grid.Column="2" hc:InfoElement.TitlePlacement="Left" hc:InfoElement.Title="{DynamicResource API_testDstLang}" Name="TestDstLang" hc:InfoElement.ShowClearButton="True" Text="zh" TextAlignment="Center"/> |
49 |
| - <Button Grid.Column="3" Content="{DynamicResource API_testTransBtn}" Margin="10,0,0,0" Width="122" Click="TransTestBtn_Click" ></Button> |
| 49 | + <hc:TextBox Grid.Column="0" |
| 50 | + hc:TitleElement.TitlePlacement="Left" |
| 51 | + hc:TitleElement.Title="{DynamicResource ChatGPTTransSettingsPage_apiModel}" |
| 52 | + Name="ChatGPTModelBox" |
| 53 | + hc:InfoElement.ShowClearButton="True" |
| 54 | + Text="gpt-3.5-turbo" /> |
| 55 | + <Button Grid.Column="1" |
| 56 | + Content="{DynamicResource API_authTestBtn}" |
| 57 | + Margin="10,0,0,0" |
| 58 | + Width="122" |
| 59 | + Click="AuthTestBtn_Click" /> |
50 | 60 | </Grid>
|
51 |
| - <StackPanel Margin="0,10,0,0" Orientation="Horizontal" HorizontalAlignment="Right"> |
52 |
| - <Button Content="{DynamicResource API_applyBtn}" Width="122" Click="ApplyBtn_Click" HorizontalAlignment="Left" /> |
53 |
| - <Button Content="{DynamicResource API_docBtn}" Margin="10,0,0,0" Width="225" Click="DocBtn_Click" HorizontalAlignment="Left" ></Button> |
54 |
| - <Button Content="{DynamicResource API_billBtn}" Margin="10,0,0,0" Width="122" Click="BillBtn_Click" HorizontalAlignment="Right" ></Button> |
| 61 | + |
| 62 | + <hc:Divider /> |
| 63 | + <hc:TextBox hc:InfoElement.TitlePlacement="Left" |
| 64 | + hc:InfoElement.Title="{DynamicResource API_testSrcText}" |
| 65 | + Name="TestSrcText" |
| 66 | + hc:InfoElement.ShowClearButton="True" |
| 67 | + Text="{DynamicResource API_testCase}" /> |
| 68 | + <Grid Margin="0,10,0,0"> |
| 69 | + <Grid.ColumnDefinitions> |
| 70 | + <ColumnDefinition Width="*" /> |
| 71 | + <ColumnDefinition Width="50" /> |
| 72 | + <ColumnDefinition Width="*" /> |
| 73 | + <ColumnDefinition Width="Auto" /> |
| 74 | + </Grid.ColumnDefinitions> |
| 75 | + <hc:TextBox hc:InfoElement.TitlePlacement="Left" |
| 76 | + hc:InfoElement.Title="{DynamicResource API_testSrcLang}" |
| 77 | + Name="TestSrcLang" |
| 78 | + hc:InfoElement.ShowClearButton="True" |
| 79 | + Text="ja" |
| 80 | + TextAlignment="Center" /> |
| 81 | + <hc:TextBox Grid.Column="2" |
| 82 | + hc:InfoElement.TitlePlacement="Left" |
| 83 | + hc:InfoElement.Title="{DynamicResource API_testDstLang}" |
| 84 | + Name="TestDstLang" |
| 85 | + hc:InfoElement.ShowClearButton="True" |
| 86 | + Text="zh" |
| 87 | + TextAlignment="Center" /> |
| 88 | + <Button Grid.Column="3" |
| 89 | + Content="{DynamicResource API_testTransBtn}" |
| 90 | + Margin="10,0,0,0" |
| 91 | + Width="122" |
| 92 | + Click="TransTestBtn_Click"></Button> |
| 93 | + </Grid> |
| 94 | + <StackPanel Margin="0,10,0,0" |
| 95 | + Orientation="Horizontal" |
| 96 | + HorizontalAlignment="Right"> |
| 97 | + <Button Content="{DynamicResource API_applyBtn}" |
| 98 | + Width="122" |
| 99 | + Click="ApplyBtn_Click" |
| 100 | + HorizontalAlignment="Left" /> |
| 101 | + <Button Content="{DynamicResource API_docBtn}" |
| 102 | + Margin="10,0,0,0" |
| 103 | + Width="225" |
| 104 | + Click="DocBtn_Click" |
| 105 | + HorizontalAlignment="Left"></Button> |
| 106 | + <Button Content="{DynamicResource API_billBtn}" |
| 107 | + Margin="10,0,0,0" |
| 108 | + Width="122" |
| 109 | + Click="BillBtn_Click" |
| 110 | + HorizontalAlignment="Right"></Button> |
55 | 111 | </StackPanel>
|
56 | 112 | </StackPanel>
|
57 | 113 | </StackPanel>
|
58 | 114 | </hc:ScrollViewer>
|
59 |
| - <StackPanel hc:Growl.GrowlParent="True" HorizontalAlignment="Right" Margin="15"/> |
| 115 | + <StackPanel hc:Growl.GrowlParent="True" |
| 116 | + HorizontalAlignment="Right" |
| 117 | + Margin="15" /> |
60 | 118 |
|
61 | 119 | </Grid>
|
62 | 120 | </Page>
|
0 commit comments