mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-23 10:45:45 +01:00
Merge pull request #6424 from pureshine/scan-now
Don't get the next available time while scan now
This commit is contained in:
commit
a16c7b07a9
@ -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