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:
parent
6290e9facc
commit
23295d2736
22 changed files with 312 additions and 297 deletions
|
@ -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>
|
||||
),
|
||||
});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue