feat: Implement container logs functionality in InstancesViewModel
- Added properties for managing container logs, including log entries, service filters, and auto-refresh options. - Introduced commands for refreshing logs, toggling auto-refresh, and closing the logs panel. - Implemented log fetching logic with error handling and status messages. - Integrated log display in the InstancesView with a dedicated logs panel. feat: Enhance navigation to Instances page with auto-selection - Added method to navigate to the Instances page and auto-select an instance based on abbreviation. feat: Update SettingsViewModel to load and save Bitwarden configuration - Integrated Bitwarden configuration loading from IOptions and saving to appsettings.json. - Added properties for Bitwarden instance project ID and connection status. - Updated UI to reflect Bitwarden settings and connection status. feat: Add advanced options for instance creation - Introduced a new expander in CreateInstanceView for advanced options, including purging stale volumes. feat: Improve InstanceDetailsWindow with pending setup banner - Added a banner to indicate pending setup for Xibo OAuth credentials, with editable fields for client ID and secret. fix: Update appsettings.json to include Bitwarden configuration structure - Added Bitwarden section to appsettings.json for storing configuration values. chore: Update Docker Compose template with health checks - Added health check configuration for web service in template.yml to ensure service availability. refactor: Drop AppSettings table from database - Removed AppSettings table and related migration files as part of database cleanup. feat: Create ServiceLogEntry DTO for log management - Added ServiceLogEntry class to represent individual log entries from Docker services.
This commit is contained in:
@@ -44,6 +44,28 @@ public class App : Application
|
||||
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
|
||||
{
|
||||
Log.Information("Creating MainWindow...");
|
||||
|
||||
// Import existing instance secrets from Bitwarden (fire-and-forget, non-blocking)
|
||||
_ = Task.Run(async () =>
|
||||
{
|
||||
try
|
||||
{
|
||||
// Pre-load config settings from Bitwarden so they're available immediately
|
||||
using var scope = Services.CreateScope();
|
||||
var settings = scope.ServiceProvider.GetRequiredService<SettingsService>();
|
||||
await settings.PreloadCacheAsync();
|
||||
Log.Information("Bitwarden config settings pre-loaded");
|
||||
|
||||
// Import existing instance secrets that aren't yet tracked
|
||||
var postInit = Services.GetRequiredService<PostInstanceInitService>();
|
||||
await postInit.ImportExistingInstanceSecretsAsync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Warning(ex, "Failed to pre-load settings or import instance secrets on startup");
|
||||
}
|
||||
});
|
||||
|
||||
var vm = Services.GetRequiredService<MainWindowViewModel>();
|
||||
Log.Information("MainWindowViewModel resolved");
|
||||
|
||||
@@ -75,10 +97,10 @@ public class App : Application
|
||||
|
||||
private static void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
// Configuration
|
||||
// Configuration (reloadOnChange so runtime writes to appsettings.json are picked up)
|
||||
var config = new ConfigurationBuilder()
|
||||
.SetBasePath(AppContext.BaseDirectory)
|
||||
.AddJsonFile("appsettings.json", optional: false)
|
||||
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
|
||||
.Build();
|
||||
|
||||
services.AddSingleton<IConfiguration>(config);
|
||||
@@ -89,6 +111,7 @@ public class App : Application
|
||||
services.Configure<XiboOptions>(config.GetSection(XiboOptions.SectionName));
|
||||
services.Configure<DatabaseOptions>(config.GetSection(DatabaseOptions.SectionName));
|
||||
services.Configure<FileLoggingOptions>(config.GetSection(FileLoggingOptions.SectionName));
|
||||
services.Configure<BitwardenOptions>(config.GetSection(BitwardenOptions.SectionName));
|
||||
|
||||
// Logging
|
||||
services.AddLogging(builder =>
|
||||
@@ -115,7 +138,6 @@ public class App : Application
|
||||
services.AddHttpClient();
|
||||
services.AddHttpClient("XiboApi");
|
||||
services.AddHttpClient("XiboHealth");
|
||||
services.AddHttpClient("Bitwarden");
|
||||
|
||||
// SSH services (singletons — maintain connections)
|
||||
services.AddSingleton<SshConnectionService>();
|
||||
@@ -137,7 +159,7 @@ public class App : Application
|
||||
services.AddSingleton<PostInstanceInitService>();
|
||||
|
||||
// ViewModels
|
||||
services.AddTransient<MainWindowViewModel>();
|
||||
services.AddSingleton<MainWindowViewModel>(); // singleton: one main window, nav state shared
|
||||
services.AddTransient<HostsViewModel>();
|
||||
services.AddTransient<InstancesViewModel>();
|
||||
services.AddTransient<InstanceDetailsViewModel>();
|
||||
|
||||
Reference in New Issue
Block a user