mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-28 19:47:58 +01:00
Don't get the next available time while scan now
Signed-off-by: FangyuanCheng <fangyuanc@vmware.com>
This commit is contained in:
parent
3356368bff
commit
2e0fcab6ee
@ -49,7 +49,6 @@
|
||||
</div>
|
||||
<div class="btn-scan-right btn-scan">
|
||||
<button class="btn btn-primary btn-sm btn-scan" (click)="scanNow()" [disabled]="!scanAvailable">{{ 'CONFIG.SCANNING.SCAN_NOW' | translate }}</button><br>
|
||||
<span *ngIf="!scanAvailable">{{ 'CONFIG.SCANNING.NEXT_SCAN' | translate }} {{ nextScanTimestamp | date:'y/MM/dd HH:mm' }}</span>
|
||||
</div>
|
||||
</section>
|
||||
</form>
|
@ -65,16 +65,7 @@ export class VulnerabilityConfigComponent implements OnInit {
|
||||
) { }
|
||||
|
||||
get scanAvailable(): boolean {
|
||||
let dt: Date = new Date();
|
||||
return !this.onSubmitting && (this.nextScanTime <= 0 || dt.getTime() > ((this.nextScanTime + 300) * 1000));
|
||||
}
|
||||
|
||||
get nextScanTimestamp(): Date {
|
||||
return this.nextScanTime > 0 ? this.convertToLocalTime(this.nextScanTime) : null;
|
||||
}
|
||||
|
||||
get nextScanTime(): number {
|
||||
return this.systemInfo && this.systemInfo.next_scan_all ? this.systemInfo.next_scan_all : 0;
|
||||
return !this.onSubmitting;
|
||||
}
|
||||
|
||||
get updatedTimestamp(): Date {
|
||||
|
Loading…
Reference in New Issue
Block a user