Skip to content

Commit

Permalink
feat: 请求目标输入框以及位置调整&本次执行 HTTP 流量tab放第一个位置
Browse files Browse the repository at this point in the history
  • Loading branch information
song-xiao-lin committed Oct 18, 2023
1 parent d18e0fe commit 7588459
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,11 @@ export const HTTPRequestBuilder: React.FC<HTTPRequestBuilderProp> = (props) => {
style={{height: "100%"}}
onValuesChange={onValuesChange}
>
{reqType === "template" && (
<Form.Item label='扫描目标' name='Input' style={{marginBottom: 4}}>
<YakitInput.TextArea placeholder='请输入扫描目标' size='small' />
</Form.Item>
)}
<Form.Item label='HTTPS' name='IsHttps' valuePropName='checked' style={{marginBottom: 4}}>
<YakitSwitch />
</Form.Item>
Expand Down Expand Up @@ -224,9 +229,6 @@ export const HTTPRequestBuilder: React.FC<HTTPRequestBuilderProp> = (props) => {
placeholder='请输入...'
/>
</Form.Item>
<Form.Item label='请求目标' name='Input'>
<YakitInput placeholder='请输入...' size='small' />
</Form.Item>
<Divider style={{margin: 0}} />
<YakitCollapse
destroyInactivePanel={false}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export const PluginDebuggerExec: React.FC<PluginDebuggerExecProp> = (props) => {
statusCards={infoState.statusState}
runtimeId={runtimeId}
fromPlugin={props.pluginName}
defaultActive="current-http-flow"
/>
)
};
22 changes: 14 additions & 8 deletions app/renderer/src/main/src/pages/yakitStore/viewers/base.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export interface PluginResultUIProp {
cardStyleType?: number
runtimeId?: string
fromPlugin?: string
defaultActive?: string
}

export interface TooltipTitleProps {
Expand Down Expand Up @@ -179,7 +180,12 @@ const renderCard = (infoList, type) => {

export const PluginResultUI: React.FC<PluginResultUIProp> = React.memo((props) => {
const {loading, results, featureType = [], feature = [], progress, script, statusCards, cardStyleType} = props
const [active, setActive] = useState(props.defaultConsole ? "console" : "feature-0")
const [active, setActive] = useState(() => {
if (props.defaultActive) {
return props.defaultActive
}
return props.defaultConsole ? "console" : "feature-0"
})
const xtermRef = useRef(null)
const timer = useRef<any>(null)
const [pageCode, setPageCode] = useState<number>(1)
Expand Down Expand Up @@ -323,6 +329,13 @@ export const PluginResultUI: React.FC<PluginResultUIProp> = React.memo((props) =
</YakitTabs.YakitTabPane>
)
})}
{!!props.runtimeId && (
<YakitTabs.YakitTabPane tab={"本次执行 HTTP 流量"} key={"current-http-flow"}>
<div style={{width: "100%", height: "100%", paddingTop: 12, paddingBottom: 40}}>
<CurrentHttpFlow runtimeId={props.runtimeId}></CurrentHttpFlow>
</div>
</YakitTabs.YakitTabPane>
)}
<YakitTabs.YakitTabPane
tab={"基础插件信息 / 日志"}
key={finalFeatures.length > 0 ? "log" : "feature-0"}
Expand Down Expand Up @@ -398,13 +411,6 @@ export const PluginResultUI: React.FC<PluginResultUIProp> = React.memo((props) =
<EngineConsole isMini={true} />
</div>
</YakitTabs.YakitTabPane>
{!!props.runtimeId && (
<YakitTabs.YakitTabPane tab={"本次执行 HTTP 流量"} key={"current-http-flow"}>
<div style={{width: "100%", height: "100%", paddingTop: 12, paddingBottom: 40}}>
<CurrentHttpFlow runtimeId={props.runtimeId}></CurrentHttpFlow>
</div>
</YakitTabs.YakitTabPane>
)}
{/*{props.fromPlugin && <YakitTabs.YakitTabPane tab={"插件所有流量"} key={"current-plugin-flow"}>*/}
{/* <div style={{width: "100%", height: "100%"}}>*/}
{/* <HTTPFlowTable*/}
Expand Down

0 comments on commit 7588459

Please sign in to comment.