From b71c08e8c79f223b98644e3d3d2c67abe10b1580 Mon Sep 17 00:00:00 2001 From: lqqyt2423 <974923609@qq.com> Date: Sat, 10 Dec 2022 21:33:07 +0800 Subject: [PATCH] web addon interface optimization --- web/client/src/App.css | 9 +++- web/client/src/components/ViewFlow.tsx | 72 ++++++++++++++++---------- 2 files changed, 52 insertions(+), 29 deletions(-) diff --git a/web/client/src/App.css b/web/client/src/App.css index 4fe45c1..42cc3c8 100644 --- a/web/client/src/App.css +++ b/web/client/src/App.css @@ -73,10 +73,15 @@ .flow-detail .header-tabs { display: flex; + flex-direction: column; position: sticky; top: 0; background-color: white; - padding: 5px 0; + padding: 25px 0 5px 25px; +} + +.flow-detail .header-tabs > div { + margin-top: 10px; } .flow-detail .header-tabs span { @@ -91,7 +96,7 @@ } .flow-detail .header-tabs .flow-wait-area button { - margin-left: 10px; + margin-right: 10px; } .flow-detail .header-block { diff --git a/web/client/src/components/ViewFlow.tsx b/web/client/src/components/ViewFlow.tsx index 59035de..b18c6ce 100644 --- a/web/client/src/components/ViewFlow.tsx +++ b/web/client/src/components/ViewFlow.tsx @@ -113,6 +113,33 @@ class ViewFlow extends React.Component { ) } + copyAsCurl() { + const { flow } = this.props + if (!flow) return null + + return ( + + ) + } + render() { if (!this.props.flow) return null @@ -133,12 +160,14 @@ class ViewFlow extends React.Component { return (
- { this.props.onClose() }}>x - { this.setState({ flowTab: 'Detail' }) }}>Detail - { this.setState({ flowTab: 'Headers' }) }}>Headers - { this.setState({ flowTab: 'Preview' }) }}>Preview - { this.setState({ flowTab: 'Response' }) }}>Response - { this.setState({ flowTab: 'Hexview' }) }}>Hexview + { this.props.onClose() }}>x { }} /> +
{this.copyAsCurl()}
+ +
+ { this.setState({ flowTab: 'Detail' }) }}>Detail + { this.setState({ flowTab: 'Headers' }) }}>Headers + { this.setState({ flowTab: 'Preview' }) }}>Preview + { this.setState({ flowTab: 'Response' }) }}>Response + { this.setState({ flowTab: 'Hexview' }) }}>Hexview +
-
+
{ !(flowTab === 'Headers') ? null :
-

-

General