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

fix(dashboard): show endpoint tags (#4216)

* fix(dashboard): show endpoint tags

* fix(dashboard): use ctrl
This commit is contained in:
Chaim Lev-Ari 2020-08-17 03:30:02 +03:00 committed by GitHub
parent 5c6147c9b9
commit b6fc434291
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 39 additions and 19 deletions

View file

@ -14,7 +14,8 @@ class KubernetesDashboardController {
KubernetesConfigurationService,
KubernetesVolumeService,
KubernetesNamespaceHelper,
Authentication
Authentication,
TagService
) {
this.$async = $async;
this.Notifications = Notifications;
@ -26,6 +27,7 @@ class KubernetesDashboardController {
this.KubernetesVolumeService = KubernetesVolumeService;
this.KubernetesNamespaceHelper = KubernetesNamespaceHelper;
this.Authentication = Authentication;
this.TagService = TagService;
this.onInit = this.onInit.bind(this);
this.getAll = this.getAll.bind(this);
@ -37,17 +39,31 @@ class KubernetesDashboardController {
try {
const endpointId = this.EndpointProvider.endpointID();
const [endpoint, pools, applications, configurations, volumes] = await Promise.all([
const [endpoint, pools, applications, configurations, volumes, tags] = await Promise.all([
this.EndpointService.endpoint(endpointId),
this.KubernetesResourcePoolService.get(),
this.KubernetesApplicationService.get(),
this.KubernetesConfigurationService.get(),
this.KubernetesVolumeService.get(),
this.TagService.tags(),
]);
this.endpoint = endpoint;
this.applications = applications;
this.volumes = volumes;
this.endpointTags = this.endpoint.TagIds.length
? _.join(
_.filter(
_.map(this.endpoint.TagIds, (id) => {
const tag = tags.find((tag) => tag.Id === id);
return tag ? tag.Name : '';
}),
Boolean
),
', '
)
: '-';
if (!isAdmin) {
this.pools = _.filter(pools, (pool) => {
return !this.KubernetesNamespaceHelper.isSystemNamespace(pool.Namespace.Name);