mirror of
https://github.com/portainer/portainer.git
synced 2025-07-23 07:19:41 +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
38
app/react/docker/containers/ListView/ListView.tsx
Normal file
38
app/react/docker/containers/ListView/ListView.tsx
Normal file
|
@ -0,0 +1,38 @@
|
|||
import { useInfo } from '@/docker/services/system.service';
|
||||
import { Environment } from '@/portainer/environments/types';
|
||||
import { isAgentEnvironment } from '@/portainer/environments/utils';
|
||||
|
||||
import { PageHeader } from '@@/PageHeader';
|
||||
|
||||
import { ContainersDatatable } from './ContainersDatatable';
|
||||
|
||||
interface Props {
|
||||
endpoint: Environment;
|
||||
}
|
||||
|
||||
export function ListView({ endpoint: environment }: Props) {
|
||||
const isAgent = isAgentEnvironment(environment.Type);
|
||||
|
||||
const envInfoQuery = useInfo(environment.Id, (info) => !!info.Swarm?.NodeID);
|
||||
|
||||
const isSwarmManager = !!envInfoQuery.data;
|
||||
const isHostColumnVisible = isAgent && isSwarmManager;
|
||||
return (
|
||||
<>
|
||||
<PageHeader
|
||||
title="Container list"
|
||||
breadcrumbs={[{ label: 'Containers' }]}
|
||||
reload
|
||||
/>
|
||||
|
||||
<div className="row">
|
||||
<div className="col-sm-12">
|
||||
<ContainersDatatable
|
||||
isHostColumnVisible={isHostColumnVisible}
|
||||
environment={environment}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue