Add logs column for worker datagrid (#18307)

1. Related back-end PR #18261

Signed-off-by: AllForNothing <sshijun@vmware.com>
This commit is contained in:
Shijun Sun 2023-03-07 19:58:39 +08:00 committed by GitHub
parent 38d7eda1ad
commit 1238384428
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 0 deletions

View File

@ -105,6 +105,7 @@
<clr-dg-column [clrDgField]="'checkin_at'">{{
'JOB_SERVICE_DASHBOARD.CHECK_IN_AT' | translate
}}</clr-dg-column>
<clr-dg-column>{{ 'REPLICATION.LOGS' | translate }}</clr-dg-column>
<clr-dg-placeholder>{{
'JOB_SERVICE_DASHBOARD.NO_WORKER' | translate
}}</clr-dg-placeholder>
@ -114,6 +115,15 @@
<clr-dg-cell>{{ w.job_id }}</clr-dg-cell>
<clr-dg-cell>{{ w.start_at | harborDatetime }}</clr-dg-cell>
<clr-dg-cell>{{ w.checkin_at | harborDatetime }}</clr-dg-cell>
<clr-dg-cell>
<a
rel="noopener noreferrer"
target="_blank"
[href]="viewLog(w.job_id)"
*ngIf="w.job_id">
<clr-icon shape="list"></clr-icon>
</a>
</clr-dg-cell>
</clr-dg-row>
<clr-dg-footer>
<clr-dg-pagination

View File

@ -6,6 +6,7 @@ import { JobserviceService } from 'ng-swagger-gen/services';
import { finalize, forkJoin, Subscription } from 'rxjs';
import { MessageHandlerService } from 'src/app/shared/services/message-handler.service';
import {
CURRENT_BASE_HREF,
getPageSizeFromLocalStorage,
PageSizeMapKeys,
setPageSizeToLocalStorage,
@ -209,4 +210,8 @@ export class WorkerListComponent implements OnInit, OnDestroy {
},
});
}
viewLog(jobId: number | string): string {
return `${CURRENT_BASE_HREF}/jobservice/jobs/${jobId}/log`;
}
}