fix(ui): перенести таблицы сборщика и проб на ReUI v9
This commit is contained in:
1 parent
f81b35308b
commit
ddf1851e92
5 files changed
+114
-30
No files matched your search
@@ -1,22 +1,23 @@
|
||||
"use client"
|
||||
|
||||
import { dataGridFeatures, type DataGridFeatures } from "@/components/reui/data-grid"
|
||||
|
||||
import { useMemo } from "react"
|
||||
import {
|
||||
type ColumnDef,
|
||||
getCoreRowModel,
|
||||
useReactTable,
|
||||
} from "@tanstack/react-table-v8"
|
||||
useTable,
|
||||
} from "@tanstack/react-table"
|
||||
import type { SchedulerJobStatusDto } from "@/lib/scheduler-settings"
|
||||
import { FormToggle } from "@/components/form-kit"
|
||||
import { Badge } from "@/components/reui/badge"
|
||||
import { Button } from "@/components/ui/button"
|
||||
import { Input } from "@/components/ui/input"
|
||||
import { DataGridShell } from "@/components/data-grids/shared/legacy-data-grid-shell"
|
||||
import { DataGridShell } from "@/components/data-grids/shared/data-grid-shell"
|
||||
import {
|
||||
DATA_GRID_CELL_PAD,
|
||||
DATA_GRID_CELL_PAD_FIRST,
|
||||
DATA_GRID_CELL_PAD_LAST,
|
||||
} from "@/components/data-grids/shared/legacy-data-grid-layout"
|
||||
} from "@/components/data-grids/shared/data-grid-layout"
|
||||
import { cn } from "@/lib/utils"
|
||||
import { RefreshCwIcon } from "lucide-react"
|
||||
|
||||
@@ -44,7 +45,7 @@ interface DataCollectionSchedulerDataGridProps {
|
||||
}
|
||||
|
||||
function DataCollectionSchedulerDataGrid({ rows }: DataCollectionSchedulerDataGridProps) {
|
||||
const columns = useMemo<ColumnDef<SchedulerJobGridRow>[]>(
|
||||
const columns = useMemo<ColumnDef<DataGridFeatures, SchedulerJobGridRow>[]>(
|
||||
() => [
|
||||
{
|
||||
id: "task",
|
||||
@@ -185,6 +186,7 @@ function DataCollectionSchedulerDataGrid({ rows }: DataCollectionSchedulerDataGr
|
||||
className="h-8"
|
||||
disabled={r.job?.running || r.runNowLoading}
|
||||
onClick={r.onRunNow}
|
||||
aria-label={`Запустить: ${r.label}`}
|
||||
>
|
||||
<RefreshCwIcon className={cn("size-3.5", r.runNowLoading && "animate-spin")} />
|
||||
</Button>
|
||||
@@ -200,10 +202,12 @@ function DataCollectionSchedulerDataGrid({ rows }: DataCollectionSchedulerDataGr
|
||||
[],
|
||||
)
|
||||
|
||||
const table = useReactTable({
|
||||
const table = useTable({
|
||||
features: dataGridFeatures,
|
||||
manualPagination: true,
|
||||
manualSorting: true,
|
||||
data: rows,
|
||||
columns,
|
||||
getCoreRowModel: getCoreRowModel(),
|
||||
getRowId: (row) => row.id,
|
||||
})
|
||||
|
||||
|
||||
Reference in new issue
Block a user