Merge pull request #6424 from pureshine/scan-now

Don't get the next available time while scan now
This commit is contained in:
Mia ZHOU 2018-12-06 12:44:56 +08:00 committed by GitHub
commit a16c7b07a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 11 deletions

View File

@ -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>

View File

@ -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 {