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