feat(k8s/applications): Expose application workload type (#4029)

* feat(applications): Expose application workload type

* feat(application): support daemonSet workload type and add default value
pull/4053/head
Maxime Bajeux 2020-07-17 00:00:15 +02:00 committed by GitHub
parent c9e8021fe8
commit 833abb24cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 32 additions and 2 deletions

View File

@ -107,7 +107,14 @@
</a>
</th>
<th>
Deployment
<a ng-click="$ctrl.changeOrderBy('ApplicationType')">
Application Type
<i class="fa fa-sort-alpha-down" aria-hidden="true" ng-if="$ctrl.state.orderBy === 'ApplicationType' && !$ctrl.state.reverseOrder"></i>
<i class="fa fa-sort-alpha-up" aria-hidden="true" ng-if="$ctrl.state.orderBy === 'ApplicationType' && $ctrl.state.reverseOrder"></i>
</a>
</th>
<th>
Status
</th>
<th>
Publishing mode
@ -141,6 +148,7 @@
<a ui-sref="kubernetes.resourcePools.resourcePool({ id: item.ResourcePool })">{{ item.ResourcePool }}</a>
</td>
<td>{{ item.Image }}</td>
<td>{{ item.ApplicationType | kubernetesApplicationTypeText }}</td>
<td>
<span ng-if="item.DeploymentType === $ctrl.KubernetesApplicationDeploymentTypes.REPLICATED">Replicated</span>
<span ng-if="item.DeploymentType === $ctrl.KubernetesApplicationDeploymentTypes.GLOBAL">Global</span>

View File

@ -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) {

View File

@ -36,7 +36,13 @@
</td>
</tr>
<tr>
<td>Deployment</td>
<td>Application Type</td>
<td>
{{ ctrl.application.ApplicationType | kubernetesApplicationTypeText }}
</td>
</tr>
<tr>
<td>Status</td>
<td>
<span ng-if="ctrl.application.DeploymentType === ctrl.KubernetesApplicationDeploymentTypes.REPLICATED">Replicated</span>
<span ng-if="ctrl.application.DeploymentType === ctrl.KubernetesApplicationDeploymentTypes.GLOBAL">Global</span>