|
|
|
@ -3,7 +3,7 @@ import EndpointHelper from 'Portainer/helpers/endpointHelper';
|
|
|
|
|
|
|
|
|
|
angular.module('portainer.app').controller('EndpointsController', EndpointsController);
|
|
|
|
|
|
|
|
|
|
function EndpointsController($q, $scope, $state, $async, EndpointService, GroupService, ModalService, Notifications) {
|
|
|
|
|
function EndpointsController($q, $scope, $state, $async, EndpointService, GroupService, ModalService, Notifications, EndpointProvider, StateManager) {
|
|
|
|
|
$scope.removeAction = removeAction;
|
|
|
|
|
|
|
|
|
|
function removeAction(endpoints) {
|
|
|
|
@ -26,6 +26,14 @@ function EndpointsController($q, $scope, $state, $async, EndpointService, GroupS
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const endpointId = EndpointProvider.endpointID();
|
|
|
|
|
// If the current endpoint was deleted, then clean endpoint store
|
|
|
|
|
if (endpoints.some((item) => item.Id === endpointId)) {
|
|
|
|
|
StateManager.cleanEndpoint();
|
|
|
|
|
// trigger sidebar rerender
|
|
|
|
|
$scope.applicationState.endpoint = {};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$state.reload();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|