mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-23 10:45:45 +01:00
commit
3820c91ef1
@ -55,7 +55,7 @@ export class VulnerabilityConfigComponent implements OnInit {
|
|||||||
|
|
||||||
get scanAvailable(): boolean {
|
get scanAvailable(): boolean {
|
||||||
let dt: Date = new Date();
|
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 {
|
get nextScanTimestamp(): Date {
|
||||||
@ -256,6 +256,10 @@ export class VulnerabilityConfigComponent implements OnInit {
|
|||||||
return;//Aoid duplicated submitting
|
return;//Aoid duplicated submitting
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!this.scanAvailable) {
|
||||||
|
return; //Aoid page hacking
|
||||||
|
}
|
||||||
|
|
||||||
this.onSubmitting = true;
|
this.onSubmitting = true;
|
||||||
toPromise<any>(this.scanningService.startScanningAll())
|
toPromise<any>(this.scanningService.startScanningAll())
|
||||||
.then(() => {
|
.then(() => {
|
||||||
@ -271,7 +275,13 @@ export class VulnerabilityConfigComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.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;
|
this.onSubmitting = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
"clarity-icons": "^0.9.8",
|
"clarity-icons": "^0.9.8",
|
||||||
"clarity-ui": "^0.9.8",
|
"clarity-ui": "^0.9.8",
|
||||||
"core-js": "^2.4.1",
|
"core-js": "^2.4.1",
|
||||||
"harbor-ui": "0.3.49",
|
"harbor-ui": "0.3.54",
|
||||||
"intl": "^1.2.5",
|
"intl": "^1.2.5",
|
||||||
"mutationobserver-shim": "^0.3.2",
|
"mutationobserver-shim": "^0.3.2",
|
||||||
"ngx-cookie": "^1.0.0",
|
"ngx-cookie": "^1.0.0",
|
||||||
|
@ -413,6 +413,7 @@
|
|||||||
},
|
},
|
||||||
"SCANNING": {
|
"SCANNING": {
|
||||||
"TRIGGER_SCAN_ALL_SUCCESS": "Trigger scan all successfully!",
|
"TRIGGER_SCAN_ALL_SUCCESS": "Trigger scan all successfully!",
|
||||||
|
"TRIGGER_SCAN_ALL_FAIL": "Failed to trigger scan all with error: {{error}",
|
||||||
"TITLE": "Vulnerability Scanning",
|
"TITLE": "Vulnerability Scanning",
|
||||||
"SCAN_ALL": "Scan All",
|
"SCAN_ALL": "Scan All",
|
||||||
"SCAN_NOW": "SCAN NOW",
|
"SCAN_NOW": "SCAN NOW",
|
||||||
|
@ -414,6 +414,7 @@
|
|||||||
},
|
},
|
||||||
"SCANNING": {
|
"SCANNING": {
|
||||||
"TRIGGER_SCAN_ALL_SUCCESS": "Trigger scan all successfully!",
|
"TRIGGER_SCAN_ALL_SUCCESS": "Trigger scan all successfully!",
|
||||||
|
"TRIGGER_SCAN_ALL_FAIL": "Failed to trigger scan all with error: {{error}",
|
||||||
"TITLE": "Vulnerability Scanning",
|
"TITLE": "Vulnerability Scanning",
|
||||||
"SCAN_ALL": "Scan All",
|
"SCAN_ALL": "Scan All",
|
||||||
"SCAN_NOW": "SCAN NOW",
|
"SCAN_NOW": "SCAN NOW",
|
||||||
|
@ -412,7 +412,8 @@
|
|||||||
"SCOPE": "LDAP搜索范围"
|
"SCOPE": "LDAP搜索范围"
|
||||||
},
|
},
|
||||||
"SCANNING": {
|
"SCANNING": {
|
||||||
"TRIGGER_SCAN_ALL_SUCCESS": "成功启动扫描所有镜像任务!",
|
"TRIGGER_SCAN_ALL_SUCCESS": "启动扫描所有镜像任务成功!",
|
||||||
|
"TRIGGER_SCAN_ALL_FAIL": "启动扫描所有镜像任务失败:{{error}",
|
||||||
"TITLE": "缺陷扫描",
|
"TITLE": "缺陷扫描",
|
||||||
"SCAN_ALL": "扫描所有",
|
"SCAN_ALL": "扫描所有",
|
||||||
"SCAN_NOW": "开始扫描",
|
"SCAN_NOW": "开始扫描",
|
||||||
|
Loading…
Reference in New Issue
Block a user