Skip to content

Commit

Permalink
修复了可能的性能问题
Browse files Browse the repository at this point in the history
  • Loading branch information
VillanCh committed Jan 9, 2022
1 parent c38136a commit 41b75aa
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
1 change: 0 additions & 1 deletion app/main/handlers/terminal.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ module.exports = (win, getClient) => {
if (!existed) {
return
}
console.info(buf)
existed.process.stdin.write(buf)
})
}
2 changes: 2 additions & 0 deletions app/protos/grpc.proto
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ message Risk {
int64 Id = 18;
int64 CreatedAt = 16;
int64 UpdatedAt = 17;

string Severity = 19;
}

message QueryRisksRequest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ export const FuzzerResponseTableEx: React.FC<FuzzerResponseTableProp> = (props)
const {content, setRequest} = props;
const [tableHeight, setTableHeight] = useState(0);
const pipeline = useTablePipeline({
components: antd,
components: antd, primaryKey: (raw: FuzzerResponse)=>{
return raw.UUID
}
}).input({
dataSource: content,
columns: props.success ? [
Expand Down
16 changes: 13 additions & 3 deletions app/renderer/src/main/src/pages/fuzzer/HTTPFuzzerResultsCard.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import React, {useState} from "react";
import React, {useEffect, useState} from "react";
import {Card, Space} from "antd";
import {FuzzerResponse} from "./HTTPFuzzerPage";
import {SelectOne} from "../../utils/inputUtil";
import {FuzzerResponseTableEx} from "./FuzzerResponseTable";
import {AutoCard} from "../../components/AutoCard";

export interface HTTPFuzzerResultsCardProp {
extra?: React.ReactNode
Expand All @@ -13,6 +14,13 @@ export interface HTTPFuzzerResultsCardProp {

export const HTTPFuzzerResultsCard: React.FC<HTTPFuzzerResultsCardProp> = (props) => {
const [showSuccess, setShowSuccess] = useState(true);
const [loading, setLoading] = useState(false);

useEffect(() => {
setLoading(true)
setTimeout(() => setLoading(false), 500)
}, [])

return <Card
size={"small"} style={{height: "100%"}}
className={"flex-card"}
Expand All @@ -29,13 +37,15 @@ export const HTTPFuzzerResultsCard: React.FC<HTTPFuzzerResultsCardProp> = (props
bodyStyle={{padding: 0, width: "100%"}}
>
<div style={{flex: 1}}>
{showSuccess ? <FuzzerResponseTableEx
{loading && <AutoCard loading={true}/>}
{(showSuccess && !loading) && <FuzzerResponseTableEx
success={showSuccess}
setRequest={s => {
props.setRequest && props.setRequest(s)
}}
content={props.successResponses}
/> : <FuzzerResponseTableEx
/>}
{(!showSuccess && !loading) && <FuzzerResponseTableEx
success={showSuccess}
setRequest={s => {
props.setRequest && props.setRequest(s)
Expand Down

0 comments on commit 41b75aa

Please sign in to comment.