update settings layout

This commit is contained in:
2026-07-02 11:11:56 +02:00
parent c08e071c88
commit 9857ba6416
9 changed files with 237 additions and 71 deletions
+9
View File
@@ -69,6 +69,15 @@ export function getHostFromId(id: HostId): Host | null {
return hosts.find((host) => host.id === id) ?? null;
}
export function filterHosts(list: Host[], query: string): Host[] {
const q = query.trim().toLowerCase();
if (!q) return list;
return list.filter((host) => {
if (host.name.toLowerCase().includes(q)) return true;
return host.domains.some((domain) => domain.toLowerCase().includes(q));
});
}
export async function getHost(domain: string): Promise<Host | null> {
if (await HostSettings.getAllHostsDisabled()) return null;