mirror of
https://github.com/portainer/portainer.git
synced 2025-07-22 06:49:40 +02:00
refactor(containers): migrate view to react [EE-2212] (#6577)
Co-authored-by: LP B <xAt0mZ@users.noreply.github.com>
This commit is contained in:
parent
5ee570e075
commit
bed4257194
71 changed files with 1616 additions and 875 deletions
|
@ -1,10 +1,9 @@
|
|||
import clsx from 'clsx';
|
||||
|
||||
import { DockerContainerStatus } from '@/react/docker/containers/types';
|
||||
import { ContainerStatus } from '@/react/docker/containers/types';
|
||||
import { Authorized } from '@/portainer/hooks/useUser';
|
||||
import { Icon } from '@/react/components/Icon';
|
||||
import { react2angular } from '@/react-tools/react2angular';
|
||||
|
||||
import { Icon } from '@@/Icon';
|
||||
import { Link } from '@@/Link';
|
||||
|
||||
import styles from './ContainerQuickActions.module.css';
|
||||
|
@ -22,7 +21,7 @@ interface Props {
|
|||
containerId?: string;
|
||||
nodeName: string;
|
||||
state: QuickActionsState;
|
||||
status: DockerContainerStatus;
|
||||
status: ContainerStatus;
|
||||
}
|
||||
|
||||
export function ContainerQuickActions({
|
||||
|
@ -36,9 +35,12 @@ export function ContainerQuickActions({
|
|||
return <TaskQuickActions taskId={taskId} state={state} />;
|
||||
}
|
||||
|
||||
const isActive = ['starting', 'running', 'healthy', 'unhealthy'].includes(
|
||||
status
|
||||
);
|
||||
const isActive = [
|
||||
ContainerStatus.Starting,
|
||||
ContainerStatus.Running,
|
||||
ContainerStatus.Healthy,
|
||||
ContainerStatus.Unhealthy,
|
||||
].includes(status);
|
||||
|
||||
return (
|
||||
<div className={clsx('space-x-1', styles.root)}>
|
||||
|
@ -135,8 +137,3 @@ function TaskQuickActions({ taskId, state }: TaskProps) {
|
|||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export const ContainerQuickActionsAngular = react2angular(
|
||||
ContainerQuickActions,
|
||||
['taskId', 'containerId', 'nodeName', 'state', 'status']
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue