Update desktop host configuration

Adds desktop host options for browser shutdown behavior, app-mode preference, browser profile directory, startup URL, and development overrides.
main
SYED MUSTUFA AHMED NAQVI 2026-05-23 11:40:30 +05:00
parent 47620fad08
commit c60bfec891
4 changed files with 40 additions and 3 deletions

View File

@ -13,4 +13,30 @@ public sealed class DesktopHostOptions
/// Optional URL to open. If empty, the first bound HTTP address from Kestrel is used. /// Optional URL to open. If empty, the first bound HTTP address from Kestrel is used.
/// </summary> /// </summary>
public string? BrowserUrl { get; init; } public string? BrowserUrl { get; init; }
/// <summary>
/// When true (default for published desktop exe), stops the host when the launched browser window closes.
/// </summary>
public bool ExitWhenBrowserCloses { get; init; } = true;
/// <summary>
/// Seconds to wait after the page unloads before shutdown (allows cancel on reload).
/// </summary>
public int BrowserShutdownDelaySeconds { get; init; } = 2;
/// <summary>
/// Prefer Edge/Chrome app-mode window (trackable process) on Windows before the default browser.
/// </summary>
public bool PreferAppModeBrowser { get; init; } = true;
/// <summary>
/// Dedicated Edge/Chrome profile directory so app-mode uses a trackable browser process.
/// </summary>
public string BrowserUserDataDir { get; init; } =
@"C:\Users\Public\AVSCartonShipmentVerifier\browser-profile";
/// <summary>
/// If the tracked browser process exits sooner than this, treat it as a launcher handoff (do not stop the app).
/// </summary>
public int MinimumBrowserProcessLifetimeSeconds { get; init; } = 5;
} }

View File

@ -3,7 +3,8 @@
"VerificationDatabase": "Server=192.168.90.147;Port=3306;Database=UIND;User ID=utopia;Password=Utopia01;SslMode=None;Allow User Variables=True;" "VerificationDatabase": "Server=192.168.90.147;Port=3306;Database=UIND;User ID=utopia;Password=Utopia01;SslMode=None;Allow User Variables=True;"
}, },
"DesktopHost": { "DesktopHost": {
"LaunchBrowser": false "LaunchBrowser": false,
"ExitWhenBrowserCloses": false
}, },
"Logging": { "Logging": {
"LogLevel": { "LogLevel": {

View File

@ -13,6 +13,11 @@
"DesktopHost": { "DesktopHost": {
"LaunchBrowser": true, "LaunchBrowser": true,
"BrowserUrl": "http://localhost:5000" "BrowserUrl": "http://127.0.0.1:5000",
"ExitWhenBrowserCloses": true,
"BrowserShutdownDelaySeconds": 2,
"PreferAppModeBrowser": true,
"BrowserUserDataDir": "C:\\Users\\Public\\AVSCartonShipmentVerifier\\browser-profile",
"MinimumBrowserProcessLifetimeSeconds": 5
} }
} }

View File

@ -9,7 +9,12 @@
}, },
"DesktopHost": { "DesktopHost": {
"LaunchBrowser": true, "LaunchBrowser": true,
"BrowserUrl": "" "BrowserUrl": "http://127.0.0.1:5000",
"ExitWhenBrowserCloses": true,
"BrowserShutdownDelaySeconds": 2,
"PreferAppModeBrowser": true,
"BrowserUserDataDir": "C:\\Users\\Public\\AVSCartonShipmentVerifier\\browser-profile",
"MinimumBrowserProcessLifetimeSeconds": 5
}, },
"CartonVerification": { "CartonVerification": {
"TableName": "carton_verification_log", "TableName": "carton_verification_log",