1
1
@page " /"
2
2
@using ComputerLock .Enums
3
- @using JiuLing .CommonLibs .ExtensionMethods
4
3
5
4
<style >
6
5
.dialog-blurry {
7
6
backdrop-filter : blur (10px );
8
7
}
9
8
</style >
10
9
11
- @if (! AppSettings .IsPasswordChanged )
12
- {
13
- <SetPassword PasswordSetFinished =" OnPasswordSetFinishedAsync" ></SetPassword >
14
- }
15
- else
16
- {
17
- <MudSwitch @bind-Value =" @(AppSettings.LockOnStartup)"
18
- @bind-Value:after =" SaveSettings"
19
- Label =" @(Lang[" LockOnStartup " ])"
20
- Color =" Color.Primary" />
21
-
22
- <MudTooltip Text =" @(Lang[" DisableWindowsRemark " ])" Placement =" Placement.Bottom" >
23
- <MudSwitch @bind-Value =" @(AppSettings.IsDisableWindowsLock)"
24
- @bind-Value:after =" SaveSettings"
25
- Label =" @(Lang[" DisableWindowsLock " ])"
26
- Color =" Color.Primary" />
27
- </MudTooltip >
10
+ <MudSwitch @bind-Value =" @(AppSettings.LockOnStartup)"
11
+ @bind-Value:after =" SaveSettings"
12
+ Label =" @(Lang[" LockOnStartup " ])"
13
+ Color =" Color.Primary" />
28
14
29
- <MudSwitch @bind-Value =" @(AppSettings.IsHideMouseCursor)"
15
+ <MudTooltip Text =" @(Lang[" DisableWindowsRemark " ])" Placement =" Placement.Bottom" >
16
+ <MudSwitch @bind-Value =" @(AppSettings.IsDisableWindowsLock)"
30
17
@bind-Value:after =" SaveSettings"
31
- Label =" @(Lang[" HideMouseCursor " ])"
18
+ Label =" @(Lang[" DisableWindowsLock " ])"
32
19
Color =" Color.Primary" />
33
-
34
- <MudSwitch @bind-Value =" @(AppSettings.LockAnimation)"
35
- @bind-Value:after =" SaveSettings"
36
- Label =" @(Lang[" LockAnimation " ])"
37
- Color =" Color.Primary" />
38
-
39
- <MudNumericField T =" int"
40
- Label =" @(Lang[" AutoLock " ])"
41
- Value =" @(AppSettings.AutoLockMinute)"
42
- Margin =" Margin.Dense"
43
- Min =" 0"
44
- Variant =" Variant.Outlined"
45
- ValueChanged =" AutoLockChanged" >
46
- </MudNumericField >
47
-
48
- <HotkeyInput Title =" @(Lang[" LockHotkey " ])"
49
- Hotkey =" @(AppSettings.LockHotkeyString)"
50
- OnHotkeySet =" SetLockHotkey"
51
- OnHotkeyClear =" ClearLockHotkey" />
52
-
53
- <MudToggleGroup @bind-Value =" @(AppSettings.ScreenUnlockMethod)"
54
- @bind-Value:after =" SaveSettings"
55
- T =" ScreenUnlockMethods"
56
- SelectionMode =" SelectionMode.SingleSelection"
57
- Class =" mt-2"
58
- Color =" Color.Primary"
59
- Size =" Size.Small"
60
- CheckMark
61
- FixedContent >
62
- <MudToggleItem Value =" @(ScreenUnlockMethods.Password)" Text =" @(Lang[" PasswordUnlock " ])" />
63
- <MudToggleItem Value =" @(ScreenUnlockMethods.Hotkey)" Text =" @(Lang[" HotkeyUnlock " ])" />
64
- </MudToggleGroup >
65
-
66
- <MudPaper Elevation =" 0" Height =" 210px" >
67
-
68
- @if (AppSettings .ScreenUnlockMethod == ScreenUnlockMethods .Password )
69
- {
70
- <div class =" d-flex align-center" >
71
- <MudSwitch @bind-Value =" @(AppSettings.EnablePasswordBox)"
72
- @bind-Value:after =" SaveSettings"
73
- Label =" @(Lang[" EnablePasswordBox " ])"
74
- Color =" Color.Primary" />
75
- @if (! AppSettings .EnablePasswordBox )
76
- {
77
- <MudChip T =" string"
78
- Label =" true"
79
- Icon =" @Icons.Material.Filled.WarningAmber"
80
- IconColor =" Color.Primary"
81
- DisableRipple =" true"
82
- Size =" Size.Small" >
83
- @( Lang [" EnablePasswordBoxTips" ])
84
- </MudChip >
85
- }
86
- </div >
87
-
88
- <MudSwitch @bind-Value =" @(AppSettings.IsHidePasswordWindow)"
20
+ </MudTooltip >
21
+
22
+ <MudSwitch @bind-Value =" @(AppSettings.IsHideMouseCursor)"
23
+ @bind-Value:after =" SaveSettings"
24
+ Label =" @(Lang[" HideMouseCursor " ])"
25
+ Color =" Color.Primary" />
26
+
27
+ <MudSwitch @bind-Value =" @(AppSettings.LockAnimation)"
28
+ @bind-Value:after =" SaveSettings"
29
+ Label =" @(Lang[" LockAnimation " ])"
30
+ Color =" Color.Primary" />
31
+
32
+ <MudNumericField T =" int"
33
+ Label =" @(Lang[" AutoLock " ])"
34
+ Value =" @(AppSettings.AutoLockMinute)"
35
+ Margin =" Margin.Dense"
36
+ Min =" 0"
37
+ Variant =" Variant.Outlined"
38
+ ValueChanged =" AutoLockChanged" >
39
+ </MudNumericField >
40
+
41
+ <HotkeyInput Title =" @(Lang[" LockHotkey " ])"
42
+ Hotkey =" @(AppSettings.LockHotkeyString)"
43
+ OnHotkeySet =" SetLockHotkey"
44
+ OnHotkeyClear =" ClearLockHotkey" />
45
+
46
+ <MudToggleGroup @bind-Value =" @(AppSettings.ScreenUnlockMethod)"
47
+ @bind-Value:after =" SaveSettings"
48
+ T =" ScreenUnlockMethods"
49
+ SelectionMode =" SelectionMode.SingleSelection"
50
+ Class =" mt-2"
51
+ Color =" Color.Primary"
52
+ Size =" Size.Small"
53
+ CheckMark
54
+ FixedContent >
55
+ <MudToggleItem Value =" @(ScreenUnlockMethods.Password)" Text =" @(Lang[" PasswordUnlock " ])" />
56
+ <MudToggleItem Value =" @(ScreenUnlockMethods.Hotkey)" Text =" @(Lang[" HotkeyUnlock " ])" />
57
+ </MudToggleGroup >
58
+
59
+ <MudPaper Elevation =" 0" Height =" 210px" >
60
+
61
+ @if (AppSettings .ScreenUnlockMethod == ScreenUnlockMethods .Password )
62
+ {
63
+ <MudButton Color =" Color.Primary"
64
+ IconSize =" Size.Small"
65
+ OnClick =" ResetPassword" >
66
+ @( Lang [" ResetPassword" ])
67
+ </MudButton >
68
+
69
+ <div class =" d-flex align-center" >
70
+ <MudSwitch @bind-Value =" @(AppSettings.EnablePasswordBox)"
89
71
@bind-Value:after =" SaveSettings"
90
- Class =" ml-6"
91
- Disabled =" @(!AppSettings.EnablePasswordBox)"
92
- Label =" @(Lang[" HidePasswordWindow " ])"
72
+ Label =" @(Lang[" EnablePasswordBox " ])"
93
73
Color =" Color.Primary" />
74
+ @if (! AppSettings .EnablePasswordBox )
75
+ {
76
+ <MudChip T =" string"
77
+ Label =" true"
78
+ Icon =" @Icons.Material.Filled.WarningAmber"
79
+ IconColor =" Color.Primary"
80
+ DisableRipple =" true"
81
+ Size =" Size.Small" >
82
+ @( Lang [" EnablePasswordBoxTips" ])
83
+ </MudChip >
84
+ }
85
+ </div >
86
+
87
+ <MudSwitch @bind-Value =" @(AppSettings.IsHidePasswordWindow)"
88
+ @bind-Value:after =" SaveSettings"
89
+ Class =" ml-6"
90
+ Disabled =" @(!AppSettings.EnablePasswordBox)"
91
+ Label =" @(Lang[" HidePasswordWindow " ])"
92
+ Color =" Color.Primary" />
94
93
95
- <MudSwitch @bind-Value =" @(_keyboardDownChecked)"
96
- @bind-Value:after =" KeyboardDownChecked"
97
- Class =" ml-6"
98
- Disabled =" @(!AppSettings.EnablePasswordBox)"
99
- Label =" @(Lang[" KeyboardDownActivePwd " ])"
100
- Color =" Color.Primary" />
94
+ <MudSwitch @bind-Value =" @(_keyboardDownChecked)"
95
+ @bind-Value:after =" KeyboardDownChecked"
96
+ Class =" ml-6"
97
+ Disabled =" @(!AppSettings.EnablePasswordBox)"
98
+ Label =" @(Lang[" KeyboardDownActivePwd " ])"
99
+ Color =" Color.Primary" />
101
100
102
- <MudSwitch @bind-Value =" @(_mouseDownChecked)"
103
- @bind-Value:after =" MouseDownChecked"
104
- Class =" ml-6"
105
- Disabled =" @(!AppSettings.EnablePasswordBox)"
106
- Label =" @(Lang[" MouseDownActivePwd " ])"
107
- Color =" Color.Primary" />
101
+ <MudSwitch @bind-Value =" @(_mouseDownChecked)"
102
+ @bind-Value:after =" MouseDownChecked"
103
+ Class =" ml-6"
104
+ Disabled =" @(!AppSettings.EnablePasswordBox)"
105
+ Label =" @(Lang[" MouseDownActivePwd " ])"
106
+ Color =" Color.Primary" />
108
107
109
- <MudSelect T =" ScreenLocationEnum"
110
- Label =" @(Lang[" PwdLocation " ])"
111
- Variant =" Variant.Outlined"
112
- Value =" @(AppSettings.PasswordInputLocation)"
113
- Disabled =" @(!AppSettings.EnablePasswordBox)"
114
- Class =" ml-6"
115
- ValueChanged =" PwdBoxLocationChanged"
116
- Margin =" Margin.Dense"
117
- Dense =" true" >
118
- <MudSelectItem Value =" @(ScreenLocationEnum.Center)" >@( Lang [" Center" ]) </MudSelectItem >
119
- <MudSelectItem Value =" @(ScreenLocationEnum.TopLeft)" >@( Lang [" TopLeft" ]) </MudSelectItem >
120
- <MudSelectItem Value =" @(ScreenLocationEnum.TopRight)" >@( Lang [" TopRight" ]) </MudSelectItem >
121
- <MudSelectItem Value =" @(ScreenLocationEnum.BottomLeft)" >@( Lang [" BottomLeft" ]) </MudSelectItem >
122
- <MudSelectItem Value =" @(ScreenLocationEnum.BottomRight)" >@( Lang [" BottomRight" ]) </MudSelectItem >
123
- </MudSelect >
124
-
125
- <MudButton Color =" Color.Primary"
126
- StartIcon =" @Icons.Material.Filled.VpnKey"
127
- IconSize =" Size.Small"
128
- OnClick =" ResetPassword" >
129
- @( Lang [" ResetPassword" ])
130
- </MudButton >
131
- }
132
- else if (AppSettings .ScreenUnlockMethod == ScreenUnlockMethods .Hotkey )
133
- {
134
- <MudPaper Class =" mt-1 d-flex align-center" Elevation =" 0" >
135
- <HotkeyInput Title =" @(Lang[" UnlockHotkey " ])"
136
- Hotkey =" @(AppSettings.UnlockHotkeyString)"
137
- Disabled =" @AppSettings.IsUnlockUseLockHotkey"
138
- OnHotkeySet =" SetUnlockHotkey"
139
- OnHotkeyClear =" ClearUnlockHotkey" />
140
-
141
- <MudCheckBox @bind-Value =" @(AppSettings.IsUnlockUseLockHotkey)"
142
- @bind-Value:after =" SaveSettings"
143
- class =" ml-3"
144
- Label =" @(Lang[" UseLockHotkey " ])"
145
- Size =" Size.Small"
146
- Dense =" true"
147
- Color =" Color.Primary" ></MudCheckBox >
148
- </MudPaper >
149
- }
150
- </MudPaper >
151
- }
108
+ <MudSelect T =" ScreenLocationEnum"
109
+ Label =" @(Lang[" PwdLocation " ])"
110
+ Variant =" Variant.Outlined"
111
+ Value =" @(AppSettings.PasswordInputLocation)"
112
+ Disabled =" @(!AppSettings.EnablePasswordBox)"
113
+ Class =" ml-6"
114
+ ValueChanged =" PwdBoxLocationChanged"
115
+ Margin =" Margin.Dense"
116
+ Dense =" true" >
117
+ <MudSelectItem Value =" @(ScreenLocationEnum.Center)" >@( Lang [" Center" ]) </MudSelectItem >
118
+ <MudSelectItem Value =" @(ScreenLocationEnum.TopLeft)" >@( Lang [" TopLeft" ]) </MudSelectItem >
119
+ <MudSelectItem Value =" @(ScreenLocationEnum.TopRight)" >@( Lang [" TopRight" ]) </MudSelectItem >
120
+ <MudSelectItem Value =" @(ScreenLocationEnum.BottomLeft)" >@( Lang [" BottomLeft" ]) </MudSelectItem >
121
+ <MudSelectItem Value =" @(ScreenLocationEnum.BottomRight)" >@( Lang [" BottomRight" ]) </MudSelectItem >
122
+ </MudSelect >
123
+ }
124
+ else if (AppSettings .ScreenUnlockMethod == ScreenUnlockMethods .Hotkey )
125
+ {
126
+ <MudPaper Class =" mt-1 d-flex align-center" Elevation =" 0" >
127
+ <HotkeyInput Title =" @(Lang[" UnlockHotkey " ])"
128
+ Hotkey =" @(AppSettings.UnlockHotkeyString)"
129
+ Disabled =" @AppSettings.IsUnlockUseLockHotkey"
130
+ OnHotkeySet =" SetUnlockHotkey"
131
+ OnHotkeyClear =" ClearUnlockHotkey" />
132
+
133
+ <MudCheckBox @bind-Value =" @(AppSettings.IsUnlockUseLockHotkey)"
134
+ @bind-Value:after =" SaveSettings"
135
+ class =" ml-3"
136
+ Label =" @(Lang[" UseLockHotkey " ])"
137
+ Size =" Size.Small"
138
+ Dense =" true"
139
+ Color =" Color.Primary" ></MudCheckBox >
140
+ </MudPaper >
141
+ }
142
+ </MudPaper >
0 commit comments