Skip to content

Commit

Permalink
upgrade react
Browse files Browse the repository at this point in the history
  • Loading branch information
VillanCh committed Sep 8, 2022
1 parent dbae857 commit 286e0c3
Show file tree
Hide file tree
Showing 22 changed files with 153 additions and 246 deletions.
6 changes: 3 additions & 3 deletions app/renderer/src/main/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@
"@types/codemirror": "^5.60.5",
"@types/jest": "^26.0.15",
"@types/node": "^12.0.0",
"@types/react": "^17.0.0",
"@types/react": "^18.0.0",
"@types/react-copy-to-clipboard": "^5.0.1",
"@types/react-dom": "^17.0.0",
"@types/react-dom": "^18.0.0",
"@types/react-highlight-words": "^0.16.3",
"@types/react-resizable": "^1.7.4",
"@types/react-sparklines": "^1.7.2",
"@uiw/react-md-editor": "^3.6.5",
"ahooks": "^3.1.6",
"ali-react-table": "2.6.1",
"antd": "4.17.2",
"antd": "4.20.7",
"bizcharts": "^4.1.12",
"codemirror": "^5.63.3",
"cross-env": "7.0.3",
Expand Down
3 changes: 1 addition & 2 deletions app/renderer/src/main/src/components/HTTPFlowDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,6 @@ export const HTTPFlowDetailMini: React.FC<HTTPFlowDetailProp> = (props) => {
/>
}}
secondMinSize={300}
>
</ResizeBox>
/>
</AutoSpin>
}
8 changes: 3 additions & 5 deletions app/renderer/src/main/src/components/YakUpgrade.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,7 @@ export const YakUpgrade: React.FC<YakUpgradeProp> = (props) => {
手动下载完成后 Windows 用户可以把引擎放在 %HOME%/yakit-projects/yak-engine/yak.exe 即可识别
<br/>
MacOS / Linux 用户可以把引擎放在 ~/yakit-projects/yak-engine/yak 即可识别
</div>}>

</Alert>
</div>}/>
</Space>
})
}}>
Expand All @@ -228,8 +226,8 @@ export const YakUpgrade: React.FC<YakUpgradeProp> = (props) => {
<div style={{width: "100%", textAlign: "right"}}>
<Button type="link" danger={true} onClick={() => {
ipcRenderer.invoke("install-yakit", latestVersion).then(() => {
}).catch((err: any) => {
})
}).catch((err: any) => {
})
}}>
删除安装包
</Button>
Expand Down
8 changes: 2 additions & 6 deletions app/renderer/src/main/src/pages/fuzzer/StringFuzzer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,7 @@ export const StringFuzzer: React.FC<StringFuzzerProp> = (props) => {
setBuildTemp(r)
setEncodeTemp(undefined)
}}
>

