-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
13486b1
commit 9786fd4
Showing
11 changed files
with
198 additions
and
215 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
<MudPasswordField @bind-Value="@_password" | ||
Class="mt-6" | ||
Variant="Variant.Text" | ||
Label="@(Lang["SetPasswordInput"])" | ||
IconSize="Size.Small" /> | ||
<MudDialog> | ||
<DialogContent> | ||
<MudPaper Width="350px" Elevation="0"> | ||
<MudPasswordField @bind-Value="@_password" | ||
Variant="Variant.Text" | ||
Label="@(Lang["SetPasswordInput"])" | ||
IconSize="Size.Small" /> | ||
</MudPaper> | ||
</DialogContent> | ||
<DialogActions> | ||
<MudButton Color="Color.Primary" | ||
FullWidth="true" | ||
Variant="Variant.Filled" | ||
OnClick="Submit"> | ||
@(Lang["SetPasswordFinished"]) | ||
</MudButton> | ||
</DialogActions> | ||
</MudDialog> | ||
|
||
<MudButton Class="mt-4" | ||
FullWidth="true" | ||
Variant="Variant.Filled" | ||
Color="Color.Primary" | ||
OnClick="SavePasswordAsync">@(Lang["SetPasswordFinished"])</MudButton> | ||
|
||
<MudAlert Class="mt-6" | ||
Severity="Severity.Normal" | ||
Style="opacity:0.5" | ||
Icon="@Icons.Material.Filled.Face5" | ||
Dense="true">@(Lang["DefaultPasswordTip"])</MudAlert> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,151 +1,142 @@ | ||
@page "/" | ||
Check warning on line 1 in src/ComputerLock/Pages/Index.razor
|
||
@using ComputerLock.Enums | ||
@using JiuLing.CommonLibs.ExtensionMethods | ||
|
||
<style> | ||
.dialog-blurry { | ||
backdrop-filter: blur(10px); | ||
} | ||
</style> | ||
|
||
@if (!AppSettings.IsPasswordChanged) | ||
{ | ||
<SetPassword PasswordSetFinished="OnPasswordSetFinishedAsync"></SetPassword> | ||
} | ||
else | ||
{ | ||
<MudSwitch @bind-Value="@(AppSettings.LockOnStartup)" | ||
@bind-Value:after="SaveSettings" | ||
Label="@(Lang["LockOnStartup"])" | ||
Color="Color.Primary" /> | ||
|
||
<MudTooltip Text="@(Lang["DisableWindowsRemark"])" Placement="Placement.Bottom"> | ||
<MudSwitch @bind-Value="@(AppSettings.IsDisableWindowsLock)" | ||
@bind-Value:after="SaveSettings" | ||
Label="@(Lang["DisableWindowsLock"])" | ||
Color="Color.Primary" /> | ||
</MudTooltip> | ||
<MudSwitch @bind-Value="@(AppSettings.LockOnStartup)" | ||
@bind-Value:after="SaveSettings" | ||
Label="@(Lang["LockOnStartup"])" | ||
Color="Color.Primary" /> | ||
|
||
<MudSwitch @bind-Value="@(AppSettings.IsHideMouseCursor)" | ||
<MudTooltip Text="@(Lang["DisableWindowsRemark"])" Placement="Placement.Bottom"> | ||
<MudSwitch @bind-Value="@(AppSettings.IsDisableWindowsLock)" | ||
@bind-Value:after="SaveSettings" | ||
Label="@(Lang["HideMouseCursor"])" | ||
Label="@(Lang["DisableWindowsLock"])" | ||
Color="Color.Primary" /> | ||
|
||
<MudSwitch @bind-Value="@(AppSettings.LockAnimation)" | ||
@bind-Value:after="SaveSettings" | ||
Label="@(Lang["LockAnimation"])" | ||
Color="Color.Primary" /> | ||
|
||
<MudNumericField T="int" | ||
Label="@(Lang["AutoLock"])" | ||
Value="@(AppSettings.AutoLockMinute)" | ||
Margin="Margin.Dense" | ||
Min="0" | ||
Variant="Variant.Outlined" | ||
ValueChanged="AutoLockChanged"> | ||
</MudNumericField> | ||
|
||
<HotkeyInput Title="@(Lang["LockHotkey"])" | ||
Hotkey="@(AppSettings.LockHotkeyString)" | ||
OnHotkeySet="SetLockHotkey" | ||
OnHotkeyClear="ClearLockHotkey" /> | ||
|
||
<MudToggleGroup @bind-Value="@(AppSettings.ScreenUnlockMethod)" | ||
@bind-Value:after="SaveSettings" | ||
T="ScreenUnlockMethods" | ||
SelectionMode="SelectionMode.SingleSelection" | ||
Class="mt-2" | ||
Color="Color.Primary" | ||
Size="Size.Small" | ||
CheckMark | ||
FixedContent> | ||
<MudToggleItem Value="@(ScreenUnlockMethods.Password)" Text="@(Lang["PasswordUnlock"])" /> | ||
<MudToggleItem Value="@(ScreenUnlockMethods.Hotkey)" Text="@(Lang["HotkeyUnlock"])" /> | ||
</MudToggleGroup> | ||
|
||
<MudPaper Elevation="0" Height="210px"> | ||
|
||
@if (AppSettings.ScreenUnlockMethod == ScreenUnlockMethods.Password) | ||
{ | ||
<div class="d-flex align-center"> | ||
<MudSwitch @bind-Value="@(AppSettings.EnablePasswordBox)" | ||
@bind-Value:after="SaveSettings" | ||
Label="@(Lang["EnablePasswordBox"])" | ||
Color="Color.Primary" /> | ||
@if (!AppSettings.EnablePasswordBox) | ||
{ | ||
<MudChip T="string" | ||
Label="true" | ||
Icon="@Icons.Material.Filled.WarningAmber" | ||
IconColor="Color.Primary" | ||
DisableRipple="true" | ||
Size="Size.Small"> | ||
@(Lang["EnablePasswordBoxTips"]) | ||
</MudChip> | ||
} | ||
</div> | ||
|
||
<MudSwitch @bind-Value="@(AppSettings.IsHidePasswordWindow)" | ||
</MudTooltip> | ||
|
||
<MudSwitch @bind-Value="@(AppSettings.IsHideMouseCursor)" | ||
@bind-Value:after="SaveSettings" | ||
Label="@(Lang["HideMouseCursor"])" | ||
Color="Color.Primary" /> | ||
|
||
<MudSwitch @bind-Value="@(AppSettings.LockAnimation)" | ||
@bind-Value:after="SaveSettings" | ||
Label="@(Lang["LockAnimation"])" | ||
Color="Color.Primary" /> | ||
|
||
<MudNumericField T="int" | ||
Label="@(Lang["AutoLock"])" | ||
Value="@(AppSettings.AutoLockMinute)" | ||
Margin="Margin.Dense" | ||
Min="0" | ||
Variant="Variant.Outlined" | ||
ValueChanged="AutoLockChanged"> | ||
</MudNumericField> | ||
|
||
<HotkeyInput Title="@(Lang["LockHotkey"])" | ||
Hotkey="@(AppSettings.LockHotkeyString)" | ||
OnHotkeySet="SetLockHotkey" | ||
OnHotkeyClear="ClearLockHotkey" /> | ||
|
||
<MudToggleGroup @bind-Value="@(AppSettings.ScreenUnlockMethod)" | ||
@bind-Value:after="SaveSettings" | ||
T="ScreenUnlockMethods" | ||
SelectionMode="SelectionMode.SingleSelection" | ||
Class="mt-2" | ||
Color="Color.Primary" | ||
Size="Size.Small" | ||
CheckMark | ||
FixedContent> | ||
<MudToggleItem Value="@(ScreenUnlockMethods.Password)" Text="@(Lang["PasswordUnlock"])" /> | ||
<MudToggleItem Value="@(ScreenUnlockMethods.Hotkey)" Text="@(Lang["HotkeyUnlock"])" /> | ||
</MudToggleGroup> | ||
|
||
<MudPaper Elevation="0" Height="210px"> | ||
|
||
@if (AppSettings.ScreenUnlockMethod == ScreenUnlockMethods.Password) | ||
{ | ||
<MudButton Color="Color.Primary" | ||
IconSize="Size.Small" | ||
OnClick="ResetPassword"> | ||
@(Lang["ResetPassword"]) | ||
</MudButton> | ||
|
||
<div class="d-flex align-center"> | ||
<MudSwitch @bind-Value="@(AppSettings.EnablePasswordBox)" | ||
@bind-Value:after="SaveSettings" | ||
Class="ml-6" | ||
Disabled="@(!AppSettings.EnablePasswordBox)" | ||
Label="@(Lang["HidePasswordWindow"])" | ||
Label="@(Lang["EnablePasswordBox"])" | ||
Color="Color.Primary" /> | ||
@if (!AppSettings.EnablePasswordBox) | ||
{ | ||
<MudChip T="string" | ||
Label="true" | ||
Icon="@Icons.Material.Filled.WarningAmber" | ||
IconColor="Color.Primary" | ||
DisableRipple="true" | ||
Size="Size.Small"> | ||
@(Lang["EnablePasswordBoxTips"]) | ||
</MudChip> | ||
} | ||
</div> | ||
|
||
<MudSwitch @bind-Value="@(AppSettings.IsHidePasswordWindow)" | ||
@bind-Value:after="SaveSettings" | ||
Class="ml-6" | ||
Disabled="@(!AppSettings.EnablePasswordBox)" | ||
Label="@(Lang["HidePasswordWindow"])" | ||
Color="Color.Primary" /> | ||
|
||
<MudSwitch @bind-Value="@(_keyboardDownChecked)" | ||
@bind-Value:after="KeyboardDownChecked" | ||
Class="ml-6" | ||
Disabled="@(!AppSettings.EnablePasswordBox)" | ||
Label="@(Lang["KeyboardDownActivePwd"])" | ||
Color="Color.Primary" /> | ||
<MudSwitch @bind-Value="@(_keyboardDownChecked)" | ||
@bind-Value:after="KeyboardDownChecked" | ||
Class="ml-6" | ||
Disabled="@(!AppSettings.EnablePasswordBox)" | ||
Label="@(Lang["KeyboardDownActivePwd"])" | ||
Color="Color.Primary" /> | ||
|
||
<MudSwitch @bind-Value="@(_mouseDownChecked)" | ||
@bind-Value:after="MouseDownChecked" | ||
Class="ml-6" | ||
Disabled="@(!AppSettings.EnablePasswordBox)" | ||
Label="@(Lang["MouseDownActivePwd"])" | ||
Color="Color.Primary" /> | ||
<MudSwitch @bind-Value="@(_mouseDownChecked)" | ||
@bind-Value:after="MouseDownChecked" | ||
Class="ml-6" | ||
Disabled="@(!AppSettings.EnablePasswordBox)" | ||
Label="@(Lang["MouseDownActivePwd"])" | ||
Color="Color.Primary" /> | ||
|
||
<MudSelect T="ScreenLocationEnum" | ||
Label="@(Lang["PwdLocation"])" | ||
Variant="Variant.Outlined" | ||
Value="@(AppSettings.PasswordInputLocation)" | ||
Disabled="@(!AppSettings.EnablePasswordBox)" | ||
Class="ml-6" | ||
ValueChanged="PwdBoxLocationChanged" | ||
Margin="Margin.Dense" | ||
Dense="true"> | ||
<MudSelectItem Value="@(ScreenLocationEnum.Center)">@(Lang["Center"])</MudSelectItem> | ||
<MudSelectItem Value="@(ScreenLocationEnum.TopLeft)">@(Lang["TopLeft"])</MudSelectItem> | ||
<MudSelectItem Value="@(ScreenLocationEnum.TopRight)">@(Lang["TopRight"])</MudSelectItem> | ||
<MudSelectItem Value="@(ScreenLocationEnum.BottomLeft)">@(Lang["BottomLeft"])</MudSelectItem> | ||
<MudSelectItem Value="@(ScreenLocationEnum.BottomRight)">@(Lang["BottomRight"])</MudSelectItem> | ||
</MudSelect> | ||
|
||
<MudButton Color="Color.Primary" | ||
StartIcon="@Icons.Material.Filled.VpnKey" | ||
IconSize="Size.Small" | ||
OnClick="ResetPassword"> | ||
@(Lang["ResetPassword"]) | ||
</MudButton> | ||
} | ||
else if (AppSettings.ScreenUnlockMethod == ScreenUnlockMethods.Hotkey) | ||
{ | ||
<MudPaper Class="mt-1 d-flex align-center" Elevation="0"> | ||
<HotkeyInput Title="@(Lang["UnlockHotkey"])" | ||
Hotkey="@(AppSettings.UnlockHotkeyString)" | ||
Disabled="@AppSettings.IsUnlockUseLockHotkey" | ||
OnHotkeySet="SetUnlockHotkey" | ||
OnHotkeyClear="ClearUnlockHotkey" /> | ||
|
||
<MudCheckBox @bind-Value="@(AppSettings.IsUnlockUseLockHotkey)" | ||
@bind-Value:after="SaveSettings" | ||
class="ml-3" | ||
Label="@(Lang["UseLockHotkey"])" | ||
Size="Size.Small" | ||
Dense="true" | ||
Color="Color.Primary"></MudCheckBox> | ||
</MudPaper> | ||
} | ||
</MudPaper> | ||
} | ||
<MudSelect T="ScreenLocationEnum" | ||
Label="@(Lang["PwdLocation"])" | ||
Variant="Variant.Outlined" | ||
Value="@(AppSettings.PasswordInputLocation)" | ||
Disabled="@(!AppSettings.EnablePasswordBox)" | ||
Class="ml-6" | ||
ValueChanged="PwdBoxLocationChanged" | ||
Margin="Margin.Dense" | ||
Dense="true"> | ||
<MudSelectItem Value="@(ScreenLocationEnum.Center)">@(Lang["Center"])</MudSelectItem> | ||
<MudSelectItem Value="@(ScreenLocationEnum.TopLeft)">@(Lang["TopLeft"])</MudSelectItem> | ||
<MudSelectItem Value="@(ScreenLocationEnum.TopRight)">@(Lang["TopRight"])</MudSelectItem> | ||
<MudSelectItem Value="@(ScreenLocationEnum.BottomLeft)">@(Lang["BottomLeft"])</MudSelectItem> | ||
<MudSelectItem Value="@(ScreenLocationEnum.BottomRight)">@(Lang["BottomRight"])</MudSelectItem> | ||
</MudSelect> | ||
} | ||
else if (AppSettings.ScreenUnlockMethod == ScreenUnlockMethods.Hotkey) | ||
{ | ||
<MudPaper Class="mt-1 d-flex align-center" Elevation="0"> | ||
<HotkeyInput Title="@(Lang["UnlockHotkey"])" | ||
Hotkey="@(AppSettings.UnlockHotkeyString)" | ||
Disabled="@AppSettings.IsUnlockUseLockHotkey" | ||
OnHotkeySet="SetUnlockHotkey" | ||
OnHotkeyClear="ClearUnlockHotkey" /> | ||
|
||
<MudCheckBox @bind-Value="@(AppSettings.IsUnlockUseLockHotkey)" | ||
@bind-Value:after="SaveSettings" | ||
class="ml-3" | ||
Label="@(Lang["UseLockHotkey"])" | ||
Size="Size.Small" | ||
Dense="true" | ||
Color="Color.Primary"></MudCheckBox> | ||
</MudPaper> | ||
} | ||
</MudPaper> |
Oops, something went wrong.