From 7c6892ce0e36bd96ba1222be906b44a44e3d3dd6 Mon Sep 17 00:00:00 2001 From: Denozordec Date: Fri, 10 Apr 2026 17:19:49 +0700 Subject: [PATCH] Enhance DataTableCard component with accent and icon support - Added accent and icon properties to the DataTableCard component for improved visual distinction and context. - Updated multiple pages to utilize the new accent feature, enhancing the user interface with color-coded cards. - Incorporated icons in DataTableCard instances across various routes for better representation of content. --- .../data-table/data-table-card.svelte | 38 ++++++++++++++++--- web/src/routes/+page.svelte | 7 ++++ web/src/routes/incidents/+page.svelte | 3 +- web/src/routes/ips/+page.svelte | 4 +- web/src/routes/live/+page.svelte | 2 + web/src/routes/mihomo/+page.svelte | 2 + web/src/routes/users/+page.svelte | 3 +- 7 files changed, 50 insertions(+), 9 deletions(-) diff --git a/web/src/lib/components/data-table/data-table-card.svelte b/web/src/lib/components/data-table/data-table-card.svelte index c3dfe00..09d1e08 100644 --- a/web/src/lib/components/data-table/data-table-card.svelte +++ b/web/src/lib/components/data-table/data-table-card.svelte @@ -1,31 +1,57 @@ - + {#if title} - {title} - {#if description} - {description} - {/if} +
+ {#if icon && accent} +
+ {@render icon()} +
+ {/if} +
+ {title} + {#if description} + {description} + {/if} +
+
{/if} {#if toolbar} diff --git a/web/src/routes/+page.svelte b/web/src/routes/+page.svelte index f935043..a9204a9 100644 --- a/web/src/routes/+page.svelte +++ b/web/src/routes/+page.svelte @@ -45,6 +45,7 @@ import GlobeIcon from '@lucide/svelte/icons/globe'; import CloudUploadIcon from '@lucide/svelte/icons/cloud-upload'; import LockIcon from '@lucide/svelte/icons/lock'; + import UsersIcon from '@lucide/svelte/icons/users'; import { nextSortDir, compareStrings, compareNum, type SortDir } from '$lib/table-sort.js'; let loading = $state(true); @@ -619,7 +620,9 @@ async function handleAliasFilterChange(nextAlias: string) { class="mb-6" title="Активные IP (агрегат)" description="С GeoIP при включённой базе на шлюзе" + accent="teal" > + {#snippet icon()}