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

fix(docker):show error for offline endpoint (#6702)

This commit is contained in:
sunportainer 2022-04-04 18:24:47 +08:00 committed by GitHub
parent f59459f936
commit 311129e746
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,6 @@
import angular from 'angular';
import { EnvironmentStatus } from '@/portainer/environments/types';
import containersModule from './containers';
import { componentsModule } from './components';
@ -27,13 +28,8 @@ angular.module('portainer.docker', ['portainer.app', containersModule, component
}
endpoint.Status = status;
if (status === 2) {
if (!endpoint.Snapshots[0]) {
throw new Error('Environment is unreachable and there is no snapshot available for offline browsing.');
}
if (endpoint.Snapshots[0].Swarm) {
throw new Error('Environment is unreachable. Connect to another swarm manager.');
}
if (status === EnvironmentStatus.Down) {
throw new Error('Environment is unreachable.');
}
EndpointProvider.setEndpointID(endpoint.Id);