mirror of https://github.com/portainer/portainer
fix(edge): introduce pause and rollback status [EE-5992] (#10466)
parent
5b8a0471e9
commit
8b7436e4d0
|
@ -1682,6 +1682,12 @@ const (
|
||||||
EdgeStackStatusDeploying
|
EdgeStackStatusDeploying
|
||||||
// EdgeStackStatusRemoving represents an Edge stack which is being removed
|
// EdgeStackStatusRemoving represents an Edge stack which is being removed
|
||||||
EdgeStackStatusRemoving
|
EdgeStackStatusRemoving
|
||||||
|
// EdgeStackStatusPausedDeploying represents a paused Edge stack
|
||||||
|
EdgeStackStatusPausedDeploying
|
||||||
|
// EdgeStackStatusRollingBack represents an Edge stack which is being rolled back
|
||||||
|
EdgeStackStatusRollingBack
|
||||||
|
// EdgeStackStatusRolledBack represents an Edge stack which has rolled back
|
||||||
|
EdgeStackStatusRolledBack
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -6,6 +6,7 @@ import { EdgeStackStatus, StatusType } from '@/react/edge/edge-stacks/types';
|
||||||
import { useEnvironmentList } from '@/react/portainer/environments/queries';
|
import { useEnvironmentList } from '@/react/portainer/environments/queries';
|
||||||
import { useParamState } from '@/react/hooks/useParamState';
|
import { useParamState } from '@/react/hooks/useParamState';
|
||||||
import { EnvironmentId } from '@/react/portainer/environments/types';
|
import { EnvironmentId } from '@/react/portainer/environments/types';
|
||||||
|
import { isBE } from '@/react/portainer/feature-flags/feature-flags.service';
|
||||||
|
|
||||||
import { Datatable } from '@@/datatables';
|
import { Datatable } from '@@/datatables';
|
||||||
import { useTableStateWithoutStorage } from '@@/datatables/useTableState';
|
import { useTableStateWithoutStorage } from '@@/datatables/useTableState';
|
||||||
|
@ -78,6 +79,21 @@ export function EnvironmentsDatatable() {
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const envStatusSelectOptions = [
|
||||||
|
{ value: StatusType.Pending, label: 'Pending' },
|
||||||
|
{ value: StatusType.Acknowledged, label: 'Acknowledged' },
|
||||||
|
{ value: StatusType.ImagesPulled, label: 'Images pre-pulled' },
|
||||||
|
{ value: StatusType.Running, label: 'Deployed' },
|
||||||
|
{ value: StatusType.Error, label: 'Failed' },
|
||||||
|
];
|
||||||
|
if (isBE) {
|
||||||
|
envStatusSelectOptions.concat([
|
||||||
|
{ value: StatusType.PausedDeploying, label: 'Paused' },
|
||||||
|
{ value: StatusType.RollingBack, label: 'Rolling back' },
|
||||||
|
{ value: StatusType.RolledBack, label: 'Rolled back' },
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Datatable
|
<Datatable
|
||||||
columns={columns}
|
columns={columns}
|
||||||
|
@ -99,13 +115,7 @@ export function EnvironmentsDatatable() {
|
||||||
bindToBody
|
bindToBody
|
||||||
value={statusFilter}
|
value={statusFilter}
|
||||||
onChange={(e) => setStatusFilter(e ?? undefined)}
|
onChange={(e) => setStatusFilter(e ?? undefined)}
|
||||||
options={[
|
options={envStatusSelectOptions}
|
||||||
{ value: StatusType.Pending, label: 'Pending' },
|
|
||||||
{ value: StatusType.Acknowledged, label: 'Acknowledged' },
|
|
||||||
{ value: StatusType.ImagesPulled, label: 'Images pre-pulled' },
|
|
||||||
{ value: StatusType.Running, label: 'Deployed' },
|
|
||||||
{ value: StatusType.Error, label: 'Failed' },
|
|
||||||
]}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
|
@ -155,6 +155,15 @@ function endpointStatusLabel(statusArray: Array<DeploymentStatus>) {
|
||||||
if (status.Type === StatusType.Error) {
|
if (status.Type === StatusType.Error) {
|
||||||
labels.push('Failed');
|
labels.push('Failed');
|
||||||
}
|
}
|
||||||
|
if (status.Type === StatusType.PausedDeploying) {
|
||||||
|
labels.push('Paused');
|
||||||
|
}
|
||||||
|
if (status.Type === StatusType.RollingBack) {
|
||||||
|
labels.push('Rolling Back');
|
||||||
|
}
|
||||||
|
if (status.Type === StatusType.RolledBack) {
|
||||||
|
labels.push('Rolled Back');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!labels.length) {
|
if (!labels.length) {
|
||||||
|
@ -283,6 +292,9 @@ function getStateColor(type: StatusType): 'orange' | 'green' | 'red' {
|
||||||
case StatusType.Pending:
|
case StatusType.Pending:
|
||||||
case StatusType.Deploying:
|
case StatusType.Deploying:
|
||||||
case StatusType.Removing:
|
case StatusType.Removing:
|
||||||
|
case StatusType.PausedDeploying:
|
||||||
|
case StatusType.RollingBack:
|
||||||
|
case StatusType.RolledBack:
|
||||||
default:
|
default:
|
||||||
return 'orange';
|
return 'orange';
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,6 +30,12 @@ export enum StatusType {
|
||||||
Deploying,
|
Deploying,
|
||||||
/** Removing represents an Edge stack which is being removed */
|
/** Removing represents an Edge stack which is being removed */
|
||||||
Removing,
|
Removing,
|
||||||
|
/** PausedDeploying represents an Edge stack which is paused for deployment */
|
||||||
|
PausedDeploying,
|
||||||
|
/** PausedRemoving represents an Edge stack which is being rolled back */
|
||||||
|
RollingBack,
|
||||||
|
/** PausedRemoving represents an Edge stack which has been rolled back */
|
||||||
|
RolledBack,
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DeploymentStatus {
|
export interface DeploymentStatus {
|
||||||
|
|
Loading…
Reference in New Issue