Skip to content

Commit

Permalink
feat: 漏洞与风险页代码调整
Browse files Browse the repository at this point in the history
  • Loading branch information
b1rdfree committed Mar 31, 2022
1 parent 8161d0a commit d6dba15
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 14 deletions.
11 changes: 0 additions & 11 deletions app/renderer/src/main/src/pages/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,4 @@

.main-container-cion:hover{
color: #1890ff;
}

/* 全局公共内容颜色类 */
.title-red{
color: #f5222d;
}
.title-orange{
color: #fa8c16;
}
.title-gray{
color: #8c8c8c;
}
21 changes: 21 additions & 0 deletions app/renderer/src/main/src/pages/risks/RiskTable.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.title-debug{
color: #000000;
}
.title-info{
color: #8c8c8c;
}
.title-low{
color: #ffa940;
}
.title-middle{
color: #ff7a45;
}
.title-high{
color: #f5222d;
}
.title-fatal{
color: #a8071a;
}
.title-default{
color: #000000;
}
16 changes: 13 additions & 3 deletions app/renderer/src/main/src/pages/risks/RiskTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import {showModal} from "../../utils/showModal"
import ReactJson from "react-json-view"
import {InputItem, ManyMultiSelectForString} from "../../utils/inputUtil"

import "./RiskTable.css"

export interface RiskTableProp {
}

Expand Down Expand Up @@ -60,6 +62,15 @@ const mergeFieldNames = (f: Fields) => {
return items
}

const TitleColor = [
{key: ["trace", "debug", "note"], value: "title-debug", name: "调试信息"},
{key: ["info", "fingerprint", "infof", "default"], value: "title-info", name: "信息/指纹"},
{key: ["low"], value: "title-low", name: "低危"},
{key: ["middle", "warn", "warning"], value: "title-middle", name: "中危"},
{key: ["high"], value: "title-high", name: "高危"},
{key: ["fatal", "critical", "panic"], value: "title-fatal", name: "严重"},
]

export const RiskTable: React.FC<RiskTableProp> = (props) => {
const [response, setResponse] = useState<QueryGeneralResponse<Risk>>({
Data: [],
Expand Down Expand Up @@ -223,9 +234,8 @@ export const RiskTable: React.FC<RiskTableProp> = (props) => {
{
title: "等级",
render: (i: Risk) => {
const filter = severities.filter(item => item.Names[0] === i.Severity)
const color: string = {high: "title-red", info: "title-gray", low: "title-orange"}[filter[0]?.Names[0] || ""] || ""
return <span className={color}>{filter.length === 0 ? "-" : filter[0].Verbose}</span>
const title = TitleColor.filter(item => item.key.includes(i.Severity || ""))[0]
return <span className={title.value}>{title ? title.name : i.Severity || "-"}</span>
},
width: 90
},
Expand Down

0 comments on commit d6dba15

Please sign in to comment.