Files
dashcaddy/desktop/Models/ServiceModels.cs
T
Hermes 86e4c9fc81 wip: Windows desktop app scaffold (WinUI 3/.NET 8) + NSIS installer + docs
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).
2026-08-22 23:50:34 -07:00

98 lines
2.6 KiB
C#

using System.Collections.Generic;
using System.Text.Json.Serialization;
namespace DashCaddy.Desktop.Models;
public class ServiceModel
{
[JsonPropertyName("id")]
public string Id { get; set; }
[JsonPropertyName("name")]
public string Name { get; set; }
[JsonPropertyName("type")]
public string Type { get; set; }
[JsonPropertyName("url")]
public string Url { get; set; }
[JsonPropertyName("port")]
public int Port { get; set; }
[JsonPropertyName("host")]
public string Host { get; set; }
[JsonPropertyName("health")]
public string Health { get; set; }
[JsonPropertyName("state")]
public string State { get; set; }
[JsonPropertyName("environment")]
public Dictionary<string, string> Environment { get; set; } = new();
[JsonPropertyName("volumes")]
public List<string> Volumes { get; set; } = new();
[JsonPropertyName("labels")]
public Dictionary<string, string> Labels { get; set; } = new();
[JsonPropertyName("image")]
public string Image { get; set; }
[JsonPropertyName("composeFile")]
public string ComposeFile { get; set; }
}
public class HealthResponse
{
[JsonPropertyName("status")]
public string Status { get; set; }
[JsonPropertyName("dns")]
public string Dns { get; set; }
[JsonPropertyName("certs")]
public string Certs { get; set; }
[JsonPropertyName("certsDaysRemaining")]
public int CertsDaysRemaining { get; set; }
[JsonPropertyName("services")]
public ServiceHealthSummary[] Services { get; set; }
}
public class ServiceHealthSummary
{
[JsonPropertyName("id")]
public string Id { get; set; }
[JsonPropertyName("name")]
public string Name { get; set; }
[JsonPropertyName("health")]
public string Health { get; set; }
[JsonPropertyName("lastCheck")]
public string LastCheck { get; set; }
}
public class ComposeService
{
public string Name { get; set; }
public string Image { get; set; }
public Dictionary<string, string> Ports { get; set; } = new();
public Dictionary<string, string> Environment { get; set; } = new();
public List<string> Volumes { get; set; } = new();
public Dictionary<string, string> Labels { get; set; } = new();
public Dictionary<string, object> Deploy { get; set; } = new();
}
public class ComposeFile
{
public string Version { get; set; }
public Dictionary<string, ComposeService> Services { get; set; } = new();
public Dictionary<string, object> Networks { get; set; } = new();
public Dictionary<string, object> Volumes { get; set; } = new();
}