- Introduced InstanceDetailsViewModel to handle loading and displaying instance-specific credentials. - Created InstanceDetailsWindow and associated XAML for displaying admin, database, and OAuth2 credentials. - Updated InstancesViewModel to include command for opening instance details. - Enhanced SettingsViewModel to manage Bitwarden and Xibo Bootstrap configurations, including connection testing. - Added UI components for Bitwarden Secrets Manager and Xibo Bootstrap OAuth2 settings in the SettingsView. - Implemented password visibility toggles and clipboard copy functionality for sensitive information.
38 lines
996 B
C#
38 lines
996 B
C#
using Avalonia.Controls;
|
|
using OTSSignsOrchestrator.Desktop.ViewModels;
|
|
|
|
namespace OTSSignsOrchestrator.Desktop.Views;
|
|
|
|
public partial class InstancesView : UserControl
|
|
{
|
|
private InstancesViewModel? _vm;
|
|
|
|
public InstancesView()
|
|
{
|
|
InitializeComponent();
|
|
DataContextChanged += OnDataContextChanged;
|
|
}
|
|
|
|
private void OnDataContextChanged(object? sender, EventArgs e)
|
|
{
|
|
if (_vm is not null)
|
|
_vm.OpenDetailsRequested -= OnOpenDetailsRequested;
|
|
|
|
_vm = DataContext as InstancesViewModel;
|
|
|
|
if (_vm is not null)
|
|
_vm.OpenDetailsRequested += OnOpenDetailsRequested;
|
|
}
|
|
|
|
private async void OnOpenDetailsRequested(InstanceDetailsViewModel detailsVm)
|
|
{
|
|
var window = new InstanceDetailsWindow { DataContext = detailsVm };
|
|
var owner = TopLevel.GetTopLevel(this) as Window;
|
|
if (owner is not null)
|
|
await window.ShowDialog(owner);
|
|
else
|
|
window.Show();
|
|
}
|
|
}
|
|
|