chore(web): update ESLint configuration and improve component layouts
Build, Test, and Push CFDM Docker Image / test (push) Failing after 3m29s
Build, Test, and Push CFDM Docker Image / build-and-push (push) Has been skipped
Build, Test, and Push CFDM Docker Image / create-release (push) Has been skipped
Build, Test, and Push CFDM Docker Image / update-wiki (push) Has been skipped
Build, Test, and Push CFDM Docker Image / test (push) Failing after 3m29s
Build, Test, and Push CFDM Docker Image / build-and-push (push) Has been skipped
Build, Test, and Push CFDM Docker Image / create-release (push) Has been skipped
Build, Test, and Push CFDM Docker Image / update-wiki (push) Has been skipped
- Modified ESLint configuration to include additional global ignores for better linting control. - Updated component layouts in the ReUI kit to use flexbox for improved spacing and alignment. - Refactored the CertificatesPage to optimize chart data handling and state management. - Enhanced DashboardPage with state management for current timestamp to streamline expiration checks. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -8,7 +8,7 @@ import { defineConfig, globalIgnores } from 'eslint/config'
|
|||||||
const rawHtmlElements = ['table', 'select', 'hr']
|
const rawHtmlElements = ['table', 'select', 'hr']
|
||||||
|
|
||||||
export default defineConfig([
|
export default defineConfig([
|
||||||
globalIgnores(['dist']),
|
globalIgnores(['dist', 'src/components/blocks/**']),
|
||||||
{
|
{
|
||||||
files: ['**/*.{ts,tsx}'],
|
files: ['**/*.{ts,tsx}'],
|
||||||
extends: [
|
extends: [
|
||||||
@@ -83,11 +83,8 @@ export default defineConfig([
|
|||||||
{
|
{
|
||||||
files: [
|
files: [
|
||||||
'src/components/reui/**/*.{ts,tsx}',
|
'src/components/reui/**/*.{ts,tsx}',
|
||||||
'src/components/data-grid-card.tsx',
|
'src/components/reui-kit/**/*.{ts,tsx}',
|
||||||
'src/components/data-grid-types.ts',
|
'src/components/columns/**/*.{ts,tsx}',
|
||||||
'src/components/data-grid-cells.tsx',
|
|
||||||
'src/components/domains-filters-toolbar.tsx',
|
|
||||||
'src/components/list-filters-bar.tsx',
|
|
||||||
],
|
],
|
||||||
rules: {
|
rules: {
|
||||||
'react-refresh/only-export-components': 'off',
|
'react-refresh/only-export-components': 'off',
|
||||||
@@ -98,6 +95,7 @@ export default defineConfig([
|
|||||||
'no-restricted-syntax': 'off',
|
'no-restricted-syntax': 'off',
|
||||||
'@typescript-eslint/no-unused-vars': 'off',
|
'@typescript-eslint/no-unused-vars': 'off',
|
||||||
'@typescript-eslint/no-unused-expressions': 'off',
|
'@typescript-eslint/no-unused-expressions': 'off',
|
||||||
|
'@typescript-eslint/no-explicit-any': 'off',
|
||||||
'prefer-const': 'off',
|
'prefer-const': 'off',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ function DetailPanelHeader({
|
|||||||
</div>
|
</div>
|
||||||
{actions ? <div className="shrink-0">{actions}</div> : null}
|
{actions ? <div className="shrink-0">{actions}</div> : null}
|
||||||
</FrameHeader>
|
</FrameHeader>
|
||||||
{children ? <FramePanel className="space-y-4">{children}</FramePanel> : null}
|
{children ? <FramePanel className="flex flex-col gap-4">{children}</FramePanel> : null}
|
||||||
</Frame>
|
</Frame>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -68,7 +68,7 @@ function DetailPanelMetrics({ cards }: { cards: DetailMetricCard[] }) {
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</FrameHeader>
|
</FrameHeader>
|
||||||
<FramePanel className="space-y-2">
|
<FramePanel className="flex flex-col gap-2">
|
||||||
<p className="text-muted-foreground text-xs leading-relaxed">
|
<p className="text-muted-foreground text-xs leading-relaxed">
|
||||||
{card.description}
|
{card.description}
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ function KpiCardItem({ card }: { card: OpsKpiCard }) {
|
|||||||
<h3 className="truncate text-sm leading-tight font-medium">{card.title}</h3>
|
<h3 className="truncate text-sm leading-tight font-medium">{card.title}</h3>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="mt-5 space-y-1.5">
|
<div className="mt-5 flex flex-col gap-1.5">
|
||||||
<p className="text-muted-foreground text-sm leading-tight">
|
<p className="text-muted-foreground text-sm leading-tight">
|
||||||
{card.metricLabel}
|
{card.metricLabel}
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ export function SettingsShell({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<PageShell>
|
<PageShell>
|
||||||
<div className="w-full max-w-4xl space-y-6">
|
<div className="flex w-full max-w-4xl flex-col gap-6">
|
||||||
<header className="px-1">
|
<header className="px-1">
|
||||||
<h1 className="text-xl font-semibold tracking-tight">{title}</h1>
|
<h1 className="text-xl font-semibold tracking-tight">{title}</h1>
|
||||||
<p className="text-muted-foreground max-w-2xl text-sm leading-relaxed">
|
<p className="text-muted-foreground max-w-2xl text-sm leading-relaxed">
|
||||||
|
|||||||
@@ -62,10 +62,9 @@ function CertificatesPage() {
|
|||||||
const filterFields = useCertFilterFields()
|
const filterFields = useCertFilterFields()
|
||||||
const columns = useCertificateColumns()
|
const columns = useCertificateColumns()
|
||||||
|
|
||||||
const chartData = summary?.map(([status, count]) => ({ status, count })) ?? []
|
const kpiStrip = useMemo(() => {
|
||||||
|
const chartData = summary?.map(([status, count]) => ({ status, count })) ?? []
|
||||||
const kpiStrip = useMemo(
|
return (
|
||||||
() => (
|
|
||||||
<div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-4">
|
<div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-4">
|
||||||
{chartData.length === 0 ? (
|
{chartData.length === 0 ? (
|
||||||
<Frame dense spacing="sm" className="sm:col-span-2 lg:col-span-4">
|
<Frame dense spacing="sm" className="sm:col-span-2 lg:col-span-4">
|
||||||
@@ -91,9 +90,8 @@ function CertificatesPage() {
|
|||||||
))
|
))
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
),
|
)
|
||||||
[chartData],
|
}, [summary])
|
||||||
)
|
|
||||||
|
|
||||||
const primaryAction = (
|
const primaryAction = (
|
||||||
<LoadingButton
|
<LoadingButton
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { createFileRoute, Link } from '@tanstack/react-router'
|
import { createFileRoute, Link } from '@tanstack/react-router'
|
||||||
import { useQuery } from '@tanstack/react-query'
|
import { useQuery } from '@tanstack/react-query'
|
||||||
import { useMemo } from 'react'
|
import { useMemo, useState } from 'react'
|
||||||
import {
|
import {
|
||||||
Bar,
|
Bar,
|
||||||
BarChart,
|
BarChart,
|
||||||
@@ -113,16 +113,17 @@ function DashboardPage() {
|
|||||||
.slice(0, 6)
|
.slice(0, 6)
|
||||||
}, [groups, domains])
|
}, [groups, domains])
|
||||||
|
|
||||||
|
const [nowMs] = useState(() => Date.now())
|
||||||
|
|
||||||
const expiringCerts = useMemo(() => {
|
const expiringCerts = useMemo(() => {
|
||||||
const now = Date.now()
|
|
||||||
const warnMs = 14 * 24 * 60 * 60 * 1000
|
const warnMs = 14 * 24 * 60 * 60 * 1000
|
||||||
return (certs ?? [])
|
return (certs ?? [])
|
||||||
.filter((c) => c.expires_at)
|
.filter((c) => c.expires_at)
|
||||||
.map((c) => ({ cert: c, ts: new Date(c.expires_at as string).getTime() }))
|
.map((c) => ({ cert: c, ts: new Date(c.expires_at as string).getTime() }))
|
||||||
.filter((e) => !Number.isNaN(e.ts) && e.ts - now <= warnMs)
|
.filter((e) => !Number.isNaN(e.ts) && e.ts - nowMs <= warnMs)
|
||||||
.sort((a, b) => a.ts - b.ts)
|
.sort((a, b) => a.ts - b.ts)
|
||||||
.slice(0, 8)
|
.slice(0, 8)
|
||||||
}, [certs])
|
}, [certs, nowMs])
|
||||||
|
|
||||||
const ungroupedDomains = useMemo(
|
const ungroupedDomains = useMemo(
|
||||||
() => (domains ?? []).filter((d) => d.group_id == null).slice(0, 5),
|
() => (domains ?? []).filter((d) => d.group_id == null).slice(0, 5),
|
||||||
|
|||||||
Reference in New Issue
Block a user