Merge pull request #2969 from pengpengshui/master

fix #2893 about add tooltips title
This commit is contained in:
Steven Zou 2017-08-04 18:58:23 +08:00 committed by GitHub
commit 325eb6bbc1
6 changed files with 57 additions and 0 deletions

View File

@ -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) { }
ngOnInit(): void {

View File

@ -104,4 +104,16 @@ export const SCANNING_STYLES: string = `
.font-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;
}
`;

View File

@ -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-none" [style.width]='tipWidth(1)'></div>
<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>
<span class="bar-tooltip-font bar-tooltip-font-title">{{tipTitle}}</span>
</div>

View File

@ -501,6 +501,8 @@
"NONE": "none"
},
"SINGULAR": "vulnerability",
"OVERALL_SEVERITY": "Vulnerability Severity:",
"NO_VULNERABILITY": "No vulnerability",
"PLURAL": "vulnerabilities",
"PLACEHOLDER": "Filter Vulnerabilities",
"PACKAGE": "package",

View File

@ -500,6 +500,8 @@
"NONE": "none"
},
"SINGULAR": "vulnerability",
"OVERALL_SEVERITY": "Vulnerability Severity:",
"NO_VULNERABILITY": "No vulnerability",
"PLURAL": "vulnerabilities",
"PLACEHOLDER": "Filter Vulnerabilities",
"PACKAGE": "package",

View File

@ -501,6 +501,8 @@
"NONE": "无"
},
"SINGULAR": "漏洞",
"OVERALL_SEVERITY": "漏洞严重度:",
"NO_VULNERABILITY": "没有漏洞",
"PLURAL": "漏洞",
"PLACEHOLDER": "过滤漏洞",
"PACKAGE": "组件",