1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-24 15:59:41 +02:00

refactor(edge/stacks): migrate envs table to react [EE-5613] (#9093)

This commit is contained in:
Chaim Lev-Ari 2023-06-25 12:38:43 +07:00 committed by GitHub
parent dfc1a7b1d7
commit 11571fd6ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 652 additions and 281 deletions

View file

@ -0,0 +1,30 @@
import { useCurrentStateAndParams } from '@uirouter/react';
import { EnvironmentId } from '@/react/portainer/environments/types';
import { useLogsStatus } from './useLogsStatus';
interface Props {
environmentId: EnvironmentId;
}
export function ActionStatus({ environmentId }: Props) {
const {
params: { stackId: edgeStackId },
} = useCurrentStateAndParams();
const logsStatusQuery = useLogsStatus(edgeStackId, environmentId);
return <>{getStatusText(logsStatusQuery.data)}</>;
}
function getStatusText(status?: 'pending' | 'collected' | 'idle') {
switch (status) {
case 'collected':
return 'Logs available for download';
case 'pending':
return 'Logs marked for collection, please wait until the logs are available';
default:
return null;
}
}