mirror of https://github.com/portainer/portainer
fix(home): redirect home if edge endpoint is down (#4670)
* fix(home): redirect home if edge endpoint is down * fix(kubernetes): rephrase error message when endpoint is down Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io>pull/4941/head
parent
c542964073
commit
d1a21ef6c1
|
@ -17,6 +17,7 @@ angular.module('portainer.kubernetes', ['portainer.app']).config([
|
|||
}
|
||||
try {
|
||||
if (endpoint.Type === 7) {
|
||||
//edge
|
||||
try {
|
||||
await KubernetesHealthService.ping(endpoint.Id);
|
||||
endpoint.Status = 1;
|
||||
|
@ -27,6 +28,10 @@ angular.module('portainer.kubernetes', ['portainer.app']).config([
|
|||
|
||||
EndpointProvider.setEndpointID(endpoint.Id);
|
||||
await StateManager.updateEndpointState(endpoint, []);
|
||||
|
||||
if (endpoint.Type === 7 && endpoint.Status === 2) {
|
||||
throw new Error('Unable to contact Edge agent, please ensure that the agent is properly running on the remote environment.');
|
||||
}
|
||||
} catch (e) {
|
||||
Notifications.error('Failed loading endpoint', e);
|
||||
$state.go('portainer.home', {}, { reload: true });
|
||||
|
|
Loading…
Reference in New Issue