Skip to content

Commit

Permalink
Add logs column for worker datagrid (goharbor#18307)
Browse files Browse the repository at this point in the history
1. Related back-end PR goharbor#18261

Signed-off-by: AllForNothing <sshijun@vmware.com>
  • Loading branch information
AllForNothing authored Mar 7, 2023
1 parent 38d7eda commit 1238384
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ <h2>{{ 'JOB_SERVICE_DASHBOARD.WORKERS' | translate }}</h2>
<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>
Expand All @@ -114,6 +115,15 @@ <h2>{{ 'JOB_SERVICE_DASHBOARD.WORKERS' | translate }}</h2>
<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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -209,4 +210,8 @@ export class WorkerListComponent implements OnInit, OnDestroy {
},
});
}

viewLog(jobId: number | string): string {
return `${CURRENT_BASE_HREF}/jobservice/jobs/${jobId}/log`;
}
}

0 comments on commit 1238384

Please sign in to comment.