From 1aed286facc6e11e4fc5fd057bb6d2d5cc95c6d4 Mon Sep 17 00:00:00 2001 From: SysAdmin Date: Tue, 18 Nov 2025 20:24:53 +0000 Subject: [PATCH] feat: Display runtime connection string in dashboard MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added connection string display to System Information section of dashboard. - Injected IConfiguration into DashboardController - Added ConnectionString to ViewData - Displayed in monospace code format for easy reading - Shows actual runtime connection string from configuration - Helps verify which database file is being used in different environments This makes it easier to troubleshoot database location issues, especially when deploying to different environments (Development, Production, CT109, etc.). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- LittleShop/Areas/Admin/Controllers/DashboardController.cs | 8 +++++++- LittleShop/Areas/Admin/Views/Dashboard/Index.cshtml | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/LittleShop/Areas/Admin/Controllers/DashboardController.cs b/LittleShop/Areas/Admin/Controllers/DashboardController.cs index ec529a2..b78fa5e 100644 --- a/LittleShop/Areas/Admin/Controllers/DashboardController.cs +++ b/LittleShop/Areas/Admin/Controllers/DashboardController.cs @@ -11,15 +11,18 @@ public class DashboardController : Controller private readonly IOrderService _orderService; private readonly IProductService _productService; private readonly ICategoryService _categoryService; + private readonly IConfiguration _configuration; public DashboardController( IOrderService orderService, IProductService productService, - ICategoryService categoryService) + ICategoryService categoryService, + IConfiguration configuration) { _orderService = orderService; _productService = productService; _categoryService = categoryService; + _configuration = configuration; } public async Task Index() @@ -47,6 +50,9 @@ public class DashboardController : Controller ViewData["RecentOrders"] = orders.OrderByDescending(o => o.CreatedAt).Take(5); ViewData["TopProducts"] = products.OrderByDescending(p => p.StockQuantity).Take(5); + // System information + ViewData["ConnectionString"] = _configuration.GetConnectionString("DefaultConnection") ?? "Not configured"; + return View(); } } \ No newline at end of file diff --git a/LittleShop/Areas/Admin/Views/Dashboard/Index.cshtml b/LittleShop/Areas/Admin/Views/Dashboard/Index.cshtml index 58cb064..1647b47 100644 --- a/LittleShop/Areas/Admin/Views/Dashboard/Index.cshtml +++ b/LittleShop/Areas/Admin/Views/Dashboard/Index.cshtml @@ -228,6 +228,7 @@ else
  • Framework: .NET 9.0
  • Database: SQLite
  • +
  • Connection String: @ViewData["ConnectionString"]
  • Authentication: Cookie-based
  • Crypto Support: 8 currencies via BTCPay Server
  • API Endpoints: Available for client integration