From 953324162491b46dcf6fe6db45a421645c31b9fe Mon Sep 17 00:00:00 2001 From: Denozordec Date: Tue, 31 Mar 2026 19:07:04 +0700 Subject: [PATCH] Refactor data table components for improved layout and functionality - Made the `title` prop optional in `DataTableCard`, allowing for more flexible usage without a title. - Updated the rendering logic in `DataTableCard` to conditionally display the title and description. - Enhanced the styling of table headers across various pages for a more consistent appearance, removing unnecessary backdrop blur effects. - Replaced button elements with native button tags in `SortableTh` for better accessibility and semantic HTML. --- .../data-table/data-table-card.svelte | 17 +++++++----- .../components/data-table/sortable-th.svelte | 27 ++++++++++++------- web/src/routes/+page.svelte | 12 ++++----- web/src/routes/incidents/+page.svelte | 4 +-- web/src/routes/ips/+page.svelte | 4 +-- web/src/routes/live/+page.svelte | 4 +-- web/src/routes/users/+page.svelte | 15 +++++------ 7 files changed, 46 insertions(+), 37 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 5808074..419df3c 100644 --- a/web/src/lib/components/data-table/data-table-card.svelte +++ b/web/src/lib/components/data-table/data-table-card.svelte @@ -10,7 +10,8 @@ toolbar, children }: { - title: string; + /** Без title — как в shadcn dashboard-01: сразу toolbar и таблица */ + title?: string; description?: string; toolbar?: Snippet; children: Snippet; @@ -19,12 +20,14 @@ -
- {title} - {#if description} - {description} - {/if} -
+ {#if title} +
+ {title} + {#if description} + {description} + {/if} +
+ {/if} {#if toolbar} {@render toolbar()} {/if} diff --git a/web/src/lib/components/data-table/sortable-th.svelte b/web/src/lib/components/data-table/sortable-th.svelte index 621993b..e75724b 100644 --- a/web/src/lib/components/data-table/sortable-th.svelte +++ b/web/src/lib/components/data-table/sortable-th.svelte @@ -1,6 +1,5 @@ - - + diff --git a/web/src/routes/+page.svelte b/web/src/routes/+page.svelte index 8adcb96..ec05a59 100644 --- a/web/src/routes/+page.svelte +++ b/web/src/routes/+page.svelte @@ -666,8 +666,8 @@ {/snippet} - - + + - - + + - - + + - - + + - - + + - - + + {/snippet} {#snippet children()} - + {#snippet toolbar()}
- - + + {#if pageUsernames.length > 0} Имя Истекает - + + Действия +