1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-22 23:09:41 +02:00

feat(app): migrate app containers to react [EE-5353] (#9992)

This commit is contained in:
Ali 2023-08-17 22:00:25 +12:00 committed by GitHub
parent 6290e9facc
commit 23295d2736
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 312 additions and 297 deletions

View file

@ -0,0 +1,49 @@
import { BarChart, FileText, Terminal } from 'lucide-react';
import { Authorized } from '@/react/hooks/useUser';
import { Link } from '@@/Link';
import { Icon } from '@@/Icon';
import { columnHelper } from './helper';
export function getActions(isServerMetricsEnabled: boolean) {
return columnHelper.accessor(() => '', {
header: 'Actions',
enableSorting: false,
cell: ({ row: { original: container } }) => (
<div className="flex gap-x-2">
{container.status === 'Running' && isServerMetricsEnabled && (
<Link
className="flex items-center gap-1"
to="kubernetes.applications.application.stats"
params={{ pod: container.podName, container: container.name }}
>
<Icon icon={BarChart} />
Stats
</Link>
)}
<Link
className="flex items-center gap-1"
to="kubernetes.applications.application.logs"
params={{ pod: container.podName, container: container.name }}
>
<Icon icon={FileText} />
Logs
</Link>
{container.status === 'Running' && (
<Authorized authorizations="K8sApplicationConsoleRW">
<Link
className="flex items-center gap-1"
to="kubernetes.applications.application.console"
params={{ pod: container.podName, container: container.name }}
>
<Icon icon={Terminal} />
Console
</Link>
</Authorized>
)}
</div>
),
});
}