mirror of
https://github.com/goharbor/harbor.git
synced 2024-09-27 21:12:42 +02:00
Improve stop button for replication (#14346)
Signed-off-by: AllForNothing <sshijun@vmware.com>
This commit is contained in:
parent
5cae2d5d9a
commit
afd29280ab
@ -1,7 +1,6 @@
|
||||
<div class="replication-tasks">
|
||||
<section class="overview-section">
|
||||
<div class="title-wrapper">
|
||||
<div>
|
||||
<div>
|
||||
<a (click)="onBack()" class="onback"><{{'PROJECT_DETAIL.REPLICATION'|
|
||||
translate}}</a>
|
||||
@ -13,7 +12,7 @@
|
||||
<span class="id-divider"></span>
|
||||
<h2 class="custom-h2 h2-style">{{executionId}}</h2>
|
||||
</div>
|
||||
<div>
|
||||
<div class="margin-top-16px">
|
||||
<div class="status-progress" *ngIf="execution && execution['status'] === 'InProgress'">
|
||||
<span class="spinner spinner-inline"></span>
|
||||
<span>{{'REPLICATION.IN_PROGRESS'| translate}}</span>
|
||||
@ -27,13 +26,12 @@
|
||||
<span>{{'REPLICATION.FAILURE'| translate}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="margin-top-16px">
|
||||
<button class="btn btn-primary " (click)="stopJob()"
|
||||
[disabled]="stopOnGoing">{{'REPLICATION.STOPJOB' | translate}}</button>
|
||||
[disabled]="stopOnGoing || !canStop()">{{'REPLICATION.STOPJOB' | translate}}</button>
|
||||
<span class="spinner spinner-inline" [hidden]="inProgress === false"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="execution-block">
|
||||
|
@ -13,7 +13,7 @@
|
||||
width: 250px;
|
||||
}
|
||||
>div:nth-child(2) {
|
||||
width: 140px;
|
||||
width: 150px;
|
||||
span {
|
||||
color: #007cbb;
|
||||
font-size: 12px;
|
||||
@ -25,7 +25,7 @@
|
||||
height: 25px;
|
||||
width: 2px;
|
||||
background-color: #cccccc;
|
||||
margin: 0 20px;
|
||||
margin: 0 20px -2px 20px;
|
||||
}
|
||||
.h2-style {
|
||||
display: inline-block;
|
||||
@ -110,3 +110,6 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
.margin-top-16px {
|
||||
margin-top: 16px;
|
||||
}
|
@ -230,4 +230,8 @@ export class ReplicationTasksComponent implements OnInit, OnDestroy {
|
||||
return status;
|
||||
}
|
||||
|
||||
canStop() {
|
||||
return this.execution && this.execution.status === 'InProgress';
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -47,7 +47,7 @@
|
||||
<clr-datagrid [(clrDgSelected)]="selectedRow" [clrDgLoading]="jobsLoading" (clrDgRefresh)="clrLoadJobs($event)">
|
||||
<clr-dg-action-bar>
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-secondary" *ngIf="isSystemAdmin" [disabled]="!(jobs && jobs.length>0) || isStopOnGoing || !selectedRow.length"
|
||||
<button type="button" class="btn btn-secondary" *ngIf="isSystemAdmin" [disabled]="!canStop() || !(jobs && jobs.length>0) || isStopOnGoing || !selectedRow.length"
|
||||
(click)="openStopExecutionsDialog(selectedRow)">{{'REPLICATION.STOPJOB' | translate}}</button>
|
||||
</div>
|
||||
</clr-dg-action-bar>
|
||||
|
@ -401,6 +401,10 @@ export class ReplicationComponent implements OnInit, OnDestroy {
|
||||
);
|
||||
this.StopConfirmDialog.open(StopExecutionsMessage);
|
||||
}
|
||||
canStop() {
|
||||
return this.selectedRow && this.selectedRow[0]
|
||||
&& this.selectedRow[0].status === 'InProgress';
|
||||
}
|
||||
|
||||
confirmStop(message: ConfirmationAcknowledgement) {
|
||||
if (
|
||||
|
Loading…
Reference in New Issue
Block a user