mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 00:01:36 +00:00
add image to mitmproxy.contentview.image
This commit is contained in:
parent
ad5bebeda0
commit
2807329fb2
@ -39,8 +39,11 @@ function ViewAuto({ message, flow, readonly, onChange }) {
|
|||||||
return <View message={message} flow={flow} readonly={readonly} onChange={onChange}/>
|
return <View message={message} flow={flow} readonly={readonly} onChange={onChange}/>
|
||||||
}
|
}
|
||||||
|
|
||||||
function ViewServer({content, contentView}){
|
|
||||||
|
function ViewServer({content, contentView, message, flow}){
|
||||||
let data = JSON.parse(content)
|
let data = JSON.parse(content)
|
||||||
|
let showImage = isImage.test(MessageUtils.getContentType(message))
|
||||||
|
|
||||||
return <div>
|
return <div>
|
||||||
{contentView != data.description &&
|
{contentView != data.description &&
|
||||||
<div className="alert alert-warning">{data.description}</div>
|
<div className="alert alert-warning">{data.description}</div>
|
||||||
@ -56,6 +59,11 @@ function ViewServer({content, contentView}){
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</pre>
|
</pre>
|
||||||
|
{showImage &&
|
||||||
|
<div className="flowview-image">
|
||||||
|
<img src={MessageUtils.getContentURL(flow, message)} alt="preview" className="img-thumbnail"/>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,10 +35,8 @@ function ViewSelector({ message, contentViews }) {
|
|||||||
return (
|
return (
|
||||||
<div className="view-selector btn-group btn-group-xs">
|
<div className="view-selector btn-group btn-group-xs">
|
||||||
|
|
||||||
<ViewButton name="ViewAuto">auto: {autoViewName}</ViewButton>
|
|
||||||
|
|
||||||
{Object.keys(ContentViews).map(name =>
|
{Object.keys(ContentViews).map(name =>
|
||||||
name !== "ViewAuto" && name !== "ViewServer" &&
|
name === "ViewRaw" &&
|
||||||
<ViewButton key={name} name={name}>{name.toLowerCase().replace('view', '')}</ViewButton>
|
<ViewButton key={name} name={name}>{name.toLowerCase().replace('view', '')}</ViewButton>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ export const SET_CONTENT_VIEW = 'UI_FLOWVIEW_SET_CONTENT_VIEW',
|
|||||||
const defaultState = {
|
const defaultState = {
|
||||||
displayLarge: false,
|
displayLarge: false,
|
||||||
modifiedFlow: false,
|
modifiedFlow: false,
|
||||||
contentView: 'ViewAuto',
|
contentView: 'Auto',
|
||||||
tab: 'request',
|
tab: 'request',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user