|
1 | 1 | @page "/general-settings" |
2 | 2 |
|
3 | | -<MudText Typo="Typo.h6" Class="mb-3">@(Lang["GeneralSettings"])</MudText> |
| 3 | +<MudText Typo="Typo.h6" Class="mb-4">@(Lang["GeneralSettings"])</MudText> |
4 | 4 |
|
5 | | -<MudCheckBox Value="@(_isAutostart)" |
6 | | - T="bool" |
7 | | - ValueChanged="AutostartChange" |
8 | | - Label="@(Lang["Autostart"])" |
9 | | - Color="Color.Primary" |
10 | | - Style="max-width: fit-content;" /> |
11 | | -<MudCheckBox @bind-Value="@(AppSettings.IsHideWindowWhenLaunch)" |
12 | | - @bind-Value:after="SaveSettings" |
13 | | - Label="@(Lang["HideWindowWhenLaunch"])" |
14 | | - Color="Color.Primary" |
15 | | - Style="max-width: fit-content;" /> |
16 | | -<MudCheckBox @bind-Value="@(AppSettings.IsHideWindowWhenEsc)" |
17 | | - @bind-Value:after="SaveSettings" |
18 | | - Label="@(Lang["HideWindowWhenEsc"])" |
19 | | - Color="Color.Primary" |
20 | | - Style="max-width: fit-content;" /> |
21 | | -<MudCheckBox @bind-Value="@(AppSettings.IsHideWindowWhenClose)" |
22 | | - @bind-Value:after="SaveSettings" |
23 | | - Label="@(Lang["HideWindowWhenClose"])" |
24 | | - Color="Color.Primary" |
25 | | - Style="max-width: fit-content;" /> |
| 5 | +<!-- 启动与窗口行为 --> |
| 6 | +<MudPaper Class="pa-4 mb-4" Elevation="5"> |
| 7 | + <MudText Class="group-title">@(Lang["General_Group_Startup"])</MudText> |
| 8 | + <MudStack Spacing="4"> |
| 9 | + <MudCheckBox Value="@(_isAutostart)" |
| 10 | + T="bool" |
| 11 | + ValueChanged="AutostartChange" |
| 12 | + Label="@(Lang["Autostart"])" |
| 13 | + Color="Color.Primary" |
| 14 | + Class="no-left-padding max-width-fix" |
| 15 | + Dense="true" /> |
| 16 | + <MudCheckBox @bind-Value="@(AppSettings.IsHideWindowWhenLaunch)" |
| 17 | + @bind-Value:after="SaveSettings" |
| 18 | + Label="@(Lang["HideWindowWhenLaunch"])" |
| 19 | + Color="Color.Primary" |
| 20 | + Class="no-left-padding max-width-fix" |
| 21 | + Dense="true" /> |
| 22 | + <MudCheckBox @bind-Value="@(AppSettings.IsHideWindowWhenEsc)" |
| 23 | + @bind-Value:after="SaveSettings" |
| 24 | + Label="@(Lang["HideWindowWhenEsc"])" |
| 25 | + Color="Color.Primary" |
| 26 | + Class="no-left-padding max-width-fix" |
| 27 | + Dense="true" /> |
| 28 | + <MudCheckBox @bind-Value="@(AppSettings.IsHideWindowWhenClose)" |
| 29 | + @bind-Value:after="SaveSettings" |
| 30 | + Label="@(Lang["HideWindowWhenClose"])" |
| 31 | + Color="Color.Primary" |
| 32 | + Class="no-left-padding max-width-fix" |
| 33 | + Dense="true" /> |
| 34 | + </MudStack> |
| 35 | +</MudPaper> |
26 | 36 |
|
27 | | -<div class="d-flex flex-column"> |
28 | | - <MudCheckBox T="bool" |
29 | | - Value="@(AppSettings.IsEnableSoftwareRendering)" |
30 | | - ValueChanged="SoftwareRenderingChange" |
31 | | - Label="@(Lang["EnableSoftwareRendering"])" |
32 | | - Color="Color.Primary" |
33 | | - Style="max-width: fit-content;" /> |
34 | | - <MudText Typo="Typo.caption" Color="Color.Secondary" Class="ml-12"> |
35 | | - @(Lang["EnableSoftwareRenderingRemark"]) |
36 | | - </MudText> |
37 | | -</div> |
| 37 | +<!-- 渲染与外观 --> |
| 38 | +<MudPaper Class="pa-4 mb-4" Elevation="5"> |
| 39 | + <MudText Class="group-title">@(Lang["General_Group_Appearance"])</MudText> |
| 40 | + <MudStack Spacing="4"> |
| 41 | + <div> |
| 42 | + <MudCheckBox T="bool" |
| 43 | + Value="@(AppSettings.IsEnableSoftwareRendering)" |
| 44 | + ValueChanged="SoftwareRenderingChange" |
| 45 | + Label="@(Lang["EnableSoftwareRendering"])" |
| 46 | + Color="Color.Primary" |
| 47 | + Size="Size.Small" |
| 48 | + Class="no-left-padding max-width-fix" |
| 49 | + Dense="true" /> |
| 50 | + <MudText Typo="Typo.caption" Class="input-tip ml-6"> |
| 51 | + @(Lang["EnableSoftwareRenderingRemark"]) |
| 52 | + </MudText> |
| 53 | + </div> |
38 | 54 |
|
39 | | -<MudSelect T="ThemeEnum" |
40 | | - Class="mt-4" |
41 | | - Dense="true" |
42 | | - Margin="Margin.Dense" |
43 | | - Label="@(Lang["Appearance"])" |
44 | | - Variant="Variant.Outlined" |
45 | | - Value="@(AppSettings.AppTheme)" |
46 | | - ValueChanged="ThemeChanged"> |
47 | | - <MudSelectItem Value="@(ThemeEnum.System)">@($"🌓 {Lang["SystemTheme"]}")</MudSelectItem> |
48 | | - <MudSelectItem Value="@(ThemeEnum.Light)">@($"☀️ {Lang["LightTheme"]}")</MudSelectItem> |
49 | | - <MudSelectItem Value="@(ThemeEnum.Dark)">@($"🌙 {Lang["DarkTheme"]}")</MudSelectItem> |
50 | | -</MudSelect> |
| 55 | + <div> |
| 56 | + <MudText Typo="Typo.subtitle2" Class="input-title">@(Lang["Appearance"])</MudText> |
| 57 | + <MudSelect T="ThemeEnum" |
| 58 | + Dense="true" |
| 59 | + Label="" |
| 60 | + Variant="Variant.Outlined" |
| 61 | + Value="@(AppSettings.AppTheme)" |
| 62 | + ValueChanged="ThemeChanged" |
| 63 | + Margin="Margin.Dense" |
| 64 | + Style="width:150px; max-width:150px;"> |
| 65 | + <MudSelectItem Value="@(ThemeEnum.System)">@($"🌓 {Lang["SystemTheme"]}")</MudSelectItem> |
| 66 | + <MudSelectItem Value="@(ThemeEnum.Light)">@($"☀️ {Lang["LightTheme"]}")</MudSelectItem> |
| 67 | + <MudSelectItem Value="@(ThemeEnum.Dark)">@($"🌙 {Lang["DarkTheme"]}")</MudSelectItem> |
| 68 | + </MudSelect> |
| 69 | + </div> |
| 70 | + <div> |
| 71 | + <MudText Typo="Typo.subtitle2" Class="input-title">@("语言 / Language")</MudText> |
| 72 | + <MudSelect T="string" |
| 73 | + Dense="true" |
| 74 | + Label="" |
| 75 | + Variant="Variant.Outlined" |
| 76 | + Value="@(AppSettings.Lang.ToString())" |
| 77 | + ValueChanged="LangValueChanged" |
| 78 | + Class="max-width-fix" |
| 79 | + Margin="Margin.Dense"> |
| 80 | + <MudSelectItem Value="@("zh")">中文</MudSelectItem> |
| 81 | + <MudSelectItem Value="@("en")">English</MudSelectItem> |
| 82 | + </MudSelect> |
| 83 | + </div> |
| 84 | + </MudStack> |
| 85 | +</MudPaper> |
51 | 86 |
|
52 | | -<MudSelect Class="mt-4" |
53 | | - T="string" |
54 | | - Variant="Variant.Outlined" |
55 | | - Dense="true" |
56 | | - Margin="Margin.Dense" |
57 | | - Label="语言 / Language" |
58 | | - Value="@(AppSettings.Lang.ToString())" |
59 | | - ValueChanged="LangValueChanged"> |
60 | | - <MudSelectItem Value="@("zh")">中文</MudSelectItem> |
61 | | - <MudSelectItem Value="@("en")">English</MudSelectItem> |
62 | | -</MudSelect> |
| 87 | +<!-- 日志管理 --> |
| 88 | +<MudPaper Class="pa-4 mb-4" Elevation="5"> |
| 89 | + <MudText Class="group-title">@($"{Lang["General_Group_Logs"]} {_logFilesSize / 1024 / 1024:N2} MB")</MudText> |
| 90 | + <MudStack Spacing="2"> |
| 91 | + @if (!_logLoadingOk) |
| 92 | + { |
| 93 | + <MudProgressCircular Color="Color.Info" Size="Size.Small" Indeterminate="true" Class="mt-2" /> |
| 94 | + } |
| 95 | + else |
| 96 | + { |
| 97 | + <MudStack Row="true" Spacing="2" AlignItems="AlignItems.Center"> |
| 98 | + <MudButton Variant="Variant.Outlined" |
| 99 | + Color="Color.Primary" |
| 100 | + Size="Size.Small" |
| 101 | + StartIcon="@Icons.Material.Filled.FolderOpen" |
| 102 | + OnClick="OpenLogPath"> |
| 103 | + @(Lang["OpenLogs"]) |
| 104 | + </MudButton> |
| 105 | + <MudButton Variant="Variant.Outlined" |
| 106 | + Color="Color.Error" |
| 107 | + Size="Size.Small" |
| 108 | + StartIcon="@Icons.Material.Filled.Delete" |
| 109 | + OnClick="ClearLogAsync"> |
| 110 | + @(Lang["Delete"]) |
| 111 | + </MudButton> |
| 112 | + </MudStack> |
| 113 | + } |
| 114 | + </MudStack> |
| 115 | +</MudPaper> |
63 | 116 |
|
64 | | -<MudDivider Class="my-4" /> |
65 | | - |
66 | | -<div class="d-flex align-center"> |
67 | | - <MudText Typo="Typo.subtitle2">@(Lang["LogFiles"])</MudText> |
68 | | - @if (!_logLoadingOk) |
69 | | - { |
70 | | - <MudProgressCircular Color="Color.Secondary" |
71 | | - Class="ml-2" |
72 | | - Size="Size.Small" |
73 | | - Indeterminate="true" /> |
74 | | - } |
75 | | - else |
76 | | - { |
77 | | - <MudChip T="string" |
78 | | - Label="true" |
79 | | - Disabled="true" |
80 | | - Variant="Variant.Text" |
81 | | - Color="Color.Secondary" |
82 | | - Size="Size.Small"> |
83 | | - @($"{_logFilesSize / 1024 / 1024:N2} MB") |
84 | | - </MudChip> |
85 | | - |
86 | | - <MudButton Variant="Variant.Text" |
87 | | - Color="Color.Primary" |
88 | | - Size="Size.Small" |
89 | | - OnClick="OpenLogPath">@(Lang["OpenLogs"])</MudButton> |
90 | | - <MudButton Variant="Variant.Text" |
91 | | - Color="Color.Primary" |
92 | | - Size="Size.Small" |
93 | | - OnClick="ClearLogAsync">@(Lang["Delete"])</MudButton> |
94 | | - } |
95 | | -</div> |
96 | | - |
97 | | -<MudDivider Class="my-3" /> |
98 | | - |
99 | | -<div class="d-flex align-center"> |
100 | | - <MudText Typo="Typo.subtitle2">@(Lang["Advanced"])</MudText> |
101 | | - <MudButton Class="ml-2" |
102 | | - Variant="Variant.Text" |
| 117 | +<!-- 高级 --> |
| 118 | +<MudPaper Class="pa-4" Elevation="5"> |
| 119 | + <MudText Class="group-title">@(Lang["General_Group_Advanced"])</MudText> |
| 120 | + <MudButton Variant="Variant.Outlined" |
103 | 121 | Color="Color.Error" |
104 | | - Size="Size.Small" |
105 | | - OnClick="ResetSettingsAsync">@(Lang["ResetSettings"])</MudButton> |
106 | | -</div> |
| 122 | + StartIcon="@Icons.Material.Filled.Refresh" |
| 123 | + OnClick="ResetSettingsAsync" |
| 124 | + Size="Size.Small"> |
| 125 | + @(Lang["ResetSettings"]) |
| 126 | + </MudButton> |
| 127 | +</MudPaper> |
0 commit comments