mirror of
https://github.com/aliasvault/aliasvault.git
synced 2026-03-20 23:52:31 -04:00
59 lines
1.9 KiB
Plaintext
59 lines
1.9 KiB
Plaintext
@inject DbService DbService
|
|
|
|
<div class="mb-4">
|
|
<label for="defaultEmailDomain" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Default password generator settings</label>
|
|
<button type="button" class="px-4 py-2 bg-primary-600 text-white rounded-md hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-primary-500 dark:bg-primary-700 dark:hover:bg-primary-600" @onclick="OpenSettings">
|
|
Configure
|
|
</button>
|
|
<span class="block text-sm font-normal text-gray-500 truncate dark:text-gray-400 mt-2">
|
|
Configure the default settings used when generating new passwords. These settings will be used for all new passwords unless overridden for specific entries.
|
|
</span>
|
|
</div>
|
|
|
|
@if (IsSettingsVisible)
|
|
{
|
|
<PasswordSettingsPopup
|
|
PasswordSettings="@PasswordSettings"
|
|
IsTemporary="false"
|
|
OnSaveSettings="@HandlePasswordSettingsSaved"
|
|
OnClose="@CloseSettings" />
|
|
}
|
|
|
|
@code {
|
|
private PasswordSettings PasswordSettings { get; set; } = new();
|
|
private bool IsSettingsVisible { get; set; }
|
|
|
|
/// <inheritdoc />
|
|
protected override async Task OnInitializedAsync()
|
|
{
|
|
await base.OnInitializedAsync();
|
|
PasswordSettings = DbService.Settings.PasswordSettings;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Opens the password settings popup.
|
|
/// </summary>
|
|
private void OpenSettings()
|
|
{
|
|
IsSettingsVisible = true;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Closes the password settings popup.
|
|
/// </summary>
|
|
private void CloseSettings()
|
|
{
|
|
IsSettingsVisible = false;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Handles the password settings saved event.
|
|
/// </summary>
|
|
private void HandlePasswordSettingsSaved((PasswordSettings settings, string generatedPassword) args)
|
|
{
|
|
// The settings are already saved in the PasswordSettingsPopup component
|
|
// We just need to update our local state
|
|
PasswordSettings = args.settings;
|
|
}
|
|
}
|