From a13ab2b3125a229d4af654d2d63ce7e8083861eb Mon Sep 17 00:00:00 2001 From: nongiht <378099757@qq.com> Date: Tue, 11 Jan 2022 16:25:00 +0800 Subject: [PATCH] =?UTF-8?q?fix:=201=E3=80=81=E4=BF=AE=E5=A4=8Dhex=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E5=99=A8=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98=202?= =?UTF-8?q?=E3=80=81=E4=BF=AE=E5=A4=8Dyak=E7=BC=96=E8=BE=91=E5=99=A8?= =?UTF-8?q?=E6=BB=9A=E5=8A=A8=E6=9D=A1=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/main/handlers/pluginTool.js | 5 +++++ app/renderer/src/main/prettier.config.js | 2 +- .../src/main/src/pages/fuzzer/HTTPFuzzerPage.tsx | 10 ++++++++++ app/renderer/src/main/src/routes/routeSpec.tsx | 1 + app/renderer/src/main/src/utils/editors.css | 11 +++++++++++ app/renderer/src/main/src/utils/editors.tsx | 5 +++++ 6 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 app/renderer/src/main/src/utils/editors.css diff --git a/app/main/handlers/pluginTool.js b/app/main/handlers/pluginTool.js index 7f754d79c9..80b7672c2f 100644 --- a/app/main/handlers/pluginTool.js +++ b/app/main/handlers/pluginTool.js @@ -93,4 +93,9 @@ module.exports = (win, getClient) => { ipcMain.handle("clear-compute-percent", () => { if (time) clearInterval(time); }); + + // 获取操作系统类型 + ipcMain.handle("fetch-system-name", () => { + return OS.type(); + }); }; diff --git a/app/renderer/src/main/prettier.config.js b/app/renderer/src/main/prettier.config.js index 133e455360..73faa5b666 100644 --- a/app/renderer/src/main/prettier.config.js +++ b/app/renderer/src/main/prettier.config.js @@ -17,7 +17,7 @@ module.exports = { // 末尾不需要逗号 trailingComma: 'none', // 大括号内的首尾需要空格 - bracketSpacing: true, + bracketSpacing: false, // jsx 标签的反尖括号需要换行 jsxBracketSameLine: false, // 箭头函数,只有一个参数的时候,也需要括号 diff --git a/app/renderer/src/main/src/pages/fuzzer/HTTPFuzzerPage.tsx b/app/renderer/src/main/src/pages/fuzzer/HTTPFuzzerPage.tsx index 29a8fc5b5b..0a92cad983 100644 --- a/app/renderer/src/main/src/pages/fuzzer/HTTPFuzzerPage.tsx +++ b/app/renderer/src/main/src/pages/fuzzer/HTTPFuzzerPage.tsx @@ -116,6 +116,9 @@ export const HTTPFuzzerPage: React.FC = (props) => { setRefreshTrigger(!refreshTrigger); } + // 系统类型 + const [system,setSystem]=useState("") + // history const [history, setHistory] = useState([]); const [currentHistoryIndex, setCurrentHistoryIndex] = useState(); @@ -135,6 +138,11 @@ export const HTTPFuzzerPage: React.FC = (props) => { } }; + //获取系统类型 + useEffect(()=>{ + ipcRenderer.invoke('fetch-system-name').then((res)=>{setSystem(res)}) + },[]) + useEffect(() => { if (currentHistoryIndex === undefined) { return @@ -268,6 +276,7 @@ export const HTTPFuzzerPage: React.FC = (props) => { const responseViewer = (rsp: FuzzerResponse) => { return = (props) => { .nybbleHighValue { + word-spacing: -0.5em; +} + +.hex-editor-style.cCsCJP .byteValue > .nybbleLowValue { + word-spacing: -0.5em; +} + +.hex-editor-style.cCsCJP .asciiValue { + word-spacing: -0.5em; +} diff --git a/app/renderer/src/main/src/utils/editors.tsx b/app/renderer/src/main/src/utils/editors.tsx index 67a0106b1c..833fe270f0 100644 --- a/app/renderer/src/main/src/utils/editors.tsx +++ b/app/renderer/src/main/src/utils/editors.tsx @@ -20,6 +20,8 @@ import { import {HTTPPacketFuzzable} from "../components/HTTPHistory"; import ReactResizeDetector from "react-resize-detector"; +import './editors.css' + export type IMonacoActionDescriptor = monaco.editor.IActionDescriptor; export type IMonacoEditor = monacoEditor.editor.IStandaloneCodeEditor; @@ -221,6 +223,8 @@ export interface HTTPPacketEditorProp extends HTTPPacketFuzzable { // lang language?: "html" | "http" | "yak" | any + + system?:string } export const YakCodeEditor: React.FC = (props) => { @@ -426,6 +430,7 @@ export const HTTPPacketEditor: React.FC = (props) => { {...props.extraEditorProps} />} {mode === "hex" && !empty &&