Enhance: Add helm chart count number in the project list

Project API return the helm chart count now, so put it to UI.

Signed-off-by: Qian Deng <dengq@vmware.com>
This commit is contained in:
Qian Deng 2018-11-12 15:47:51 +08:00
parent 555c0cb181
commit 405565b744
8 changed files with 9 additions and 0 deletions

View File

@ -10,6 +10,7 @@
<clr-dg-column [clrDgSortBy]="accessLevelComparator">{{'PROJECT.ACCESS_LEVEL' | translate}}</clr-dg-column>
<clr-dg-column *ngIf="showRoleInfo" [clrDgSortBy]="roleComparator">{{'PROJECT.ROLE' | translate}}</clr-dg-column>
<clr-dg-column [clrDgSortBy]="repoCountComparator">{{'PROJECT.REPO_COUNT'| translate}}</clr-dg-column>
<clr-dg-column [clrDgSortBy]="chartCountComparator">{{'PROJECT.CHART_COUNT'| translate}}</clr-dg-column>
<clr-dg-column [clrDgSortBy]="timeComparator">{{'PROJECT.CREATION_TIME' | translate}}</clr-dg-column>
<clr-dg-row *ngFor="let p of projects" [clrDgItem]="p">
<clr-dg-cell>
@ -18,6 +19,7 @@
<clr-dg-cell>{{ (p.metadata.public === 'true' ? 'PROJECT.PUBLIC' : 'PROJECT.PRIVATE') | translate}}</clr-dg-cell>
<clr-dg-cell *ngIf="showRoleInfo">{{roleInfo[p.current_user_role_id] | translate}}</clr-dg-cell>
<clr-dg-cell>{{p.repo_count}}</clr-dg-cell>
<clr-dg-cell>{{p.chart_count}}</clr-dg-cell>
<clr-dg-cell>{{p.creation_time | date: 'short'}}</clr-dg-cell>
</clr-dg-row>
<clr-dg-footer>

View File

@ -56,6 +56,7 @@ export class ListProjectComponent implements OnDestroy {
roleInfo = RoleInfo;
repoCountComparator: Comparator<Project> = new CustomComparator<Project>("repo_count", "number");
chartCountComparator: Comparator<Project> = new CustomComparator<Project>("chart_count", "number");
timeComparator: Comparator<Project> = new CustomComparator<Project>("creation_time", "date");
accessLevelComparator: Comparator<Project> = new CustomComparator<Project>("public", "string");
roleComparator: Comparator<Project> = new CustomComparator<Project>("current_user_role_id", "number");

View File

@ -41,6 +41,7 @@ export class Project {
update_time: Date;
current_user_role_id: number;
repo_count: number;
chart_count: number;
has_project_admin_role: boolean;
is_member: boolean;
role_name: string;

View File

@ -153,6 +153,7 @@
"ROLE": "Role",
"PUBLIC_OR_PRIVATE": "Access Level",
"REPO_COUNT": "Repositories Count",
"CHART_COUNT": "Chart Count",
"CREATION_TIME": "Creation Time",
"ACCESS_LEVEL": "Access Level",
"PUBLIC": "Public",

View File

@ -154,6 +154,7 @@
"PUBLIC_OR_PRIVATE": "Público",
"ACCESS_LEVEL": "Nivel de acceso",
"REPO_COUNT": "Contador de repositorios",
"CHART_COUNT": "Chart Count",
"CREATION_TIME": "Fecha de creación",
"PUBLIC": "Público",
"PRIVATE": "Privado",

View File

@ -139,6 +139,7 @@
"ROLE": "Rôle",
"PUBLIC_OR_PRIVATE": "Niveau d'Accès",
"REPO_COUNT": "Nombre de dépôts",
"CHART_COUNT": "Chart Count",
"CREATION_TIME": "Heure de création",
"ACCESS_LEVEL": "Niveau d'Accès",
"PUBLIC": "Public",

View File

@ -151,6 +151,7 @@
"ROLE": "Função",
"PUBLIC_OR_PRIVATE": "Nível de acesso",
"REPO_COUNT": "Quantidade de repositórios",
"CHART_COUNT": "Chart Count",
"CREATION_TIME": "Data de criação",
"ACCESS_LEVEL": "Nível de acesso",
"PUBLIC": "Público",

View File

@ -152,6 +152,7 @@
"ROLE": "角色",
"PUBLIC_OR_PRIVATE": "访问级别",
"REPO_COUNT": "镜像仓库数",
"CHART_COUNT": "Helm Chart 数目",
"CREATION_TIME": "创建时间",
"ACCESS_LEVEL": "访问级别",
"PUBLIC": "公开",