mirror of
https://github.com/alexhopeoconnor/dnsmasq-webui.git
synced 2026-10-22 13:57:50 +10:00
UI, logging, and settings improvements
- Add app version to sidebar footer with link to GitHub release - CSS cache busting: append version query string to static assets - Remove LogEvents; improve startup logging with version, env, paths, uptime - Settings modal: collapsible groups with search-aware expand/collapse - Release workflow and publish script: pass version from tag for builds
This commit is contained in:
@@ -69,4 +69,25 @@ public static class SettingsModalSections
|
||||
if (!All.TryGetValue(key, out var meta)) return false;
|
||||
return meta.SearchableText.Contains(searchTerm.Trim(), StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
/// <summary>Collapsible group: display name and the section keys it contains.</summary>
|
||||
public sealed record CollapsibleGroup(string Id, string DisplayName, string[] SectionKeys);
|
||||
|
||||
/// <summary>Groups for the collapsible settings UI. Order determines display order.</summary>
|
||||
public static readonly IReadOnlyList<CollapsibleGroup> Groups =
|
||||
[
|
||||
new CollapsibleGroup("service", "Service status", [ServiceStatus]),
|
||||
new CollapsibleGroup("dnsmasq-logs", "Dnsmasq logs", [Logs, RecentLogsDisplay]),
|
||||
new CollapsibleGroup("app-logs", "App logs", [AppLogs, AppLogsDisplay]),
|
||||
new CollapsibleGroup("leases", "DHCP leases", [Leases]),
|
||||
];
|
||||
|
||||
/// <summary>Whether a group should be shown: for context mode, any child section matches; for All+search, any child matches search.</summary>
|
||||
public static bool GroupMatchesContextOrSearch(CollapsibleGroup group, SettingsModalContext context, string searchTerm)
|
||||
{
|
||||
var keys = GetSectionKeysForContext(context);
|
||||
if (keys != null)
|
||||
return group.SectionKeys.Any(k => keys.Contains(k, StringComparer.OrdinalIgnoreCase));
|
||||
return group.SectionKeys.Any(k => MatchesSearch(k, searchTerm));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user