Merge pull request #11332 from AllForNothing/scan-result-modify

Modify UI for scanning result
This commit is contained in:
Will Sun 2020-03-30 09:47:45 +08:00 committed by GitHub
commit 9a205ddbc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 25 additions and 5 deletions

View File

@ -1,4 +1,4 @@
<div class="tip-wrapper width-210">
<div class="tip-wrapper width-215">
<clr-tooltip *ngIf="!isNone">
<div clrTooltipTrigger class="level-border">
<div [className]="getClass()">
@ -75,10 +75,20 @@
<span class="bar-scanning-time">{{'VULNERABILITY.CHART.SCANNING_TIME' | translate}} </span>
<span>{{completeTimestamp | date:'short'}}</span>
</div>
<div>
</clr-tooltip-content>
</clr-tooltip>
<clr-tooltip class="margin-left-5" *ngIf="isLimitedSuccess()">
<div clrTooltipTrigger>
<clr-icon shape="exclamation-triangle" size="20" class="is-warning"></clr-icon>
</div>
<clr-tooltip-content [clrSize]="'lg'" *clrIfOpen>
<div class="font-weight-600">
<span class="bar-scanning-time">{{'VULNERABILITY.CHART.SCANNING_PERCENT' | translate}} </span>
<span>{{completePercent}}</span>
</div>
<div>
<span>{{'VULNERABILITY.CHART.SCANNING_PERCENT_EXPLAIN' | translate}}</span>
</div>
</clr-tooltip-content>
</clr-tooltip>
</div>

View File

@ -212,8 +212,8 @@ hr {
width: $thirty-pixel;
}
.width-210 {
width: 210px;
.width-215 {
width: 215px;
}
.width-150 {

View File

@ -6,6 +6,7 @@ import { VULNERABILITY_SCAN_STATUS, VULNERABILITY_SEVERITY } from "../../../../.
const MIN = 60;
const MIN_STR = "min ";
const SEC_STR = "sec";
const SUCCESS_PCT: number = 100;
const CLASS_MAP = {
"CRITICAL": "level-critical",
"HIGH": "level-high",
@ -150,7 +151,10 @@ export class ResultTipHistogramComponent implements OnInit {
return 0;
}
public get completePercent(): string {
return this.vulnerabilitySummary ? `${this.vulnerabilitySummary.complete_percent}%` : '0%'
return this.vulnerabilitySummary ? `${this.vulnerabilitySummary.complete_percent}%` : '0%';
}
isLimitedSuccess(): boolean {
return this.vulnerabilitySummary && this.vulnerabilitySummary.complete_percent < SUCCESS_PCT;
}
get completeTimestamp(): Date {
return this.vulnerabilitySummary && this.vulnerabilitySummary.end_time ? this.vulnerabilitySummary.end_time : new Date();

View File

@ -992,6 +992,7 @@
"CHART": {
"SCANNING_TIME": "Scan completed time:",
"SCANNING_PERCENT": "Scan completed percent:",
"SCANNING_PERCENT_EXPLAIN": "(Scan completed percentage is calculated as # of successfully scanned images / total number of images referenced within the image index not including the index file itself and the images that do not support being scanned.)",
"TOOLTIPS_TITLE": "{{totalVulnerability}} of {{totalPackages}} {{package}} have known {{vulnerability}}.",
"TOOLTIPS_TITLE_SINGULAR": "{{totalVulnerability}} of {{totalPackages}} {{package}} has known {{vulnerability}}.",
"TOOLTIPS_TITLE_ZERO": "No recognizable vulnerability found"

View File

@ -991,6 +991,7 @@
"CHART": {
"SCANNING_TIME": "Scan completed time:",
"SCANNING_PERCENT": "Scan completed percent:",
"SCANNING_PERCENT_EXPLAIN": "(Scan completed percentage is calculated as # of successfully scanned images / total number of images referenced within the image index not including the index file itself and the images that do not support being scanned.)",
"TOOLTIPS_TITLE": "{{totalVulnerability}} of {{totalPackages}} {{package}} have known {{vulnerability}}.",
"TOOLTIPS_TITLE_SINGULAR": "{{totalVulnerability}} of {{totalPackages}} {{package}} has known {{vulnerability}}.",
"TOOLTIPS_TITLE_ZERO": "No recognizable vulnerability found"

View File

@ -964,6 +964,7 @@
"CHART": {
"SCANNING_TIME": "Temps d'analyse complète :",
"SCANNING_PERCENT": "Scan completed percent:",
"SCANNING_PERCENT_EXPLAIN": "(Scan completed percentage is calculated as # of successfully scanned images / total number of images referenced within the image index not including the index file itself and the images that do not support being scanned.)",
"TOOLTIPS_TITLE": "{{totalVulnerability}} de {{totalPackages}} {{package}} ont des {{vulnerability}} connues.",
"TOOLTIPS_TITLE_SINGULAR": "{{totalVulnerability}} de {{totalPackages}} {{package}} a des {{vulnerability}} connues.",
"TOOLTIPS_TITLE_ZERO": "No recognizable vulnerability found"

View File

@ -987,6 +987,7 @@
"CHART": {
"SCANNING_TIME": "Tempo de conclusão da análise:",
"SCANNING_PERCENT": "Scan completed percent:",
"SCANNING_PERCENT_EXPLAIN": "(Scan completed percentage is calculated as # of successfully scanned images / total number of images referenced within the image index not including the index file itself and the images that do not support being scanned.)",
"TOOLTIPS_TITLE": "{{totalVulnerability}} de {{totalPackages}} {{package}} possuem {{vulnerability}}.",
"TOOLTIPS_TITLE_SINGULAR": "{{totalVulnerability}} de {{totalPackages}} {{package}} possuem {{vulnerability}}.",
"TOOLTIPS_TITLE_ZERO": "No recognizable vulnerability found"

View File

@ -992,6 +992,7 @@
"CHART": {
"SCANNING_TIME": "Tarama tamamlanma zamanı:",
"SCANNING_PERCENT": "Scan completed percent:",
"SCANNING_PERCENT_EXPLAIN": "(Scan completed percentage is calculated as # of successfully scanned images / total number of images referenced within the image index not including the index file itself and the images that do not support being scanned.)",
"TOOLTIPS_TITLE": "{{totalVulnerability}} 'nın {{totalPackages}} {{package}} bilinen {{vulnerability}}.",
"TOOLTIPS_TITLE_SINGULAR": "{{totalVulnerability}} 'nın {{totalPackages}} {{package}} bilinen {{vulnerability}}.",
"TOOLTIPS_TITLE_ZERO": "No recognizable vulnerability found"

View File

@ -991,6 +991,7 @@
"CHART": {
"SCANNING_TIME": "扫描完成时间:",
"SCANNING_PERCENT": "扫描完成度:",
"SCANNING_PERCENT_EXPLAIN": "(扫描完成度是扫描成功的镜像数与总共需要扫描的镜像数的比值。总共需要的扫描的镜像不包含 Index 本身和不支持扫描的镜像。)",
"TOOLTIPS_TITLE": "{{totalPackages}}个{{package}}中的{{totalVulnerability}}个含有{{vulnerability}}。",
"TOOLTIPS_TITLE_SINGULAR": "{{totalPackages}}个{{package}}中的{{totalVulnerability}}个含有{{vulnerability}}。",
"TOOLTIPS_TITLE_ZERO": "没有发现可识别的漏洞"