Files
dnsmasq-webui/src/DnsmasqWebUI/Models/Hosts/HostsPageRow.cs
T
alex c7e7844ce7 Update hosts workflow and align DHCP metadata.
Redesign the Hosts page around source-aware grouped rows with shared table shell styling, fix effective-config save session synchronization, and move read-ethers into the DHCP model where dnsmasq actually applies it.
2026-03-26 00:24:21 +10:00

33 lines
959 B
C#

namespace DnsmasqWebUI.Models.Hosts;
/// <summary>
/// Source kind for a hosts row. Used to distinguish editable managed rows from read-only sources.
/// </summary>
public enum HostsRowSourceKind
{
/// <summary>Managed hosts file (editable by the app).</summary>
Managed,
/// <summary>System hosts file (e.g. /etc/hosts).</summary>
SystemHosts,
/// <summary>Additional hosts file (addn-hosts=).</summary>
AddnHosts,
/// <summary>Hosts directory (hostsdir=).</summary>
Hostsdir
}
/// <summary>
/// Unified row model for the Hosts page. Preserves source awareness while allowing a single rich table.
/// </summary>
public sealed record HostsPageRow(
string Id,
HostsRowSourceKind SourceKind,
string SourcePath,
bool IsEditable,
bool IsActive,
string? InactiveReason,
string Address,
IReadOnlyList<string> Names,
IReadOnlyList<string> EffectiveNames,
bool IsComment,
int LineNumber);