|
|
@ -1,5 +1,5 @@
|
|
|
|
import { CellContext } from '@tanstack/react-table';
|
|
|
|
import { CellContext } from '@tanstack/react-table';
|
|
|
|
import { AlertCircle, HelpCircle, Settings } from 'lucide-react';
|
|
|
|
import { AlertCircle, HelpCircle, Loader2 } from 'lucide-react';
|
|
|
|
|
|
|
|
|
|
|
|
import {
|
|
|
|
import {
|
|
|
|
EnvironmentStatus,
|
|
|
|
EnvironmentStatus,
|
|
|
@ -10,6 +10,8 @@ import { notifySuccess } from '@/portainer/services/notifications';
|
|
|
|
|
|
|
|
|
|
|
|
import { TooltipWithChildren } from '@@/Tip/TooltipWithChildren';
|
|
|
|
import { TooltipWithChildren } from '@@/Tip/TooltipWithChildren';
|
|
|
|
import { Button } from '@@/buttons';
|
|
|
|
import { Button } from '@@/buttons';
|
|
|
|
|
|
|
|
import { Icon } from '@@/Icon';
|
|
|
|
|
|
|
|
import { Tooltip } from '@@/Tip/Tooltip';
|
|
|
|
|
|
|
|
|
|
|
|
import { EnvironmentListItem } from '../types';
|
|
|
|
import { EnvironmentListItem } from '../types';
|
|
|
|
import { useUpdateEnvironmentMutation } from '../../queries/useUpdateEnvironmentMutation';
|
|
|
|
import { useUpdateEnvironmentMutation } from '../../queries/useUpdateEnvironmentMutation';
|
|
|
@ -33,17 +35,17 @@ function Cell({
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<>
|
|
|
|
{environment.URL}
|
|
|
|
{environment.URL}
|
|
|
|
{environment.StatusMessage?.Summary &&
|
|
|
|
{environment.StatusMessage?.summary &&
|
|
|
|
environment.StatusMessage?.Detail && (
|
|
|
|
environment.StatusMessage?.detail && (
|
|
|
|
<div className="ml-2 inline-block">
|
|
|
|
<div className="ml-2 inline-block">
|
|
|
|
<span className="text-danger vertical-center inline-flex">
|
|
|
|
<span className="text-danger vertical-center inline-flex">
|
|
|
|
<AlertCircle className="lucide" aria-hidden="true" />
|
|
|
|
<AlertCircle className="lucide" aria-hidden="true" />
|
|
|
|
<span>{environment.StatusMessage.Summary}</span>
|
|
|
|
<span>{environment.StatusMessage.summary}</span>
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
<TooltipWithChildren
|
|
|
|
<TooltipWithChildren
|
|
|
|
message={
|
|
|
|
message={
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
{environment.StatusMessage.Detail}
|
|
|
|
{environment.StatusMessage.detail}
|
|
|
|
{environment.URL && (
|
|
|
|
{environment.URL && (
|
|
|
|
<div className="mt-2 text-right">
|
|
|
|
<div className="mt-2 text-right">
|
|
|
|
<Button
|
|
|
|
<Button
|
|
|
@ -71,27 +73,19 @@ function Cell({
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (environment.Type === 4) {
|
|
|
|
if (environment.Type === EnvironmentType.EdgeAgentOnDocker) {
|
|
|
|
return <>-</>;
|
|
|
|
return <>-</>;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (environment.Status === 3) {
|
|
|
|
if (environment.Status === EnvironmentStatus.Provisioning) {
|
|
|
|
const status = (
|
|
|
|
|
|
|
|
<span className="vertical-center inline-flex text-base">
|
|
|
|
|
|
|
|
<Settings className="lucide animate-spin-slow" />
|
|
|
|
|
|
|
|
{environment.StatusMessage?.Summary}
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
if (!environment.StatusMessage?.Detail) {
|
|
|
|
|
|
|
|
return status;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<TooltipWithChildren
|
|
|
|
<div className="inline-flex items-center text-base">
|
|
|
|
message={environment.StatusMessage?.Detail}
|
|
|
|
<Icon icon={Loader2} className="!mr-1 animate-spin-slow" />
|
|
|
|
position="bottom"
|
|
|
|
{environment.StatusMessage?.summary}
|
|
|
|
>
|
|
|
|
{environment.StatusMessage?.detail && (
|
|
|
|
{status}
|
|
|
|
<Tooltip message={environment.StatusMessage?.detail} />
|
|
|
|
</TooltipWithChildren>
|
|
|
|
)}
|
|
|
|
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|