mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-22 15:37:45 +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}/>
|
||||
}
|
||||
|
||||
function ViewServer({content, contentView}){
|
||||
|
||||
function ViewServer({content, contentView, message, flow}){
|
||||
let data = JSON.parse(content)
|
||||
let showImage = isImage.test(MessageUtils.getContentType(message))
|
||||
|
||||
return <div>
|
||||
{contentView != data.description &&
|
||||
<div className="alert alert-warning">{data.description}</div>
|
||||
@ -56,6 +59,11 @@ function ViewServer({content, contentView}){
|
||||
</div>
|
||||
)}
|
||||
</pre>
|
||||
{showImage &&
|
||||
<div className="flowview-image">
|
||||
<img src={MessageUtils.getContentURL(flow, message)} alt="preview" className="img-thumbnail"/>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
|
@ -35,10 +35,8 @@ function ViewSelector({ message, contentViews }) {
|
||||
return (
|
||||
<div className="view-selector btn-group btn-group-xs">
|
||||
|
||||
<ViewButton name="ViewAuto">auto: {autoViewName}</ViewButton>
|
||||
|
||||
{Object.keys(ContentViews).map(name =>
|
||||
name !== "ViewAuto" && name !== "ViewServer" &&
|
||||
name === "ViewRaw" &&
|
||||
<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 = {
|
||||
displayLarge: false,
|
||||
modifiedFlow: false,
|
||||
contentView: 'ViewAuto',
|
||||
contentView: 'Auto',
|
||||
tab: 'request',
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user