1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-30 18:59:41 +02:00

refactor(endpoints): remove endpointProvider from views [EE-1136] (#5359)

[EE-1136]
This commit is contained in:
Chaim Lev-Ari 2021-12-14 09:34:54 +02:00 committed by GitHub
parent 7088da5157
commit eb9f6c77f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
56 changed files with 408 additions and 429 deletions

View file

@ -21,25 +21,13 @@ function computeSize(volumes) {
class KubernetesVolumesController {
/* @ngInject */
constructor(
$async,
$state,
Notifications,
Authentication,
ModalService,
LocalStorage,
EndpointProvider,
KubernetesStorageService,
KubernetesVolumeService,
KubernetesApplicationService
) {
constructor($async, $state, Notifications, Authentication, ModalService, LocalStorage, KubernetesStorageService, KubernetesVolumeService, KubernetesApplicationService) {
this.$async = $async;
this.$state = $state;
this.Notifications = Notifications;
this.Authentication = Authentication;
this.ModalService = ModalService;
this.LocalStorage = LocalStorage;
this.EndpointProvider = EndpointProvider;
this.KubernetesStorageService = KubernetesStorageService;
this.KubernetesVolumeService = KubernetesVolumeService;
this.KubernetesApplicationService = KubernetesApplicationService;
@ -87,7 +75,7 @@ class KubernetesVolumesController {
const [volumes, applications, storages] = await Promise.all([
this.KubernetesVolumeService.get(),
this.KubernetesApplicationService.get(),
this.KubernetesStorageService.get(this.state.endpointId),
this.KubernetesStorageService.get(this.endpoint.Id),
]);
this.volumes = _.map(volumes, (volume) => {
@ -107,9 +95,7 @@ class KubernetesVolumesController {
async onInit() {
this.state = {
viewReady: false,
// endpointId: this.$transition$.params().endpointId, // TODO: use this when moving to endpointID in URL
currentName: this.$state.$current.name,
endpointId: this.EndpointProvider.endpointID(),
activeTab: this.LocalStorage.getActiveTab('volumes'),
isAdmin: this.Authentication.isAdmin(),
};