Owner decision pending (STATE.md DC-100 tick): adopt/ship/park. Preserved from fragile git stash to named branch 2026-08-23. NOTE: requires a Windows build machine (WinUI XAML compiler + MSIX do not cross-build on Linux) — see WINDOWS_APP_BUILD.md in this tree. Secret-scanned clean 2026-08-23 (no keys/tokens/PEM in tree).
39 lines
822 B
C#
39 lines
822 B
C#
using CommunityToolkit.Mvvm.ComponentModel;
|
|
|
|
namespace DashCaddy.Desktop.ViewModels;
|
|
|
|
public enum ServiceHealth
|
|
{
|
|
Healthy,
|
|
Degraded,
|
|
Unhealthy,
|
|
Unknown
|
|
}
|
|
|
|
public partial class ServiceViewModel : ObservableObject
|
|
{
|
|
public string Id { get; set; }
|
|
public string Name { get; set; }
|
|
public string Type { get; set; }
|
|
public string Url { get; set; }
|
|
public int Port { get; set; }
|
|
public string Host { get; set; }
|
|
|
|
[ObservableProperty]
|
|
private ServiceHealth _health;
|
|
|
|
[ObservableProperty]
|
|
private bool _isRunning;
|
|
|
|
public ServiceModel ToServiceModel() => new()
|
|
{
|
|
Id = Id,
|
|
Name = Name,
|
|
Type = Type,
|
|
Url = Url,
|
|
Port = Port,
|
|
Host = Host,
|
|
Health = Health,
|
|
State = IsRunning ? "running" : "stopped"
|
|
};
|
|
} |