mirror of
https://github.com/wwiinnddyy/LanMountainDesktop.git
synced 2026-06-22 09:14:25 +08:00
refactor(launcher): replace LauncherFlowCoordinator with LaunchPipeline and slim App shell
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
49
LanMountainDesktop.Launcher/Startup/LaunchAttemptDetails.cs
Normal file
49
LanMountainDesktop.Launcher/Startup/LaunchAttemptDetails.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using LanMountainDesktop.Launcher.Models;
|
||||
using LanMountainDesktop.Shared.Contracts.Launcher;
|
||||
|
||||
namespace LanMountainDesktop.Launcher.Startup;
|
||||
|
||||
internal static class LaunchAttemptDetails
|
||||
{
|
||||
public static Dictionary<string, string> Build(
|
||||
StartupAttemptRecord? trackedAttempt,
|
||||
bool attachedToExistingAttempt,
|
||||
bool ipcConnected,
|
||||
bool hostProcessAlive,
|
||||
StartupStage lastStage,
|
||||
string lastStageMessage,
|
||||
string? activationFailureReason,
|
||||
bool softTimeoutShown,
|
||||
bool recoveryActivationAttempted)
|
||||
{
|
||||
var details = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
|
||||
{
|
||||
["hostProcessAlive"] = hostProcessAlive.ToString(),
|
||||
["attachedToExistingAttempt"] = attachedToExistingAttempt.ToString(),
|
||||
["ipcConnected"] = ipcConnected.ToString(),
|
||||
["ipcStage"] = lastStage.ToString(),
|
||||
["ipcMessage"] = lastStageMessage,
|
||||
["activationFailureReason"] = activationFailureReason ?? string.Empty,
|
||||
["softTimeoutShown"] = softTimeoutShown.ToString(),
|
||||
["recoveryActivationAttempted"] = recoveryActivationAttempted.ToString()
|
||||
};
|
||||
|
||||
if (trackedAttempt is not null)
|
||||
{
|
||||
details["startupAttemptId"] = trackedAttempt.AttemptId;
|
||||
details["startupAttemptState"] = trackedAttempt.State.ToString();
|
||||
details["startupAttemptStartedAtUtc"] = trackedAttempt.StartedAtUtc.ToString("O");
|
||||
details["startupAttemptUpdatedAtUtc"] = trackedAttempt.UpdatedAtUtc.ToString("O");
|
||||
details["startupAttemptHeartbeatAtUtc"] = trackedAttempt.HeartbeatAtUtc.ToString("O");
|
||||
details["successPolicy"] = trackedAttempt.SuccessPolicy;
|
||||
details["hostPid"] = trackedAttempt.HostPid.ToString();
|
||||
details["coordinatorPid"] = trackedAttempt.CoordinatorPid.ToString();
|
||||
details["coordinatorPipeName"] = trackedAttempt.CoordinatorPipeName;
|
||||
details["reservedBeforeHostStart"] = trackedAttempt.ReservedBeforeHostStart.ToString();
|
||||
details["publicIpcConnected"] = trackedAttempt.PublicIpcConnected.ToString();
|
||||
details["shellStatus"] = trackedAttempt.ShellStatus;
|
||||
}
|
||||
|
||||
return details;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user