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:
parent
dfc1a7b1d7
commit
11571fd6ea
24 changed files with 652 additions and 281 deletions
|
@ -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;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue