mirror of
https://github.com/portainer/portainer.git
synced 2025-08-08 07:15:23 +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,14 +1,13 @@
|
|||
angular.module('portainer.docker').controller('BrowseVolumeController', [
|
||||
'$scope',
|
||||
'$transition$',
|
||||
'StateManager',
|
||||
function ($scope, $transition$, StateManager) {
|
||||
function initView() {
|
||||
$scope.volumeId = $transition$.params().id;
|
||||
$scope.nodeName = $transition$.params().nodeName;
|
||||
$scope.agentApiVersion = StateManager.getAgentApiVersion();
|
||||
}
|
||||
angular.module('portainer.docker').controller('BrowseVolumeController', BrowseVolumeController);
|
||||
|
||||
initView();
|
||||
},
|
||||
]);
|
||||
/* @ngInject */
|
||||
function BrowseVolumeController($scope, $transition$, StateManager, endpoint) {
|
||||
function initView() {
|
||||
$scope.volumeId = $transition$.params().id;
|
||||
$scope.nodeName = $transition$.params().nodeName;
|
||||
$scope.agentApiVersion = StateManager.getAgentApiVersion();
|
||||
$scope.endpointId = endpoint.Id;
|
||||
}
|
||||
|
||||
initView();
|
||||
}
|
||||
|
|
|
@ -7,6 +7,6 @@
|
|||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<volume-browser volume-id="volumeId" node-name="nodeName" is-upload-enabled="agentApiVersion > 1"></volume-browser>
|
||||
<volume-browser volume-id="volumeId" node-name="nodeName" is-upload-enabled="agentApiVersion > 1" endpoint-id="endpointId"></volume-browser>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import { isOfflineEndpoint } from '@/portainer/helpers/endpointHelper';
|
||||
|
||||
angular.module('portainer.docker').controller('VolumesController', [
|
||||
'$q',
|
||||
'$scope',
|
||||
|
@ -7,11 +9,10 @@ angular.module('portainer.docker').controller('VolumesController', [
|
|||
'VolumeHelper',
|
||||
'Notifications',
|
||||
'HttpRequestHelper',
|
||||
'EndpointProvider',
|
||||
'Authentication',
|
||||
'ModalService',
|
||||
'endpoint',
|
||||
function ($q, $scope, $state, VolumeService, ServiceService, VolumeHelper, Notifications, HttpRequestHelper, EndpointProvider, Authentication, ModalService, endpoint) {
|
||||
function ($q, $scope, $state, VolumeService, ServiceService, VolumeHelper, Notifications, HttpRequestHelper, Authentication, ModalService, endpoint) {
|
||||
$scope.removeAction = function (selectedItems) {
|
||||
ModalService.confirmDeletion('Do you want to remove the selected volume(s)?', (confirmed) => {
|
||||
if (confirmed) {
|
||||
|
@ -52,7 +53,7 @@ angular.module('portainer.docker').controller('VolumesController', [
|
|||
})
|
||||
.then(function success(data) {
|
||||
var services = data.services;
|
||||
$scope.offlineMode = EndpointProvider.offlineMode();
|
||||
$scope.offlineMode = isOfflineEndpoint(endpoint);
|
||||
$scope.volumes = data.attached
|
||||
.map(function (volume) {
|
||||
volume.dangling = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue