mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-27 04:35:16 +01:00
Merge pull request #2969 from pengpengshui/master
fix #2893 about add tooltips title
This commit is contained in:
commit
325eb6bbc1
@ -35,6 +35,22 @@ export class ResultTipComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
get scanLevel(){
|
||||||
|
let level;
|
||||||
|
if (this._highCount && this._highCount >= 1) {
|
||||||
|
level = VulnerabilitySeverity.HIGH;
|
||||||
|
}else if (this._mediumCount && this._mediumCount >= 1) {
|
||||||
|
level = VulnerabilitySeverity.MEDIUM;
|
||||||
|
}else if (this._lowCount && this._lowCount >= 1){
|
||||||
|
level = VulnerabilitySeverity.LOW;
|
||||||
|
}else if (this._unknownCount && this._unknownCount >= 1) {
|
||||||
|
level = VulnerabilitySeverity.UNKNOWN;
|
||||||
|
}else {
|
||||||
|
level = VulnerabilitySeverity.NONE;
|
||||||
|
}
|
||||||
|
return level;
|
||||||
|
}
|
||||||
|
|
||||||
constructor(private translate: TranslateService) { }
|
constructor(private translate: TranslateService) { }
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
|
@ -104,4 +104,16 @@ export const SCANNING_STYLES: string = `
|
|||||||
.font-color-green{
|
.font-color-green{
|
||||||
color:green;
|
color:green;
|
||||||
}
|
}
|
||||||
|
.bar-tooltip-font-larger span{
|
||||||
|
font-size:16px;
|
||||||
|
vertical-align:middle
|
||||||
|
}
|
||||||
|
hr{
|
||||||
|
border-bottom: 0;
|
||||||
|
border-color: #aaa;
|
||||||
|
margin: 6px -10px;
|
||||||
|
}
|
||||||
|
.font-weight-600{
|
||||||
|
font-weight:600;
|
||||||
|
}
|
||||||
`;
|
`;
|
@ -7,6 +7,29 @@ export const TIP_COMPONENT_HTML: string = `
|
|||||||
<div class="tip-wrapper tip-block bar-block-unknown" [style.width]='tipWidth(2)'></div>
|
<div class="tip-wrapper tip-block bar-block-unknown" [style.width]='tipWidth(2)'></div>
|
||||||
<div class="tip-wrapper tip-block bar-block-none" [style.width]='tipWidth(1)'></div>
|
<div class="tip-wrapper tip-block bar-block-none" [style.width]='tipWidth(1)'></div>
|
||||||
<clr-tooltip-content>
|
<clr-tooltip-content>
|
||||||
|
<div [ngSwitch]="scanLevel" class="bar-tooltip-font-larger">
|
||||||
|
<ng-template [ngSwitchCase]="5">
|
||||||
|
<clr-icon shape="exclamation-circle" class="is-error" size="32"></clr-icon>
|
||||||
|
<span>{{'VULNERABILITY.OVERALL_SEVERITY' | translate }} <span class="font-weight-600">{{'VULNERABILITY.SEVERITY.HIGH' | translate | titlecase }}</span></span>
|
||||||
|
</ng-template>
|
||||||
|
<ng-template [ngSwitchCase]="4">
|
||||||
|
<clr-icon *ngIf="hasMedium" shape="exclamation-triangle" class="tip-icon-medium" size="30"></clr-icon>
|
||||||
|
<span>{{'VULNERABILITY.OVERALL_SEVERITY' | translate }} <span class="font-weight-600">{{'VULNERABILITY.SEVERITY.MEDIUM' | translate | titlecase}}</span></span>
|
||||||
|
</ng-template>
|
||||||
|
<ng-template [ngSwitchCase]="3">
|
||||||
|
<clr-icon shape="play" class="tip-icon-low rotate-90" size="28"></clr-icon>
|
||||||
|
<span>{{'VULNERABILITY.OVERALL_SEVERITY' | translate }} <span class="font-weight-600">{{'VULNERABILITY.SEVERITY.LOW' | translate | titlecase }}</span></span>
|
||||||
|
</ng-template>
|
||||||
|
<ng-template [ngSwitchCase]="2">
|
||||||
|
<clr-icon shape="help" size="24" style="margin-left: 3px;"></clr-icon>
|
||||||
|
<span>{{'VULNERABILITY.OVERALL_SEVERITY' | translate }} <span class="font-weight-600">{{'VULNERABILITY.SEVERITY.UNKNOWN' | translate | titlecase }}</span></span>
|
||||||
|
</ng-template>
|
||||||
|
<ng-template [ngSwitchCase]="1">
|
||||||
|
<clr-icon shape="check-circle" class="is-success" size="32"></clr-icon>
|
||||||
|
<span>{{'VULNERABILITY.NO_VULNERABILITY' | translate }}</span>
|
||||||
|
</ng-template>
|
||||||
|
</div>
|
||||||
|
<hr>
|
||||||
<div>
|
<div>
|
||||||
<span class="bar-tooltip-font bar-tooltip-font-title">{{tipTitle}}</span>
|
<span class="bar-tooltip-font bar-tooltip-font-title">{{tipTitle}}</span>
|
||||||
</div>
|
</div>
|
||||||
|
@ -501,6 +501,8 @@
|
|||||||
"NONE": "none"
|
"NONE": "none"
|
||||||
},
|
},
|
||||||
"SINGULAR": "vulnerability",
|
"SINGULAR": "vulnerability",
|
||||||
|
"OVERALL_SEVERITY": "Vulnerability Severity:",
|
||||||
|
"NO_VULNERABILITY": "No vulnerability",
|
||||||
"PLURAL": "vulnerabilities",
|
"PLURAL": "vulnerabilities",
|
||||||
"PLACEHOLDER": "Filter Vulnerabilities",
|
"PLACEHOLDER": "Filter Vulnerabilities",
|
||||||
"PACKAGE": "package",
|
"PACKAGE": "package",
|
||||||
|
@ -500,6 +500,8 @@
|
|||||||
"NONE": "none"
|
"NONE": "none"
|
||||||
},
|
},
|
||||||
"SINGULAR": "vulnerability",
|
"SINGULAR": "vulnerability",
|
||||||
|
"OVERALL_SEVERITY": "Vulnerability Severity:",
|
||||||
|
"NO_VULNERABILITY": "No vulnerability",
|
||||||
"PLURAL": "vulnerabilities",
|
"PLURAL": "vulnerabilities",
|
||||||
"PLACEHOLDER": "Filter Vulnerabilities",
|
"PLACEHOLDER": "Filter Vulnerabilities",
|
||||||
"PACKAGE": "package",
|
"PACKAGE": "package",
|
||||||
|
@ -501,6 +501,8 @@
|
|||||||
"NONE": "无"
|
"NONE": "无"
|
||||||
},
|
},
|
||||||
"SINGULAR": "漏洞",
|
"SINGULAR": "漏洞",
|
||||||
|
"OVERALL_SEVERITY": "漏洞严重度:",
|
||||||
|
"NO_VULNERABILITY": "没有漏洞",
|
||||||
"PLURAL": "漏洞",
|
"PLURAL": "漏洞",
|
||||||
"PLACEHOLDER": "过滤漏洞",
|
"PLACEHOLDER": "过滤漏洞",
|
||||||
"PACKAGE": "组件",
|
"PACKAGE": "组件",
|
||||||
|
Loading…
Reference in New Issue
Block a user