mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-05 01:59:44 +01:00
fix issue #2811
This commit is contained in:
parent
7c358f1309
commit
f3c1caeb3c
@ -55,7 +55,7 @@ export class VulnerabilityConfigComponent implements OnInit {
|
||||
|
||||
get scanAvailable(): boolean {
|
||||
let dt: Date = new Date();
|
||||
return !this.onSubmitting && (this.nextScanTime <= 0 || dt.getTime() > ((this.nextScanTime + 30) * 1000));
|
||||
return !this.onSubmitting && (this.nextScanTime <= 0 || dt.getTime() > ((this.nextScanTime + 300) * 1000));
|
||||
}
|
||||
|
||||
get nextScanTimestamp(): Date {
|
||||
@ -256,6 +256,10 @@ export class VulnerabilityConfigComponent implements OnInit {
|
||||
return;//Aoid duplicated submitting
|
||||
}
|
||||
|
||||
if(!this.scanAvailable) {
|
||||
return; //Aoid page hacking
|
||||
}
|
||||
|
||||
this.onSubmitting = true;
|
||||
toPromise<any>(this.scanningService.startScanningAll())
|
||||
.then(() => {
|
||||
@ -271,7 +275,13 @@ export class VulnerabilityConfigComponent implements OnInit {
|
||||
});
|
||||
})
|
||||
.catch(error => {
|
||||
this.errorHandler.error(error);
|
||||
if (error && error.status && error.status === 412) {
|
||||
this.translate.get("CONFIG.SCANNING.TRIGGER_SCAN_ALL_FAIL", { error: '' + error }).subscribe((res: string) => {
|
||||
this.errorHandler.error(res);
|
||||
});
|
||||
} else {
|
||||
this.errorHandler.error(error);
|
||||
}
|
||||
this.onSubmitting = false;
|
||||
});
|
||||
}
|
||||
|
@ -31,7 +31,7 @@
|
||||
"clarity-icons": "^0.9.8",
|
||||
"clarity-ui": "^0.9.8",
|
||||
"core-js": "^2.4.1",
|
||||
"harbor-ui": "0.3.49",
|
||||
"harbor-ui": "0.3.54",
|
||||
"intl": "^1.2.5",
|
||||
"mutationobserver-shim": "^0.3.2",
|
||||
"ngx-cookie": "^1.0.0",
|
||||
|
@ -413,6 +413,7 @@
|
||||
},
|
||||
"SCANNING": {
|
||||
"TRIGGER_SCAN_ALL_SUCCESS": "Trigger scan all successfully!",
|
||||
"TRIGGER_SCAN_ALL_FAIL": "Failed to trigger scan all with error: {{error}",
|
||||
"TITLE": "Vulnerability Scanning",
|
||||
"SCAN_ALL": "Scan All",
|
||||
"SCAN_NOW": "SCAN NOW",
|
||||
|
@ -414,6 +414,7 @@
|
||||
},
|
||||
"SCANNING": {
|
||||
"TRIGGER_SCAN_ALL_SUCCESS": "Trigger scan all successfully!",
|
||||
"TRIGGER_SCAN_ALL_FAIL": "Failed to trigger scan all with error: {{error}",
|
||||
"TITLE": "Vulnerability Scanning",
|
||||
"SCAN_ALL": "Scan All",
|
||||
"SCAN_NOW": "SCAN NOW",
|
||||
|
@ -412,7 +412,8 @@
|
||||
"SCOPE": "LDAP搜索范围"
|
||||
},
|
||||
"SCANNING": {
|
||||
"TRIGGER_SCAN_ALL_SUCCESS": "成功启动扫描所有镜像任务!",
|
||||
"TRIGGER_SCAN_ALL_SUCCESS": "启动扫描所有镜像任务成功!",
|
||||
"TRIGGER_SCAN_ALL_FAIL": "启动扫描所有镜像任务失败:{{error}",
|
||||
"TITLE": "缺陷扫描",
|
||||
"SCAN_ALL": "扫描所有",
|
||||
"SCAN_NOW": "开始扫描",
|
||||
|
Loading…
Reference in New Issue
Block a user