mirror of https://github.com/portainer/portainer
feat(k8s/application): app details for pods
parent
3da9751c82
commit
174e28b850
|
@ -57,7 +57,7 @@
|
||||||
<table class="table table-hover nowrap-cells">
|
<table class="table table-hover nowrap-cells">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>
|
<th ng-if="!$ctrl.isPod">
|
||||||
<a ng-click="$ctrl.changeOrderBy('PodName')">
|
<a ng-click="$ctrl.changeOrderBy('PodName')">
|
||||||
Pod
|
Pod
|
||||||
<i class="fa fa-sort-alpha-down" aria-hidden="true" ng-if="$ctrl.state.orderBy === 'PodName' && !$ctrl.state.reverseOrder"></i>
|
<i class="fa fa-sort-alpha-down" aria-hidden="true" ng-if="$ctrl.state.orderBy === 'PodName' && !$ctrl.state.reverseOrder"></i>
|
||||||
|
@ -107,7 +107,7 @@
|
||||||
dir-paginate="item in ($ctrl.state.filteredDataSet = ($ctrl.dataset | filter:$ctrl.state.textFilter | orderBy:$ctrl.state.orderBy:$ctrl.state.reverseOrder | itemsPerPage: $ctrl.state.paginatedItemLimit: $ctrl.tableKey))"
|
dir-paginate="item in ($ctrl.state.filteredDataSet = ($ctrl.dataset | filter:$ctrl.state.textFilter | orderBy:$ctrl.state.orderBy:$ctrl.state.reverseOrder | itemsPerPage: $ctrl.state.paginatedItemLimit: $ctrl.tableKey))"
|
||||||
pagination-id="$ctrl.tableKey"
|
pagination-id="$ctrl.tableKey"
|
||||||
>
|
>
|
||||||
<td>{{ item.PodName }}</td>
|
<td ng-if="!$ctrl.isPod">{{ item.PodName }}</td>
|
||||||
<td>{{ item.Name }}</td>
|
<td>{{ item.Name }}</td>
|
||||||
<td>{{ item.Image }}</td>
|
<td>{{ item.Image }}</td>
|
||||||
<td
|
<td
|
||||||
|
|
|
@ -8,5 +8,6 @@ angular.module('portainer.kubernetes').component('kubernetesContainersDatatable'
|
||||||
tableKey: '@',
|
tableKey: '@',
|
||||||
orderBy: '@',
|
orderBy: '@',
|
||||||
refreshCallback: '<',
|
refreshCallback: '<',
|
||||||
|
isPod: '<',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
@ -221,10 +221,6 @@ class KubernetesApplicationConverter {
|
||||||
const res = new KubernetesApplication();
|
const res = new KubernetesApplication();
|
||||||
KubernetesApplicationConverter.applicationCommon(res, data, pods, service, ingresses);
|
KubernetesApplicationConverter.applicationCommon(res, data, pods, service, ingresses);
|
||||||
res.ApplicationType = KubernetesApplicationTypes.POD;
|
res.ApplicationType = KubernetesApplicationTypes.POD;
|
||||||
// res.DeploymentType = KubernetesApplicationDeploymentTypes.REPLICATED;
|
|
||||||
// res.DataAccessPolicy = KubernetesApplicationDataAccessPolicies.SHARED;
|
|
||||||
// res.RunningPodsCount = data.status.availableReplicas || data.status.replicas - data.status.unavailableReplicas || 0;
|
|
||||||
// res.TotalPodsCount = data.spec.replicas;
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,16 +43,21 @@
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Status</td>
|
<td>Status</td>
|
||||||
<td>
|
<td ng-if="ctrl.application.ApplicationType !== ctrl.KubernetesApplicationTypes.POD">
|
||||||
<span ng-if="ctrl.application.DeploymentType === ctrl.KubernetesApplicationDeploymentTypes.REPLICATED">Replicated</span>
|
<span ng-if="ctrl.application.DeploymentType === ctrl.KubernetesApplicationDeploymentTypes.REPLICATED">Replicated</span>
|
||||||
<span ng-if="ctrl.application.DeploymentType === ctrl.KubernetesApplicationDeploymentTypes.GLOBAL">Global</span>
|
<span ng-if="ctrl.application.DeploymentType === ctrl.KubernetesApplicationDeploymentTypes.GLOBAL">Global</span>
|
||||||
<code>{{ ctrl.application.RunningPodsCount }}</code> / <code>{{ ctrl.application.TotalPodsCount }}</code>
|
<code>{{ ctrl.application.RunningPodsCount }}</code> / <code>{{ ctrl.application.TotalPodsCount }}</code>
|
||||||
</td>
|
</td>
|
||||||
|
<td ng-if="ctrl.application.ApplicationType === ctrl.KubernetesApplicationTypes.POD">
|
||||||
|
{{ ctrl.application.Pods[0].Status }}
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr ng-if="ctrl.application.Requests.Cpu || ctrl.application.Requests.Memory">
|
<tr ng-if="ctrl.application.Requests.Cpu || ctrl.application.Requests.Memory">
|
||||||
<td>
|
<td>
|
||||||
<div>Resource reservations</div>
|
<div>Resource reservations</div>
|
||||||
<div class="text-muted small">per instance</div>
|
<div ng-if="ctrl.application.ApplicationType !== ctrl.KubernetesApplicationTypes.POD" class="text-muted small">
|
||||||
|
per instance
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div ng-if="ctrl.application.Requests.Cpu">CPU {{ ctrl.application.Requests.Cpu | kubernetesApplicationCPUValue }}</div>
|
<div ng-if="ctrl.application.Requests.Cpu">CPU {{ ctrl.application.Requests.Cpu | kubernetesApplicationCPUValue }}</div>
|
||||||
|
@ -557,7 +562,8 @@
|
||||||
title-icon="fa-server"
|
title-icon="fa-server"
|
||||||
dataset="ctrl.allContainers"
|
dataset="ctrl.allContainers"
|
||||||
table-key="kubernetes.application.containers"
|
table-key="kubernetes.application.containers"
|
||||||
order-by="PodName"
|
is-pod="ctrl.application.ApplicationType === ctrl.KubernetesApplicationTypes.POD"
|
||||||
|
order-by="{{ ctrl.application.ApplicationType === ctrl.KubernetesApplicationTypes.POD ? 'Name' : 'PodName' }}"
|
||||||
>
|
>
|
||||||
</kubernetes-containers-datatable>
|
</kubernetes-containers-datatable>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import angular from 'angular';
|
import angular from 'angular';
|
||||||
import * as _ from 'lodash-es';
|
import * as _ from 'lodash-es';
|
||||||
import * as JsonPatch from 'fast-json-patch';
|
import * as JsonPatch from 'fast-json-patch';
|
||||||
import { KubernetesApplicationDataAccessPolicies, KubernetesApplicationDeploymentTypes } from 'Kubernetes/models/application/models';
|
import { KubernetesApplicationDataAccessPolicies, KubernetesApplicationDeploymentTypes, KubernetesApplicationTypes } from 'Kubernetes/models/application/models';
|
||||||
import KubernetesEventHelper from 'Kubernetes/helpers/eventHelper';
|
import KubernetesEventHelper from 'Kubernetes/helpers/eventHelper';
|
||||||
import KubernetesApplicationHelper from 'Kubernetes/helpers/application';
|
import KubernetesApplicationHelper from 'Kubernetes/helpers/application';
|
||||||
import { KubernetesServiceTypes } from 'Kubernetes/models/service/models';
|
import { KubernetesServiceTypes } from 'Kubernetes/models/service/models';
|
||||||
|
@ -123,6 +123,8 @@ class KubernetesApplicationController {
|
||||||
|
|
||||||
this.KubernetesNamespaceHelper = KubernetesNamespaceHelper;
|
this.KubernetesNamespaceHelper = KubernetesNamespaceHelper;
|
||||||
|
|
||||||
|
this.KubernetesApplicationDeploymentTypes = KubernetesApplicationDeploymentTypes;
|
||||||
|
this.KubernetesApplicationTypes = KubernetesApplicationTypes;
|
||||||
this.ApplicationDataAccessPolicies = KubernetesApplicationDataAccessPolicies;
|
this.ApplicationDataAccessPolicies = KubernetesApplicationDataAccessPolicies;
|
||||||
this.KubernetesServiceTypes = KubernetesServiceTypes;
|
this.KubernetesServiceTypes = KubernetesServiceTypes;
|
||||||
this.KubernetesPodContainerTypes = KubernetesPodContainerTypes;
|
this.KubernetesPodContainerTypes = KubernetesPodContainerTypes;
|
||||||
|
@ -340,7 +342,6 @@ class KubernetesApplicationController {
|
||||||
SelectedRevision: undefined,
|
SelectedRevision: undefined,
|
||||||
};
|
};
|
||||||
|
|
||||||
this.KubernetesApplicationDeploymentTypes = KubernetesApplicationDeploymentTypes;
|
|
||||||
await this.getApplication();
|
await this.getApplication();
|
||||||
await this.getEvents();
|
await this.getEvents();
|
||||||
this.state.viewReady = true;
|
this.state.viewReady = true;
|
||||||
|
|
Loading…
Reference in New Issue