diff --git a/app/kubernetes/components/datatables/applications-datatable-details/applications-datatable-details.controller.js b/app/kubernetes/components/datatables/applications-datatable-details/applications-datatable-details.controller.js deleted file mode 100644 index 93a1467d0..000000000 --- a/app/kubernetes/components/datatables/applications-datatable-details/applications-datatable-details.controller.js +++ /dev/null @@ -1,12 +0,0 @@ -import { KubernetesConfigurationKinds } from 'Kubernetes/models/configuration/models'; - -export default class { - $onInit() { - const secrets = (this.configurations || []) - .filter((config) => config.Data && config.Kind === KubernetesConfigurationKinds.SECRET) - .flatMap((config) => Object.entries(config.Data)) - .map(([key, value]) => ({ key, value })); - - this.state = { secrets }; - } -} diff --git a/app/kubernetes/components/datatables/applications-datatable-details/applications-datatable-details.html b/app/kubernetes/components/datatables/applications-datatable-details/applications-datatable-details.html deleted file mode 100644 index f56be4059..000000000 --- a/app/kubernetes/components/datatables/applications-datatable-details/applications-datatable-details.html +++ /dev/null @@ -1,10 +0,0 @@ -
- |
-
-
-
-
-
-
-
-
-
- |
-
- |
-
- |
-
- |
-
- |
-
-
-
-
- Filters
-
-
- |
-
- |
-
- |
-
- |
- |
---|---|---|---|---|---|---|---|---|---|
-
-
-
-
-
-
- |
- - {{ item.Name }} - - {{ item.Name }} - - system - external - | -{{ item.StackName || '-' }} | -- {{ item.ResourcePool }} - | -{{ item.Image | truncate: 64 }} + {{ item.Containers.length - 1 }} | -{{ item.ApplicationType }} | -
- {{ item.RunningPodsCount }} / {{ item.TotalPodsCount }}
- {{ item.Status }}
- |
- {{ item.Pods[0].Status }} | -- {{ item.Services.length === 0 ? 'No' : 'Yes' }} - | -{{ item.CreationDate | getisodate }} {{ item.ApplicationOwner ? 'by ' + item.ApplicationOwner : '' }} | -
- |
-
-
-
-
-
- Published URL(s)
-
-
-
-
-
- |
- ||||||||
Loading... | -|||||||||
No application available. | -
+ {secrets.map((secret) =>
+ Object.entries(secret.Data || {}).map(([key, value]) => (
+ |
+
+ {item.RunningPodsCount}
+
{' '}
+ /{' '}
+
+ {item.TotalPodsCount}
+
+
+ )}
+ {item.KubernetesApplications && {item.Status}}
+ >
+ );
+}
diff --git a/app/react/kubernetes/applications/ListView/ApplicationsDatatable/columns.tsx b/app/react/kubernetes/applications/ListView/ApplicationsDatatable/columns.tsx
new file mode 100644
index 000000000..a52e1c7d1
--- /dev/null
+++ b/app/react/kubernetes/applications/ListView/ApplicationsDatatable/columns.tsx
@@ -0,0 +1,48 @@
+import { isoDate, truncate } from '@/portainer/filters/filters';
+
+import { helper } from './columns.helper';
+
+export const stackName = helper.accessor('StackName', {
+ header: 'Stack',
+ cell: ({ getValue }) => getValue() || '-',
+});
+
+export const namespace = helper.accessor('ResourcePool', {
+ header: 'Namespace',
+ cell: ({ getValue }) => getValue() || '-',
+});
+
+export const image = helper.accessor('Image', {
+ header: 'Image',
+ cell: ({ row: { original: item } }) => (
+ <>
+ {truncate(item.Image, 64)}
+ {item.Containers && item.Containers?.length > 1 && (
+ <>+ {item.Containers.length - 1}>
+ )}
+ >
+ ),
+});
+
+export const appType = helper.accessor('ApplicationType', {
+ header: 'Application Type',
+});
+
+export const published = helper.accessor('Services', {
+ header: 'Published',
+ cell: ({ row: { original: item } }) =>
+ item.Services?.length === 0 ? 'No' : 'Yes',
+ enableSorting: false,
+});
+
+export const created = helper.accessor('CreationDate', {
+ header: 'Created',
+ cell({ row: { original: item } }) {
+ return (
+ <>
+ {isoDate(item.CreationDate)}{' '}
+ {item.ApplicationOwner ? ` by ${item.ApplicationOwner}` : ''}
+ >
+ );
+ },
+});
diff --git a/app/react/kubernetes/applications/ListView/ApplicationsDatatable/types.ts b/app/react/kubernetes/applications/ListView/ApplicationsDatatable/types.ts
new file mode 100644
index 000000000..00d52e009
--- /dev/null
+++ b/app/react/kubernetes/applications/ListView/ApplicationsDatatable/types.ts
@@ -0,0 +1,47 @@
+import { AppType, DeploymentType } from '../../types';
+
+export interface Application {
+ Id: string;
+ Name: string;
+ Image: string;
+ Containers?: Array