mirror of
https://github.com/portainer/portainer.git
synced 2025-07-25 08:19:40 +02:00
refactor(endpoints): remove endpointProvider from views [EE-1136] (#5359)
[EE-1136]
This commit is contained in:
parent
7088da5157
commit
eb9f6c77f4
56 changed files with 408 additions and 429 deletions
|
@ -1,5 +1,6 @@
|
|||
import _ from 'lodash-es';
|
||||
import DockerNetworkHelper from 'Docker/helpers/networkHelper';
|
||||
import { isOfflineEndpoint } from '@/portainer/helpers/endpointHelper';
|
||||
|
||||
angular.module('portainer.docker').controller('NetworksController', [
|
||||
'$q',
|
||||
|
@ -8,9 +9,9 @@ angular.module('portainer.docker').controller('NetworksController', [
|
|||
'NetworkService',
|
||||
'Notifications',
|
||||
'HttpRequestHelper',
|
||||
'EndpointProvider',
|
||||
'endpoint',
|
||||
'AgentService',
|
||||
function ($q, $scope, $state, NetworkService, Notifications, HttpRequestHelper, EndpointProvider, AgentService) {
|
||||
function ($q, $scope, $state, NetworkService, Notifications, HttpRequestHelper, endpoint, AgentService) {
|
||||
$scope.removeAction = function (selectedItems) {
|
||||
var actionCount = selectedItems.length;
|
||||
angular.forEach(selectedItems, function (network) {
|
||||
|
@ -65,7 +66,7 @@ angular.module('portainer.docker').controller('NetworksController', [
|
|||
|
||||
$q.all(req)
|
||||
.then((data) => {
|
||||
$scope.offlineMode = EndpointProvider.offlineMode();
|
||||
$scope.offlineMode = isOfflineEndpoint(endpoint);
|
||||
const networks = _.forEach(data.networks, (item) => (item.Subs = []));
|
||||
if ($scope.applicationState.endpoint.mode.agentProxy && $scope.applicationState.endpoint.mode.provider === 'DOCKER_SWARM_MODE') {
|
||||
$scope.networks = groupSwarmNetworksManagerNodesFirst(data.networks, data.agents);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue