未验证 提交 795a4223 编写于 作者: M Marcin Maciaszczyk 提交者: GitHub

Add labels to workload status charts (#5994)

* Add labels to workload status charts

* Update translation files
上级 54558956
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
......@@ -34,6 +34,10 @@ export const emptyResourcesRatio: ResourcesRatio = {
export class WorkloadStatusComponent {
@Input() resourcesRatio = emptyResourcesRatio;
colors: string[] = [];
animations = false;
labels = true;
trimLabels = false;
size = [350, 250];
getCustomColor(label: string): string {
if (label.includes('Running')) {
......
......@@ -25,9 +25,11 @@ limitations under the License.
<div fxLayout="column"
fxLayoutAlign="center center">
<ngx-charts-pie-chart [results]="resourcesRatio.cronJobRatio"
[view]="[200,200]"
[view]="size"
[customColors]="getCustomColor"
[animations]="false">
[animations]="animations"
[labels]="labels"
[trimLabels]="trimLabels">
<ng-template #tooltipTemplate
let-model="model">
{{model.value | number}}%
......@@ -43,9 +45,11 @@ limitations under the License.
<div fxLayout="column"
fxLayoutAlign="center center">
<ngx-charts-pie-chart [results]="resourcesRatio.daemonSetRatio"
[view]="[200,200]"
[view]="size"
[customColors]="getCustomColor"
[animations]="false">
[animations]="animations"
[labels]="labels"
[trimLabels]="trimLabels">
<ng-template #tooltipTemplate
let-model="model">
{{model.value | number}}%
......@@ -61,9 +65,11 @@ limitations under the License.
<div fxLayout="column"
fxLayoutAlign="center center">
<ngx-charts-pie-chart [results]="resourcesRatio.deploymentRatio"
[view]="[200,200]"
[view]="size"
[customColors]="getCustomColor"
[animations]="false">
[animations]="animations"
[labels]="labels"
[trimLabels]="trimLabels">
<ng-template #tooltipTemplate
let-model="model">
{{model.value | number}}%
......@@ -79,9 +85,11 @@ limitations under the License.
<div fxLayout="column"
fxLayoutAlign="center center">
<ngx-charts-pie-chart [results]="resourcesRatio.jobRatio"
[view]="[200,200]"
[view]="size"
[customColors]="getCustomColor"
[animations]="false">
[animations]="animations"
[labels]="labels"
[trimLabels]="trimLabels">
<ng-template #tooltipTemplate
let-model="model">
{{model.value | number}}%
......@@ -97,9 +105,11 @@ limitations under the License.
<div fxLayout="column"
fxLayoutAlign="center center">
<ngx-charts-pie-chart [results]="resourcesRatio.podRatio"
[view]="[200,200]"
[view]="size"
[customColors]="getCustomColor"
[animations]="false"
[animations]="animations"
[labels]="labels"
[trimLabels]="trimLabels"
id="kd-graph-pods">
<ng-template #tooltipTemplate
let-model="model">
......@@ -116,9 +126,11 @@ limitations under the License.
<div fxLayout="column"
fxLayoutAlign="center center">
<ngx-charts-pie-chart [results]="resourcesRatio.replicaSetRatio"
[view]="[200,200]"
[view]="size"
[customColors]="getCustomColor"
[animations]="false">
[animations]="animations"
[labels]="labels"
[trimLabels]="trimLabels">
<ng-template #tooltipTemplate
let-model="model">
{{model.value | number}}%
......@@ -134,9 +146,11 @@ limitations under the License.
<div fxLayout="column"
fxLayoutAlign="center center">
<ngx-charts-pie-chart [results]="resourcesRatio.replicationControllerRatio"
[view]="[200,200]"
[view]="size"
[customColors]="getCustomColor"
[animations]="false">
[animations]="animations"
[labels]="labels"
[trimLabels]="trimLabels">
<ng-template #tooltipTemplate
let-model="model">
{{model.value | number}}%
......@@ -152,9 +166,11 @@ limitations under the License.
<div fxLayout="column"
fxLayoutAlign="center center">
<ngx-charts-pie-chart [results]="resourcesRatio.statefulSetRatio"
[view]="[200,200]"
[view]="size"
[customColors]="getCustomColor"
[animations]="false">
[animations]="animations"
[labels]="labels"
[trimLabels]="trimLabels">
<ng-template #tooltipTemplate
let-model="model">
{{model.value | number}}%
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册