- |
- toggleRow(element)}
- transitionDuration={0}
- />
- |
-
-
- {element.Names[0].replace('/', '')}
-
- |
- {width > MIN_WIDTH_MOBILE && (
-
- {element.Image}
- |
- )}
- {width > MIN_WIDTH_MOBILE && (
-
-
- {element.Ports.sort((a, b) => a.PrivatePort - b.PrivatePort)
- // Remove duplicates with filter function
- .filter(
- (port, index, self) =>
- index === self.findIndex((t) => t.PrivatePort === port.PrivatePort)
- )
- .slice(-3)
- .map((port) => (
-
- {port.PrivatePort}:{port.PublicPort}
-
- ))}
- {element.Ports.length > 3 && (
-
- {t('table.body.portCollapse', { ports: element.Ports.length - 3 })}
-
- )}
-
- |
- )}
-
-
- |
-
- );
- });
-
return (
+ |
+ toggleRow(container)} transitionDuration={0} />
+ |
+
+
+ {container.Names[0].replace('/', '')}
+
+ |
+ {width > MIN_WIDTH_MOBILE && (
+
+ {container.Image}
+ |
+ )}
+ {width > MIN_WIDTH_MOBILE && (
+
+
+ {container.Ports.sort((a, b) => a.PrivatePort - b.PrivatePort)
+ // Remove duplicates with filter function
+ .filter(
+ (port, index, self) =>
+ index === self.findIndex((t) => t.PrivatePort === port.PrivatePort)
+ )
+ .slice(-3)
+ .map((port) => (
+
+ {port.PrivatePort}:{port.PublicPort}
+
+ ))}
+ {container.Ports.length > 3 && (
+
+ {t('table.body.portCollapse', { ports: container.Ports.length - 3 })}
+
+ )}
+
+ |
+ )}
+
+
+ |
+
+ );
+};
+
+function filterContainers(data: Dockerode.ContainerInfo[], search: string) {
+ const query = search.toLowerCase().trim();
+ return data.filter((item) =>
+ item.Names.some((name) => name.toLowerCase().includes(query) || item.Image.includes(query))
+ );
+}
diff --git a/src/pages/docker.tsx b/src/pages/docker.tsx
new file mode 100644
index 000000000..b269e8c3a
--- /dev/null
+++ b/src/pages/docker.tsx
@@ -0,0 +1,44 @@
+import { Stack } from '@mantine/core';
+import { useDebouncedValue } from '@mantine/hooks';
+import { ContainerInfo } from 'dockerode';
+import { GetServerSideProps } from 'next';
+import { useTranslation } from 'next-i18next';
+import { useState } from 'react';
+import { MainLayout } from '~/components/layout/main';
+import ContainerActionBar from '~/modules/Docker/ContainerActionBar';
+import DockerTable from '~/modules/Docker/DockerTable';
+import { getServerSideTranslations } from '~/tools/server/getServerSideTranslations';
+import { dashboardNamespaces } from '~/tools/server/translation-namespaces';
+import { api } from '~/utils/api';
+
+export default function DockerPage() {
+ const [selection, setSelection] = useState