diff --git a/app/renderer/src/main/src/pages/risks/RisksViewer.tsx b/app/renderer/src/main/src/pages/risks/RisksViewer.tsx deleted file mode 100644 index 578a88d9d6..0000000000 --- a/app/renderer/src/main/src/pages/risks/RisksViewer.tsx +++ /dev/null @@ -1,123 +0,0 @@ -import React, {useRef} from "react" -import {Risk} from "@/pages/risks/schema" -import {Empty} from "antd" -import {RiskDetails, TitleColor} from "@/pages/risks/RiskTable" -import {showModal} from "@/utils/showModal" -import {TableResizableColumn} from "@/components/TableResizableColumn" -import {useInViewport} from "ahooks" - -export interface RisksViewerProp { - risks: Risk[] - tableContentHeight?: number -} -/** - * @deprecated - */ -export const RisksViewer: React.FC = React.memo((props) => { - const {tableContentHeight} = props - const ref = useRef(null) - const [inViewport] = useInViewport(ref) - return ( -
- {}} - autoHeight={typeof tableContentHeight === "number" ? tableContentHeight <= 0 : undefined} - height={tableContentHeight} - data={props.risks} - wordWrap={true} - renderEmpty={() => { - return - }} - columns={[ - { - dataKey: "TitleVerbose", - width: 400, - resizable: true, - minWidth: 400, - headRender: () => "标题", - cellRender: ({rowData, dataKey, ...props}: any) => { - return ( -
- {rowData?.TitleVerbose || rowData.Title} -
- ) - } - }, - { - dataKey: "RiskTypeVerbose", - width: 150, - minWidth: 150, - resizable: true, - headRender: () => "类型", - cellRender: ({rowData, dataKey, ...props}: any) => { - return rowData?.RiskTypeVerbose || rowData.RiskType - } - }, - { - dataKey: "Severity", - width: 90, - headRender: () => "等级", - cellRender: ({rowData, dataKey, ...props}: any) => { - const title = TitleColor.filter((item) => item.key.includes(rowData.Severity || ""))[0] - return ( - - {title ? title.name : rowData.Severity || "-"} - - ) - } - }, - { - dataKey: "IP", - width: 160, - headRender: () => "IP", - cellRender: ({rowData, dataKey, ...props}: any) => { - return rowData?.IP || "-" - } - }, - { - dataKey: "ReverseToken", - flexGrow: 1, - minWidth: 360, - headRender: () => "Token", - cellRender: ({rowData, dataKey, ...props}: any) => { - return rowData?.ReverseToken || "-" - } - }, - { - dataKey: "operate", - width: 90, - fixed: "right", - headRender: () => "操作", - cellRender: ({rowData}: any) => { - return ( - { - showModal({ - width: "80%", - title: "详情", - content: ( -
- -
- ) - }) - }} - > - 详情 -
- ) - } - } - ].map((item) => { - item["verticalAlign"] = "middle" - return item - })} - /> -
- ) -})