</ManySelectOne>
/>
{buildTemp && <Form.Item label={" "} colon={false}>
<Card bordered={true} title={"基础标签"} size={"small"} extra={[
<Button
Expand Down Expand Up @@ -235,9 +233,7 @@ export const StringFuzzer: React.FC<StringFuzzerProp> = (props) => {
data={encodeOperators.map(i => {
return {value: i.name, text: i.name}
})}
>

</ManySelectOne>
/>
{/* {encodeTemp && <Form.Item
label={" "} colon={false}
help={"本标签一般负责对 Payload 进行编码等处理,可以嵌套在一个普通(基础)标签外部"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,7 @@ export const ICMPSizeLoggerPage: React.FC<ICMPSizeLoggerPageProp> = (props) => {
<CopyableField mark={true} text={`ping -c 4 -s ${sizeNow} ${host}`}/>}
<div>命令</div>
</Space>
</Space>}>

</Alert>
</Space>}/>
<Table<ICMPSizeLoggerInfo>
size={"small"}
dataSource={records}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,6 @@ export const BatchExecutorPageEx: React.FC<BatchExecutorPageExProp> = (props) =>
isAll={isAll}
executeHistory={executeHistory}
/>}
></ResizeBox>
/>
)
}
4 changes: 1 addition & 3 deletions app/renderer/src/main/src/pages/mitm/MITMContentReplacer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,7 @@ export const MITMContentReplacer: React.FC<MITMContentReplacerProp> = (props) =>
setRules([...rules])
}} value={i.ExtraTag.join(",")}
formItemStyle={{marginBottom: 0}}
>

</ManyMultiSelectForString>
/>
},
{
title: "操作", render: (i: MITMContentReplacerRule) => <Space>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,7 @@ export const MITMContentReplacerImport: React.FC<MITMContentReplacerImportProp>
setValue={e => {
setParams({...params, JsonRaw: Buffer.from(e)})
}}
>

</YakEditor>}
/>}
</div>
</Form.Item>
<SwitchItem label={"全部替换"} setValue={ReplaceAll => setParams({...params, ReplaceAll})}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,7 @@ export const MITMContentReplacerViewer: React.FC<MITMContentReplacerViewerProp>
setRules([...rules])
}} value={i.ExtraTag.join(",")}
formItemStyle={{marginBottom: 0}}
>

</ManyMultiSelectForString>
/>
},
{
title: "操作", render: (i: MITMContentReplacerRule) => <Space>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ const SingleHttpFlowViewer: React.FC<SingleHttpFlowViewerProps> = React.memo(pro

</Space>
)}
>

</HTTPPacketEditor>
/>
)
})
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,5 @@ export const PacketScanResult: React.FC<PacketScanResultProp> = (props) => {
feature={infoState.featureMessageState}
statusCards={infoState.statusState}
onXtermRef={setXtermRef}
>

</PluginResultUI>

/>
};
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const PacketScanner: React.FC<PacketScannerProp> = (props) => {
httpRequest={HttpRequest}
/>
)}
></ResizeBox>
/>
</div>
)
}
Expand Down Expand Up @@ -133,7 +133,7 @@ const PacketScannerViewer: React.FC<PacketScannerFormProp> = React.memo((props)
secondNode={() => {
return <PacketScanResult token={token} />
}}
></ResizeBox>
/>
)
})

Expand Down
2 changes: 1 addition & 1 deletion app/renderer/src/main/src/pages/portscan/PortScanPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ const ScanPortForm: React.FC<ScanPortFormProp> = (props) => {
]}
setValue={(i) => setParams({...params, Proto: [i]})}
value={(params.Proto || []).length > 0 ? params.Proto[0] : "tcp"}
></SelectOne>
/>
{(params.Mode === "all" || params.Mode === "syn") && (
<>
<Divider orientation={"left"}>SYN 配置</Divider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,7 @@ export const RandomPortLogPage: React.FC<RandomPortLogPageProp> = (props) => {
</Space>
</Space> : <Spin/>}
{randomPort > 0 && !loading ? <CopyableField text={`${randomPort}`}/> : <Spin/>}
</Space>}>

</Alert>
</Space>}/>
<Table<RandomPortTriggerNotification>
size={"small"}
pagination={false}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,7 @@ export const ReverseServerPage: React.FC<ReverseServerPageProp> = (props) => {
本地 HTTPS 反连 <CopyableField
text={`https://${bridgeIP && params.ConnectParam?.Addr ? bridgeIP : "127.0.0.1"}:${params.LocalFacadePort}/${reverseToken}`}/>
</Space>
</Space>}>
</Alert>}
</Space>}/>}
</PageHeader>
<Row>
<div style={{width: "100%"}}>
Expand Down
2 changes: 1 addition & 1 deletion app/renderer/src/main/src/pages/risks/RiskTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,7 @@ export const RiskDetails: React.FC<RiskDetailsProp> = React.memo((props: RiskDet
</Descriptions.Item>
)}
<Descriptions.Item label='详情' span={3}>
<div style={{maxHeight: 180, overflow: "auto"}}>{info.Details || "-"}</div>
<div style={{maxHeight: 180, overflow: "auto"}}>{`${info.Details}` || "-"}</div>
</Descriptions.Item>
</>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,7 @@ export const WebsocketClientOperator: React.FC<WebsocketClientOperatorProp> = (p
<SelectOne size={"small"} data={[
{value: "request", text: "请求"},
{value: "response", text: "响应"},
]} value={mode} setValue={setMode} formItemStyle={{marginBottom: 0}}>

</SelectOne>
]} value={mode} setValue={setMode} formItemStyle={{marginBottom: 0}}/>
{websocketBuildFinished ? <Tag color={"green"}>已建立连接</Tag> : <Tag color={"orange"}>连接未建立</Tag>}
</Space>}
bodyStyle={{padding: 0}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,5 @@ export const WebsocketFlowViewer: React.FC<WebsocketFlowViewerProp> = (props) =>
</AutoCard> : <Empty description={"选择 Websocket Data Frame 以查看详情"}>

</Empty>}
>

</ResizeBox>
/>
};
4 changes: 2 additions & 2 deletions app/renderer/src/main/src/pages/yakitStore/PluginOperator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ export const PluginOperator: React.FC<YakScriptOperatorProp> = (props) => {
firstMinSize={"300px"}
firstRatio={"320px"}
secondNode={executor()}
></ResizeBox>
/>
)}
{/* {script && (
<PluginExecutor
Expand Down Expand Up @@ -427,7 +427,7 @@ export const PluginOperator: React.FC<YakScriptOperatorProp> = (props) => {
firstMinSize={"300px"}
firstRatio={"320px"}
secondNode={executor()}
></ResizeBox>
/>
)}
</Tabs.TabPane>
<Tabs.TabPane tab={"文档"} key={"docs"} disabled={isDisabledLocal}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export interface CollapseParagraphProps {
rows?: number
isLine?: boolean
valueConfig?: ParagraphProps
children?: React.ReactNode
}

export const CollapseParagraph: React.FC<CollapseParagraphProps> = (props) => {
Expand Down
5 changes: 3 additions & 2 deletions app/renderer/src/main/src/utils/inputUtil.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@ import {useThrottleFn} from "ahooks";
import {saveValue} from "./kv";
import {callCopyToClipboard} from "./basic";

export interface OneLineProp extends JSX.ElementChildrenAttribute {
export interface OneLineProp {
width?: string | number
overflow?: string
maxWidth?: string | any
title?: string
children?: React.ReactNode
}

export const OneLine: React.FC<OneLineProp> = (props) => {
Expand Down Expand Up @@ -595,7 +596,7 @@ const EditableTags: React.FC<EditableTagsProps> = (p) => {
setValue("");
p.onCreated && p.onCreated(value)
};
const inputRef = useRef<Input>(null);
const inputRef = useRef<any>(null);

useEffect(() => {
if (inputVisible) {
Expand Down
Loading

0 comments on commit 286e0c3

Please sign in to comment.