Refactor global configuration page and navigation; add media library page; enhance streamer configuration with detailed options
- Removed the global configuration form and redirected to the consolidated settings page. - Updated the dashboard to provide feedback when no streamers are configured and added edit links for each streamer. - Introduced a new media library page to display media files from the configured archive root. - Enhanced the streamer configuration page with additional options for overrides and settings, including a confirmation modal for deletion. - Updated the layout and styles for improved user experience and navigation. - Switched from file-based password storage to database-backed user credentials management in AuthService. - Applied EF migrations on application startup to ensure database schema is up-to-date.
This commit is contained in:
parent
1ecf7501f4
commit
e5e60999bf
24 changed files with 1151 additions and 163 deletions
|
|
@ -10,5 +10,6 @@ namespace TwitchArchive.Core.Persistence
|
|||
public DbSet<StreamSession> StreamSessions { get; set; } = null!;
|
||||
public DbSet<ArchiveJob> ArchiveJobs { get; set; } = null!;
|
||||
public DbSet<StreamerState> StreamerStates { get; set; } = null!;
|
||||
public DbSet<TwitchArchive.Core.Persistence.Models.UserCredential> UserCredentials { get; set; } = null!;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,30 @@
|
|||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace TwitchArchive.Core.Persistence
|
||||
{
|
||||
public static class ArchiveDbInitializer
|
||||
{
|
||||
public static void EnsureUserCredentialsTable(IDbContextFactory<ArchiveDbContext> factory)
|
||||
{
|
||||
if (factory == null) throw new ArgumentNullException(nameof(factory));
|
||||
try
|
||||
{
|
||||
using var ctx = factory.CreateDbContext();
|
||||
var conn = ctx.Database.GetDbConnection();
|
||||
try { conn.Open(); } catch { /* ignore open errors */ }
|
||||
using var cmd = conn.CreateCommand();
|
||||
// Create table if it doesn't exist (SQLite syntax)
|
||||
cmd.CommandText = @"CREATE TABLE IF NOT EXISTS UserCredentials (
|
||||
Id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
PasswordHash TEXT NOT NULL
|
||||
);";
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
catch
|
||||
{
|
||||
// Initialization should not crash the app; log if needed
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
namespace TwitchArchive.Core.Persistence.Models
|
||||
{
|
||||
public class UserCredential
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string PasswordHash { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue