mirror of
https://github.com/portainer/portainer.git
synced 2025-07-30 18:59:41 +02:00
fix(docker):show error for offline endpoint (#6702)
This commit is contained in:
parent
f59459f936
commit
311129e746
1 changed files with 3 additions and 7 deletions
|
@ -1,5 +1,6 @@
|
||||||
import angular from 'angular';
|
import angular from 'angular';
|
||||||
|
|
||||||
|
import { EnvironmentStatus } from '@/portainer/environments/types';
|
||||||
import containersModule from './containers';
|
import containersModule from './containers';
|
||||||
import { componentsModule } from './components';
|
import { componentsModule } from './components';
|
||||||
|
|
||||||
|
@ -27,13 +28,8 @@ angular.module('portainer.docker', ['portainer.app', containersModule, component
|
||||||
}
|
}
|
||||||
endpoint.Status = status;
|
endpoint.Status = status;
|
||||||
|
|
||||||
if (status === 2) {
|
if (status === EnvironmentStatus.Down) {
|
||||||
if (!endpoint.Snapshots[0]) {
|
throw new Error('Environment is unreachable.');
|
||||||
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.');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EndpointProvider.setEndpointID(endpoint.Id);
|
EndpointProvider.setEndpointID(endpoint.Id);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue