From 833abb24cb484b0b24a755ee166380ee9754463d Mon Sep 17 00:00:00 2001 From: Maxime Bajeux Date: Fri, 17 Jul 2020 00:00:15 +0200 Subject: [PATCH] feat(k8s/applications): Expose application workload type (#4029) * feat(applications): Expose application workload type * feat(application): support daemonSet workload type and add default value --- .../applicationsDatatable.html | 10 +++++++++- app/kubernetes/filters/applicationFilters.js | 16 ++++++++++++++++ .../views/applications/edit/application.html | 8 +++++++- 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/app/kubernetes/components/datatables/applications-datatable/applicationsDatatable.html b/app/kubernetes/components/datatables/applications-datatable/applicationsDatatable.html index 4dee337e4..e30c5c73b 100644 --- a/app/kubernetes/components/datatables/applications-datatable/applicationsDatatable.html +++ b/app/kubernetes/components/datatables/applications-datatable/applicationsDatatable.html @@ -107,7 +107,14 @@ - Deployment + + Application Type + + + + + + Status Publishing mode @@ -141,6 +148,7 @@ {{ item.ResourcePool }} {{ item.Image }} + {{ item.ApplicationType | kubernetesApplicationTypeText }} Replicated Global diff --git a/app/kubernetes/filters/applicationFilters.js b/app/kubernetes/filters/applicationFilters.js index 351007566..d0f37f78c 100644 --- a/app/kubernetes/filters/applicationFilters.js +++ b/app/kubernetes/filters/applicationFilters.js @@ -1,6 +1,7 @@ import _ from 'lodash-es'; import { KubernetesApplicationDataAccessPolicies } from 'Kubernetes/models/application/models'; import { KubernetesServiceTypes } from 'Kubernetes/models/service/models'; +import { KubernetesApplicationTypes, KubernetesApplicationTypeStrings } from 'Kubernetes/models/application/models'; angular .module('portainer.kubernetes') @@ -45,6 +46,21 @@ angular } }; }) + .filter('kubernetesApplicationTypeText', function () { + 'use strict'; + return function (type) { + switch (type) { + case KubernetesApplicationTypes.DEPLOYMENT: + return KubernetesApplicationTypeStrings.DEPLOYMENT; + case KubernetesApplicationTypes.DAEMONSET: + return KubernetesApplicationTypeStrings.DAEMONSET; + case KubernetesApplicationTypes.STATEFULSET: + return KubernetesApplicationTypeStrings.STATEFULSET; + default: + return '-'; + } + }; + }) .filter('kubernetesApplicationCPUValue', function () { 'use strict'; return function (value) { diff --git a/app/kubernetes/views/applications/edit/application.html b/app/kubernetes/views/applications/edit/application.html index 248fefc0e..40147d896 100644 --- a/app/kubernetes/views/applications/edit/application.html +++ b/app/kubernetes/views/applications/edit/application.html @@ -36,7 +36,13 @@ - Deployment + Application Type + + {{ ctrl.application.ApplicationType | kubernetesApplicationTypeText }} + + + + Status Replicated Global