mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 07:49:41 +02:00
refactor(docker/services): convert service tasks table to react [EE-4674] (#10188)
This commit is contained in:
parent
c47a804c97
commit
c3d266931f
26 changed files with 421 additions and 322 deletions
46
app/react/docker/services/common/TaskTableQuickActions.tsx
Normal file
46
app/react/docker/services/common/TaskTableQuickActions.tsx
Normal file
|
@ -0,0 +1,46 @@
|
|||
import { FileText, Info } from 'lucide-react';
|
||||
|
||||
import { Authorized } from '@/react/hooks/useUser';
|
||||
|
||||
import { Icon } from '@@/Icon';
|
||||
import { Link } from '@@/Link';
|
||||
|
||||
interface State {
|
||||
showQuickActionInspect: boolean;
|
||||
showQuickActionLogs: boolean;
|
||||
}
|
||||
|
||||
export function TaskTableQuickActions({
|
||||
taskId,
|
||||
state = {
|
||||
showQuickActionInspect: true,
|
||||
showQuickActionLogs: true,
|
||||
},
|
||||
}: {
|
||||
taskId: string;
|
||||
state?: State;
|
||||
}) {
|
||||
return (
|
||||
<div className="inline-flex space-x-1">
|
||||
{state.showQuickActionLogs && (
|
||||
<Authorized authorizations="DockerTaskLogs">
|
||||
<Link
|
||||
to="docker.tasks.task.logs"
|
||||
params={{ id: taskId }}
|
||||
title="Logs"
|
||||
>
|
||||
<Icon icon={FileText} className="space-right" />
|
||||
</Link>
|
||||
</Authorized>
|
||||
)}
|
||||
|
||||
{state.showQuickActionInspect && (
|
||||
<Authorized authorizations="DockerTaskInspect">
|
||||
<Link to="docker.tasks.task" params={{ id: taskId }} title="Inspect">
|
||||
<Icon icon={Info} className="space-right" />
|
||||
</Link>
|
||||
</Authorized>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue