Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Add inline detail drawers to Docker and K8s workload tables

rcourtman957946518e05
diff --git a/frontend-modern/src/features/docker/DockerContainersTable.tsx b/frontend-modern/src/features/docker/DockerContainersTable.tsx
index 57ea7e3232..d26fa93866 100644
--- a/frontend-modern/src/features/docker/DockerContainersTable.tsx
+++ b/frontend-modern/src/features/docker/DockerContainersTable.tsx
@@ -21,6 +21,12 @@ import {
getPlatformTableCellClassForKind,
getPlatformTableHeadClassForKind,
} from '@/features/platformPage/sharedPlatformPage';
+import {
+ PlatformResourceDetailTableRow,
+ createPlatformResourceDetailState,
+ createPlatformResourceLabelResolver,
+ getPlatformResourceDetailRowClass,
+} from '@/features/platformPage/PlatformResourceDetailTableRow';
import {
DockerResourceNameCell,
dockerHostName,
@@ -129,6 +135,8 @@ export const DockerContainersTable: Component<DockerNativeTableProps> = (props)
filter: filterDockerResources,
});
const sortedRows = createMemo(() => [...tableState.filtered()].sort(compareDockerContainers));
+ const drawer = createPlatformResourceDetailState({ idPrefix: 'docker-container-drawer' });
+ const resolveResourceLabel = createPlatformResourceLabelResolver(() => props.resources);
return (
<Show
@@ -234,13 +242,21 @@ export const DockerContainersTable: Component<DockerNativeTableProps> = (props)
const mounts = () => mountsSummary(resource);
const updates = () => updateStatusLabel(resource);
const updateTitle = () => updateStatusTitle(resource);
+ const detailRowId = () => drawer.detailRowId(resource);
+ const isExpanded = () => drawer.isExpanded(resource);
return (
- <TableRow
- class="text-[11px] sm:text-xs"
- data-docker-container-row={resource.id}
- >
- <DockerResourceNameCell resource={resource} indicator={indicator} />
+ <>
+ <TableRow
+ class={`${getPlatformResourceDetailRowClass(isExpanded())} text-[11px] sm:text-xs`}
+ aria-controls={isExpanded() ? detailRowId() : undefined}
+ aria-expanded={isExpanded() ? 'true' : 'false'}
+ data-docker-container-row={resource.id}
+ onClick={() => drawer.toggle(resource)}
+ onKeyDown={drawer.handleActivationKey(resource)}
+ tabIndex={0}
+ >
+ <DockerResourceNameCell resource={resource} indicator={indicator} />
<TableCell
class={`${getPlatformTableCellClassForKind('text')} hidden text-base-content md:table-cell`}
>
@@ -308,7 +324,16 @@ export const DockerContainersTable: Component<DockerNativeTableProps> = (props)
{updates()}
</span>
</TableCell>
- </TableRow>
+ </TableRow>
+ <PlatformResourceDetailTableRow
+ resource={resource}
+ open={isExpanded()}
+ detailRowId={detailRowId()}
+ colSpan={11}
+ resolveResourceLabel={resolveResourceLabel}
+ onClose={() => drawer.close(resource)}
+ />
+ </>
);
}}
</For>
diff --git a/frontend-modern/src/features/docker/DockerImagesTable.tsx b/frontend-modern/src/features/docker/DockerImagesTable.tsx
index 25ebfe8fc7..def6f55f9a 100644
--- a/frontend-modern/src/features/docker/DockerImagesTable.tsx
+++ b/frontend-modern/src/features/docker/DockerImagesTable.tsx
@@ -20,6 +20,12 @@ import {
getPlatformTableCellClassForKind,
getPlatformTableHeadClassForKind,
} from '@/features/platformPage/sharedPlatformPage';
+import {
+ PlatformResourceDetailTableRow,
+ createPlatformResourceDetailState,
+ createPlatformResourceLabelResolver,
+ getPlatformResourceDetailRowClass,
+} from '@/features/platformPage/PlatformResourceDetailTableRow';
import {
DockerResourceNameCell,
dockerByteValue,
@@ -36,6 +42,8 @@ export const DockerImagesTable: Component<DockerNativeTableProps> = (props) => {
initialStatus: 'all' as DockerResourceStatusFilter,
filter: filterDockerResources,
});
+ const drawer = createPlatformResourceDetailState({ idPrefix: 'docker-image-drawer' });
+ const resolveResourceLabel = createPlatformResourceLabelResolver(() => props.resources);
return (
<Show
@@ -108,46 +116,68 @@ export const DockerImagesTable: Component<DockerNativeTableProps> = (props) => {
</TableHeader>
<TableBody class={PLATFORM_TABLE_BODY_CLASS}>
<For each={tableState.filtered()}>
- {(resource) => (
- <TableRow class="text-[11px] sm:text-xs" data-docker-image-row={resource.id}>
- <DockerResourceNameCell resource={resource} />
- <TableCell
- class={`${getPlatformTableCellClassForKind('text')} text-base-content`}
- >
- <span
- class="inline-block max-w-[18rem] truncate"
- title={dockerJoinValues(resource.docker?.repoTags)}
- >
- {dockerJoinValues(resource.docker?.repoTags)}
- </span>
- </TableCell>
- <TableCell
- class={`${getPlatformTableCellClassForKind('text')} hidden text-base-content md:table-cell`}
- >
- <span
- class="inline-block max-w-[22rem] truncate"
- title={dockerJoinValues(resource.docker?.repoDigests)}
+ {(resource) => {
+ const detailRowId = () => drawer.detailRowId(resource);
+ const isExpanded = () => drawer.isExpanded(resource);
+ return (
+ <>
+ <TableRow
+ class={`${getPlatformResourceDetailRowClass(isExpanded())} text-[11px] sm:text-xs`}
+ aria-controls={isExpanded() ? detailRowId() : undefined}
+ aria-expanded={isExpanded() ? 'true' : 'false'}
+ data-docker-image-row={resource.id}
+ onClick={() => drawer.toggle(resource)}
+ onKeyDown={drawer.handleActivationKey(resource)}
+ tabIndex={0}
>
- {dockerJoinValues(resource.docker?.repoDigests)}
- </span>
- </TableCell>
- <TableCell
- class={`${getPlatformTableCellClassForKind('numeric-value')} text-base-content`}
- >
- {dockerByteValue(resource.docker?.sizeBytes)}
- </TableCell>
- <TableCell
- class={`${getPlatformTableCellClassForKind('numeric-value')} text-base-content`}
- >
- {dockerNumberValue(resource.docker?.imageContainers)}
- </TableCell>
- <TableCell
- class={`${getPlatformTableCellClassForKind('text')} hidden text-base-content md:table-cell`}
- >
- {dockerHostName(resource)}
- </TableCell>
- </TableRow>
- )}
+ <DockerResourceNameCell resource={resource} />
+ <TableCell
+ class={`${getPlatformTableCellClassForKind('text')} text-base-content`}
+ >
+ <span
+ class="inline-block max-w-[18rem] truncate"
+ title={dockerJoinValues(resource.docker?.repoTags)}
+ >
+ {dockerJoinValues(resource.docker?.repoTags)}
+ </span>
+ </TableCell>
+ <TableCell
+ class={`${getPlatformTableCellClassForKind('text')} hidden text-base-content md:table-cell`}
+ >
+ <span
+ class="inline-block max-w-[22rem] truncate"
+ title={dockerJoinValues(resource.docker?.repoDigests)}
+ >
+ {dockerJoinValues(resource.docker?.repoDigests)}
+ </span>
+ </TableCell>
+ <TableCell
+ class={`${getPlatformTableCellClassForKind('numeric-value')} text-base-content`}
+ >
+ {dockerByteValue(resource.docker?.sizeBytes)}
+ </TableCell>
+ <TableCell
+ class={`${getPlatformTableCellClassForKind('numeric-value')} text-base-content`}
+ >
+ {dockerNumberValue(resource.docker?.imageContainers)}
+ </TableCell>
+ <TableCell
+ class={`${getPlatformTableCellClassForKind('text')} hidden text-base-content md:table-cell`}
+ >
+ {dockerHostName(resource)}
+ </TableCell>
+ </TableRow>
+ <PlatformResourceDetailTableRow
+ resource={resource}
+ open={isExpanded()}
+ detailRowId={detailRowId()}
+ colSpan={6}
+ resolveResourceLabel={resolveResourceLabel}
+ onClose={() => drawer.close(resource)}
+ />
+ </>
+ );
+ }}
</For>
</TableBody>
</Table>
diff --git a/frontend-modern/src/features/docker/DockerVolumesTable.tsx b/frontend-modern/src/features/docker/DockerVolumesTable.tsx
index 3de5b2d811..02b6b8771a 100644
--- a/frontend-modern/src/features/docker/DockerVolumesTable.tsx
+++ b/frontend-modern/src/features/docker/DockerVolumesTable.tsx
@@ -20,6 +20,12 @@ import {
getPlatformTableCellClassForKind,
getPlatformTableHeadClassForKind,
} from '@/features/platformPage/sharedPlatformPage';
+import {
+ PlatformResourceDetailTableRow,
+ createPlatformResourceDetailState,
+ createPlatformResourceLabelResolver,
+ getPlatformResourceDetailRowClass,
+} from '@/features/platformPage/PlatformResourceDetailTableRow';
import {
DockerResourceNameCell,
dockerByteValue,
@@ -35,6 +41,8 @@ export const DockerVolumesTable: Component<DockerNativeTableProps> = (props) =>
initialStatus: 'all' as DockerResourceStatusFilter,
filter: filterDockerResources,
});
+ const drawer = createPlatformResourceDetailState({ idPrefix: 'docker-volume-drawer' });
+ const resolveResourceLabel = createPlatformResourceLabelResolver(() => props.resources);
return (
<Show
@@ -112,51 +120,73 @@ export const DockerVolumesTable: Component<DockerNativeTableProps> = (props) =>
</TableHeader>
<TableBody class={PLATFORM_TABLE_BODY_CLASS}>
<For each={tableState.filtered()}>
- {(resource) => (
- <TableRow class="text-[11px] sm:text-xs" data-docker-volume-row={resource.id}>
- <DockerResourceNameCell resource={resource} />
- <TableCell
- class={`${getPlatformTableCellClassForKind('text')} text-base-content`}
- >
- {dockerTextValue(resource.docker?.driver)}
- </TableCell>
- <TableCell
- class={`${getPlatformTableCellClassForKind('text')} hidden text-base-content md:table-cell`}
- >
- {dockerTextValue(resource.docker?.scope)}
- </TableCell>
- <TableCell
- class={`${getPlatformTableCellClassForKind('numeric-value')} text-base-content`}
- >
- {dockerByteValue(resource.docker?.sizeBytes)}
- </TableCell>
- <TableCell
- class={`${getPlatformTableCellClassForKind('numeric-value')} hidden text-base-content md:table-cell`}
- >
- {dockerNumberValue(resource.docker?.refCount)}
- </TableCell>
- <TableCell
- class={`${getPlatformTableCellClassForKind('text')} hidden text-base-content md:table-cell`}
- >
- <span
- class="inline-block max-w-[12rem] truncate"
- title={dockerTextValue(resource.docker?.createdAt)}
- >
- {dockerTextValue(resource.docker?.createdAt)}
- </span>
- </TableCell>
- <TableCell
- class={`${getPlatformTableCellClassForKind('text')} hidden text-base-content md:table-cell`}
- >
- <span
- class="inline-block max-w-[22rem] truncate"
- title={dockerTextValue(resource.docker?.mountpoint)}
+ {(resource) => {
+ const detailRowId = () => drawer.detailRowId(resource);
+ const isExpanded = () => drawer.isExpanded(resource);
+ return (
+ <>
+ <TableRow
+ class={`${getPlatformResourceDetailRowClass(isExpanded())} text-[11px] sm:text-xs`}
+ aria-controls={isExpanded() ? detailRowId() : undefined}
+ aria-expanded={isExpanded() ? 'true' : 'false'}
+ data-docker-volume-row={resource.id}
+ onClick={() => drawer.toggle(resource)}
+ onKeyDown={drawer.handleActivationKey(resource)}
+ tabIndex={0}
>
- {dockerTextValue(resource.docker?.mountpoint)}
- </span>
- </TableCell>
- </TableRow>
- )}
+ <DockerResourceNameCell resource={resource} />
+ <TableCell
+ class={`${getPlatformTableCellClassForKind('text')} text-base-content`}
+ >
+ {dockerTextValue(resource.docker?.driver)}
+ </TableCell>
+ <TableCell
+ class={`${getPlatformTableCellClassForKind('text')} hidden text-base-content md:table-cell`}
+ >
+ {dockerTextValue(resource.docker?.scope)}
+ </TableCell>
+ <TableCell
+ class={`${getPlatformTableCellClassForKind('numeric-value')} text-base-content`}
+ >
+ {dockerByteValue(resource.docker?.sizeBytes)}
+ </TableCell>
+ <TableCell
+ class={`${getPlatformTableCellClassForKind('numeric-value')} hidden text-base-content md:table-cell`}
+ >
+ {dockerNumberValue(resource.docker?.refCount)}
+ </TableCell>
+ <TableCell
+ class={`${getPlatformTableCellClassForKind('text')} hidden text-base-content md:table-cell`}
+ >
+ <span
+ class="inline-block max-w-[12rem] truncate"
+ title={dockerTextValue(resource.docker?.createdAt)}
+ >
+ {dockerTextValue(resource.docker?.createdAt)}
+ </span>
+ </TableCell>
+ <TableCell
+ class={`${getPlatformTableCellClassForKind('text')} hidden text-base-content md:table-cell`}
+ >
+ <span
+ class="inline-block max-w-[22rem] truncate"
+ title={dockerTextValue(resource.docker?.mountpoint)}
+ >
+ {dockerTextValue(resource.docker?.mountpoint)}
+ </span>
+ </TableCell>
+ </TableRow>
+ <PlatformResourceDetailTableRow
+ resource={resource}
+ open={isExpanded()}
+ detailRowId={detailRowId()}
+ colSpan={7}
+ resolveResourceLabel={resolveResourceLabel}
+ onClose={() => drawer.close(resource)}
+ />
+ </>
+ );
+ }}
</For>
</TableBody>
</Table>
diff --git a/frontend-modern/src/features/kubernetes/KubernetesAutoscalingTable.tsx b/frontend-modern/src/features/kubernetes/KubernetesAutoscalingTable.tsx
index b20b490aec..7c14a37375 100644
--- a/frontend-modern/src/features/kubernetes/KubernetesAutoscalingTable.tsx
+++ b/frontend-modern/src/features/kubernetes/KubernetesAutoscalingTable.tsx
@@ -23,6 +23,12 @@ import {
getPlatformTableCellClassForKind,
getPlatformTableHeadClassForKind,
} from '@/features/platformPage/sharedPlatformPage';
+import {
+ PlatformResourceDetailTableRow,
+ createPlatformResourceDetailState,
+ createPlatformResourceLabelResolver,
+ getPlatformResourceDetailRowClass,
+} from '@/features/platformPage/PlatformResourceDetailTableRow';
import type { Resource } from '@/types/resource';
import {
filterKubernetesResources,
@@ -91,6 +97,8 @@ export const KubernetesAutoscalingTable: Component<{
initialStatus: 'all' as KubernetesResourceStatusFilter,
filter: filterKubernetesResources,
});
+ const drawer = createPlatformResourceDetailState({ idPrefix: 'kubernetes-autoscaling-drawer' });
+ const resolveResourceLabel = createPlatformResourceLabelResolver(() => props.resources);
return (
<Show
@@ -176,11 +184,19 @@ export const KubernetesAutoscalingTable: Component<{
const target = () => targetRef(resource);
const metrics = () => metricSources(resource);
const labels = () => labelSummary(resource);
+ const detailRowId = () => drawer.detailRowId(resource);
+ const isExpanded = () => drawer.isExpanded(resource);
return (
+ <>
<TableRow
- class="text-[11px] sm:text-xs"
+ class={`${getPlatformResourceDetailRowClass(isExpanded())} text-[11px] sm:text-xs`}
+ aria-controls={isExpanded() ? detailRowId() : undefined}
+ aria-expanded={isExpanded() ? 'true' : 'false'}
data-kubernetes-autoscaling-row={resource.id}
+ onClick={() => drawer.toggle(resource)}
+ onKeyDown={drawer.handleActivationKey(resource)}
+ tabIndex={0}
>
<TableCell class={getPlatformTableCellClassForKind('name')}>
<div class="flex min-w-0 items-center gap-2">
@@ -239,6 +255,15 @@ export const KubernetesAutoscalingTable: Component<{
</span>
</TableCell>
</TableRow>
+ <PlatformResourceDetailTableRow
+ resource={resource}
+ open={isExpanded()}
+ detailRowId={detailRowId()}
+ colSpan={8}
+ resolveResourceLabel={resolveResourceLabel}
+ onClose={() => drawer.close(resource)}
+ />
+ </>
);
}}
</For>
diff --git a/frontend-modern/src/features/kubernetes/KubernetesConfigTable.tsx b/frontend-modern/src/features/kubernetes/KubernetesConfigTable.tsx
index 91afbc01ba..01a5a7abed 100644
--- a/frontend-modern/src/features/kubernetes/KubernetesConfigTable.tsx
+++ b/frontend-modern/src/features/kubernetes/KubernetesConfigTable.tsx
@@ -23,6 +23,12 @@ import {
getPlatformTableCellClassForKind,
getPlatformTableHeadClassForKind,
} from '@/features/platformPage/sharedPlatformPage';
+import {
+ PlatformResourceDetailTableRow,
+ createPlatformResourceDetailState,
+ createPlatformResourceLabelResolver,
+ getPlatformResourceDetailRowClass,
+} from '@/features/platformPage/PlatformResourceDetailTableRow';
import type { Resource } from '@/types/resource';
import {
filterKubernetesResources,
@@ -193,6 +199,8 @@ export const KubernetesConfigTable: Component<{
initialStatus: 'all' as KubernetesResourceStatusFilter,
filter: filterKubernetesResources,
});
+ const drawer = createPlatformResourceDetailState({ idPrefix: 'kubernetes-config-drawer' });
+ const resolveResourceLabel = createPlatformResourceLabelResolver(() => props.resources);
return (
<Show
@@ -277,11 +285,19 @@ export const KubernetesConfigTable: Component<{
const data = () => dataShape(resource);
const refs = () => serviceAccountRefs(resource);
const labels = () => labelSummary(resource);
+ const detailRowId = () => drawer.detailRowId(resource);
+ const isExpanded = () => drawer.isExpanded(resource);
return (
+ <>
<TableRow
- class="text-[11px] sm:text-xs"
+ class={`${getPlatformResourceDetailRowClass(isExpanded())} text-[11px] sm:text-xs`}
+ aria-controls={isExpanded() ? detailRowId() : undefined}
+ aria-expanded={isExpanded() ? 'true' : 'false'}
data-kubernetes-config-row={resource.id}
+ onClick={() => drawer.toggle(resource)}
+ onKeyDown={drawer.handleActivationKey(resource)}
+ tabIndex={0}
>
<TableCell class={getPlatformTableCellClassForKind('name')}>
<div class="flex min-w-0 items-center gap-2">
@@ -335,6 +351,15 @@ export const KubernetesConfigTable: Component<{
</span>
</TableCell>
</TableRow>
+ <PlatformResourceDetailTableRow
+ resource={resource}
+ open={isExpanded()}
+ detailRowId={detailRowId()}
+ colSpan={7}
+ resolveResourceLabel={resolveResourceLabel}
+ onClose={() => drawer.close(resource)}
+ />
+ </>
);
}}
</For>
diff --git a/frontend-modern/src/features/kubernetes/KubernetesControllersTable.tsx b/frontend-modern/src/features/kubernetes/KubernetesControllersTable.tsx
index 4398ae3ebc..7be397d328 100644
--- a/frontend-modern/src/features/kubernetes/KubernetesControllersTable.tsx
+++ b/frontend-modern/src/features/kubernetes/KubernetesControllersTable.tsx
@@ -23,6 +23,12 @@ import {
getPlatformTableCellClassForKind,
getPlatformTableHeadClassForKind,
} from '@/features/platformPage/sharedPlatformPage';
+import {
+ PlatformResourceDetailTableRow,
+ createPlatformResourceDetailState,
+ createPlatformResourceLabelResolver,
+ getPlatformResourceDetailRowClass,
+} from '@/features/platformPage/PlatformResourceDetailTableRow';
import type { Resource } from '@/types/resource';
import {
compareKubernetesControllers,
@@ -179,6 +185,8 @@ export const KubernetesControllersTable: Component<{
const sortedRows = createMemo(() =>
[...tableState.filtered()].sort(compareKubernetesControllers),
);
+ const drawer = createPlatformResourceDetailState({ idPrefix: 'kubernetes-controller-drawer' });
+ const resolveResourceLabel = createPlatformResourceLabelResolver(() => props.resources);
return (
<Show
@@ -270,11 +278,19 @@ export const KubernetesControllersTable: Component<{
const target = () => targetValue(resource);
const exceptions = () => exceptionSummary(resource);
const detail = () => apiDetail(resource);
+ const detailRowId = () => drawer.detailRowId(resource);
+ const isExpanded = () => drawer.isExpanded(resource);
return (
+ <>
<TableRow
- class="text-[11px] sm:text-xs"
+ class={`${getPlatformResourceDetailRowClass(isExpanded())} text-[11px] sm:text-xs`}
+ aria-controls={isExpanded() ? detailRowId() : undefined}
+ aria-expanded={isExpanded() ? 'true' : 'false'}
data-kubernetes-controller-row={resource.id}
+ onClick={() => drawer.toggle(resource)}
+ onKeyDown={drawer.handleActivationKey(resource)}
+ tabIndex={0}
>
<TableCell class={getPlatformTableCellClassForKind('name')}>
<div class="flex min-w-0 items-center gap-2">
@@ -338,6 +354,15 @@ export const KubernetesControllersTable: Component<{
</span>
</TableCell>
</TableRow>
+ <PlatformResourceDetailTableRow
+ resource={resource}
+ open={isExpanded()}
+ detailRowId={detailRowId()}
+ colSpan={9}
+ resolveResourceLabel={resolveResourceLabel}
+ onClose={() => drawer.close(resource)}
+ />
+ </>
);
}}
</For>
diff --git a/frontend-modern/src/features/kubernetes/KubernetesDeploymentsTable.tsx b/frontend-modern/src/features/kubernetes/KubernetesDeploymentsTable.tsx
index 856b530d8d..0a673cdd4b 100644
--- a/frontend-modern/src/features/kubernetes/KubernetesDeploymentsTable.tsx
+++ b/frontend-modern/src/features/kubernetes/KubernetesDeploymentsTable.tsx
@@ -23,6 +23,12 @@ import {
getPlatformTableCellClassForKind,
getPlatformTableHeadClassForKind,
} from '@/features/platformPage/sharedPlatformPage';
+import {
+ PlatformResourceDetailTableRow,
+ createPlatformResourceDetailState,
+ createPlatformResourceLabelResolver,
+ getPlatformResourceDetailRowClass,
+} from '@/features/platformPage/PlatformResourceDetailTableRow';
import type { Resource } from '@/types/resource';
import {
compareKubernetesDeployments,
@@ -63,6 +69,8 @@ export const KubernetesDeploymentsTable: Component<{
const sortedRows = createMemo(() =>
[...tableState.filtered()].sort(compareKubernetesDeployments),
);
+ const drawer = createPlatformResourceDetailState({ idPrefix: 'kubernetes-deployment-drawer' });
+ const resolveResourceLabel = createPlatformResourceLabelResolver(() => props.resources);
return (
<Show
@@ -168,10 +176,18 @@ export const KubernetesDeploymentsTable: Component<{
'—';
const indicator = () => mapKubernetesDeploymentStatus(deployment);
const age = () => formatAge(deployment.kubernetes?.createdAt);
+ const detailRowId = () => drawer.detailRowId(deployment);
+ const isExpanded = () => drawer.isExpanded(deployment);
return (
+ <>
<TableRow
- class="text-[11px] sm:text-xs"
+ class={`${getPlatformResourceDetailRowClass(isExpanded())} text-[11px] sm:text-xs`}
+ aria-controls={isExpanded() ? detailRowId() : undefined}
+ aria-expanded={isExpanded() ? 'true' : 'false'}
data-kubernetes-deployment-row={deployment.id}
+ onClick={() => drawer.toggle(deployment)}
+ onKeyDown={drawer.handleActivationKey(deployment)}
+ tabIndex={0}
>
<TableCell class={getPlatformTableCellClassForKind('name')}>
<div class="flex min-w-0 items-center gap-2">
@@ -229,6 +245,15 @@ export const KubernetesDeploymentsTable: Component<{
</span>
</TableCell>
</TableRow>
+ <PlatformResourceDetailTableRow
+ resource={deployment}
+ open={isExpanded()}
+ detailRowId={detailRowId()}
+ colSpan={9}
+ resolveResourceLabel={resolveResourceLabel}
+ onClose={() => drawer.close(deployment)}
+ />
+ </>
);
}}
</For>
diff --git a/frontend-modern/src/features/kubernetes/KubernetesEventsTable.tsx b/frontend-modern/src/features/kubernetes/KubernetesEventsTable.tsx
index f748e8f22c..eaa6f62c1f 100644
--- a/frontend-modern/src/features/kubernetes/KubernetesEventsTable.tsx
+++ b/frontend-modern/src/features/kubernetes/KubernetesEventsTable.tsx
@@ -22,6 +22,12 @@ import {
getPlatformTableCellClassForKind,
getPlatformTableHeadClassForKind,
} from '@/features/platformPage/sharedPlatformPage';
+import {
+ PlatformResourceDetailTableRow,
+ createPlatformResourceDetailState,
+ createPlatformResourceLabelResolver,
+ getPlatformResourceDetailRowClass,
+} from '@/features/platformPage/PlatformResourceDetailTableRow';
import type { Resource } from '@/types/resource';
import {
compareKubernetesEvents,
@@ -75,6 +81,8 @@ export const KubernetesEventsTable: Component<{
initialStatus: 'all' as KubernetesResourceStatusFilter,
filter: filterKubernetesResources,
});
+ const drawer = createPlatformResourceDetailState({ idPrefix: 'kubernetes-event-drawer' });
+ const resolveResourceLabel = createPlatformResourceLabelResolver(() => props.resources);
return (
<Show
@@ -158,11 +166,19 @@ export const KubernetesEventsTable: Component<{
const scope = () => eventScope(resource);
const observed = () => observedTime(resource);
const message = () => textValue(resource.kubernetes?.message);
+ const detailRowId = () => drawer.detailRowId(resource);
+ const isExpanded = () => drawer.isExpanded(resource);
return (
+ <>
<TableRow
- class="text-[11px] sm:text-xs"
+ class={`${getPlatformResourceDetailRowClass(isExpanded())} text-[11px] sm:text-xs`}
+ aria-controls={isExpanded() ? detailRowId() : undefined}
+ aria-expanded={isExpanded() ? 'true' : 'false'}
data-kubernetes-event-row={resource.id}
+ onClick={() => drawer.toggle(resource)}
+ onKeyDown={drawer.handleActivationKey(resource)}
+ tabIndex={0}
>
<TableCell class={getPlatformTableCellClassForKind('name')}>
<div class="flex min-w-0 items-center gap-2">
@@ -229,6 +245,15 @@ export const KubernetesEventsTable: Component<{
</span>
</TableCell>
</TableRow>
+ <PlatformResourceDetailTableRow
+ resource={resource}
+ open={isExpanded()}
+ detailRowId={detailRowId()}
+ colSpan={8}
+ resolveResourceLabel={resolveResourceLabel}
+ onClose={() => drawer.close(resource)}
+ />
+ </>
);
}}
</For>
diff --git a/frontend-modern/src/features/kubernetes/KubernetesPodsTable.tsx b/frontend-modern/src/features/kubernetes/KubernetesPodsTable.tsx
index fd9d9fbcc1..f7bf120792 100644
--- a/frontend-modern/src/features/kubernetes/KubernetesPodsTable.tsx
+++ b/frontend-modern/src/features/kubernetes/KubernetesPodsTable.tsx
@@ -22,6 +22,12 @@ import {
getPlatformTableCellClassForKind,
getPlatformTableHeadClassForKind,
} from '@/features/platformPage/sharedPlatformPage';
+import {
+ PlatformResourceDetailTableRow,
+ createPlatformResourceDetailState,
+ createPlatformResourceLabelResolver,
+ getPlatformResourceDetailRowClass,
+} from '@/features/platformPage/PlatformResourceDetailTableRow';
import type { Resource, ResourceKubernetesPodContainerStatus } from '@/types/resource';
import {
compareKubernetesPods,
@@ -103,6 +109,8 @@ export const KubernetesPodsTable: Component<{
filter: filterKubernetesResources,
});
const sortedRows = createMemo(() => [...tableState.filtered()].sort(compareKubernetesPods));
+ const drawer = createPlatformResourceDetailState({ idPrefix: 'kubernetes-pod-drawer' });
+ const resolveResourceLabel = createPlatformResourceLabelResolver(() => props.resources);
return (
<Show
@@ -199,11 +207,19 @@ export const KubernetesPodsTable: Component<{
const owner = () => ownerValue(resource);
const image = () => imageValue(resource);
const age = () => ageValue(resource);
+ const detailRowId = () => drawer.detailRowId(resource);
+ const isExpanded = () => drawer.isExpanded(resource);
return (
+ <>
<TableRow
- class="text-[11px] sm:text-xs"
+ class={`${getPlatformResourceDetailRowClass(isExpanded())} text-[11px] sm:text-xs`}
+ aria-controls={isExpanded() ? detailRowId() : undefined}
+ aria-expanded={isExpanded() ? 'true' : 'false'}
data-kubernetes-pod-row={resource.id}
+ onClick={() => drawer.toggle(resource)}
+ onKeyDown={drawer.handleActivationKey(resource)}
+ tabIndex={0}
>
<TableCell class={getPlatformTableCellClassForKind('name')}>
<div class="flex min-w-0 items-center gap-2">
@@ -267,6 +283,15 @@ export const KubernetesPodsTable: Component<{
{age()}
</TableCell>
</TableRow>
+ <PlatformResourceDetailTableRow
+ resource={resource}
+ open={isExpanded()}
+ detailRowId={detailRowId()}
+ colSpan={9}
+ resolveResourceLabel={resolveResourceLabel}
+ onClose={() => drawer.close(resource)}
+ />
+ </>
);
}}
</For>
diff --git a/frontend-modern/src/features/kubernetes/KubernetesPolicyTable.tsx b/frontend-modern/src/features/kubernetes/KubernetesPolicyTable.tsx
index 4cfac8d7b4..9b50627ad5 100644
--- a/frontend-modern/src/features/kubernetes/KubernetesPolicyTable.tsx
+++ b/frontend-modern/src/features/kubernetes/KubernetesPolicyTable.tsx
@@ -23,6 +23,12 @@ import {
getPlatformTableCellClassForKind,
getPlatformTableHeadClassForKind,
} from '@/features/platformPage/sharedPlatformPage';
+import {
+ PlatformResourceDetailTableRow,
+ createPlatformResourceDetailState,
+ createPlatformResourceLabelResolver,
+ getPlatformResourceDetailRowClass,
+} from '@/features/platformPage/PlatformResourceDetailTableRow';
import type { Resource } from '@/types/resource';
import {
filterKubernetesResources,
@@ -214,6 +220,8 @@ export const KubernetesPolicyTable: Component<{
initialStatus: 'all' as KubernetesResourceStatusFilter,
filter: filterKubernetesResources,
});
+ const drawer = createPlatformResourceDetailState({ idPrefix: 'kubernetes-policy-drawer' });
+ const resolveResourceLabel = createPlatformResourceLabelResolver(() => props.resources);
return (
<Show
@@ -300,11 +308,19 @@ export const KubernetesPolicyTable: Component<{
const spec = () => policySpec(resource);
const state = () => policyState(resource);
const labels = () => labelSummary(resource);
+ const detailRowId = () => drawer.detailRowId(resource);
+ const isExpanded = () => drawer.isExpanded(resource);
return (
+ <>
<TableRow
- class="text-[11px] sm:text-xs"
+ class={`${getPlatformResourceDetailRowClass(isExpanded())} text-[11px] sm:text-xs`}
+ aria-controls={isExpanded() ? detailRowId() : undefined}
+ aria-expanded={isExpanded() ? 'true' : 'false'}
data-kubernetes-policy-row={resource.id}
+ onClick={() => drawer.toggle(resource)}
+ onKeyDown={drawer.handleActivationKey(resource)}
+ tabIndex={0}
>
<TableCell class={getPlatformTableCellClassForKind('name')}>
<div class="flex min-w-0 items-center gap-2">
@@ -360,6 +376,15 @@ export const KubernetesPolicyTable: Component<{
</span>
</TableCell>
</TableRow>
+ <PlatformResourceDetailTableRow
+ resource={resource}
+ open={isExpanded()}
+ detailRowId={detailRowId()}
+ colSpan={7}
+ resolveResourceLabel={resolveResourceLabel}
+ onClose={() => drawer.close(resource)}
+ />
+ </>
);
}}
</For>