Merge pull request #12391 from jwangyangls/fix-replication-repo

[fix] [replication] Success rate should be displayed as 0 when status is inprogress
This commit is contained in:
jwangyangls 2020-07-06 10:09:20 +08:00 committed by GitHub
commit e498893777
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -122,7 +122,7 @@ export class RepositoryGridviewComponent implements OnChanges, OnInit, OnDestroy
}
goIntoRepo(repoEvt: NewRepository): void {
let linkUrl = ['harbor', 'projects', repoEvt.project_id, 'repositories', repoEvt.name.split(`${this.projectName}/`)[1]];
let linkUrl = ['harbor', 'projects', repoEvt.project_id, 'repositories', repoEvt.name.substr(this.projectName.length + 1)];
this.router.navigate(linkUrl);
}
@ -223,7 +223,7 @@ export class RepositoryGridviewComponent implements OnChanges, OnInit, OnDestroy
operMessage.name = 'OPERATION.DELETE_REPO';
operMessage.data.id = repo.id;
operMessage.state = OperationState.progressing;
repo.name = repo.name.split(`${this.projectName}/`)[1];
repo.name = repo.name.substr(this.projectName.length + 1);
operMessage.data.name = repo.name;
this.operationService.publishInfo(operMessage);

View File

@ -69,7 +69,7 @@ export class ListRepositoryROComponent implements OnInit, OnDestroy {
public gotoLink(projectId: number, repoName: string): void {
this.searchTrigger.closeSearch(true);
let projectName = repoName.split('/')[0];
let repositorieName = projectName ? repoName.split(`${projectName}/`)[1] : repoName;
let repositorieName = projectName ? repoName.substr(projectName.length + 1) : repoName;
let linkUrl = ['harbor', 'projects', projectId, 'repositories', repositorieName ];
this.router.navigate(linkUrl);
}

View File

@ -77,7 +77,7 @@
<clr-dg-cell>{{j.start_time | date: 'short'}}</clr-dg-cell>
<clr-dg-cell>{{getDuration(j)}}</clr-dg-cell>
<clr-dg-cell>
{{(j.total > 0 ? j.succeed / j.total : 1)| percent }}
{{(j.status === 'InProgress'? (j.total > 0 ? j.succeed / j.total : 0): j.total > 0 ? j.succeed / j.total : 1)| percent }}
</clr-dg-cell>
<clr-dg-cell>{{j.total}}</clr-dg-cell>
</clr-dg-row>