mirror of
https://github.com/alibaba/anyproxy.git
synced 2025-07-28 16:37:42 +00:00
move response data from memory to local cache file
This commit is contained in:
@@ -12,11 +12,23 @@ function init(React){
|
||||
id = self.props.data.id;
|
||||
if(!id) return;
|
||||
|
||||
ws.reqBody(id,function(content){
|
||||
if(content.id == self.props.data.id){
|
||||
self.setState({
|
||||
body : content
|
||||
});
|
||||
jQuery.get("/fetchBody?id=" + id ,function(resObj){
|
||||
if(resObj && resObj.id){
|
||||
if(resObj.type && resObj.type == "image" && resObj.ref){
|
||||
self.setState({
|
||||
body : {
|
||||
img : resObj.ref,
|
||||
id : resObj.id
|
||||
}
|
||||
});
|
||||
}else if(resObj.content){
|
||||
self.setState({
|
||||
body : {
|
||||
body : resObj.content,
|
||||
id : resObj.id
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
@@ -55,9 +67,13 @@ function init(React){
|
||||
);
|
||||
|
||||
if(this.props.data.statusCode){
|
||||
|
||||
if(this.state.body.id == this.props.data.id){
|
||||
bodyContent = (React.createElement("pre", {className: "resBodyContent"}, this.state.body.body));
|
||||
if(this.state.body.img){
|
||||
var imgEl = { __html : '<img src="'+ this.state.body.img +'" />'};
|
||||
bodyContent = (React.createElement("div", {dangerouslySetInnerHTML: imgEl}));
|
||||
}else{
|
||||
bodyContent = (React.createElement("pre", {className: "resBodyContent"}, this.state.body.body));
|
||||
}
|
||||
}else{
|
||||
bodyContent = null;
|
||||
this.loadBody();
|
||||
|
@@ -186,6 +186,11 @@ body, html {
|
||||
word-wrap:break-word;
|
||||
}
|
||||
|
||||
.resBody .resBodyContent img{
|
||||
max-width: 500px;
|
||||
max-height: 500px;
|
||||
}
|
||||
|
||||
.subTitle{
|
||||
padding-left: 6px;
|
||||
border-left: 3px solid #1FA2D6;
|
||||
|
30
web/page.js
30
web/page.js
@@ -20342,11 +20342,23 @@
|
||||
id = self.props.data.id;
|
||||
if(!id) return;
|
||||
|
||||
ws.reqBody(id,function(content){
|
||||
if(content.id == self.props.data.id){
|
||||
self.setState({
|
||||
body : content
|
||||
});
|
||||
jQuery.get("/fetchBody?id=" + id ,function(resObj){
|
||||
if(resObj && resObj.id){
|
||||
if(resObj.type && resObj.type == "image" && resObj.ref){
|
||||
self.setState({
|
||||
body : {
|
||||
img : resObj.ref,
|
||||
id : resObj.id
|
||||
}
|
||||
});
|
||||
}else if(resObj.content){
|
||||
self.setState({
|
||||
body : {
|
||||
body : resObj.content,
|
||||
id : resObj.id
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
@@ -20385,9 +20397,13 @@
|
||||
);
|
||||
|
||||
if(this.props.data.statusCode){
|
||||
|
||||
if(this.state.body.id == this.props.data.id){
|
||||
bodyContent = (React.createElement("pre", {className: "resBodyContent"}, this.state.body.body));
|
||||
if(this.state.body.img){
|
||||
var imgEl = { __html : '<img src="'+ this.state.body.img +'" />'};
|
||||
bodyContent = (React.createElement("div", {dangerouslySetInnerHTML: imgEl}));
|
||||
}else{
|
||||
bodyContent = (React.createElement("pre", {className: "resBodyContent"}, this.state.body.body));
|
||||
}
|
||||
}else{
|
||||
bodyContent = null;
|
||||
this.loadBody();
|
||||
|
@@ -12,11 +12,23 @@ function init(React){
|
||||
id = self.props.data.id;
|
||||
if(!id) return;
|
||||
|
||||
ws.reqBody(id,function(content){
|
||||
if(content.id == self.props.data.id){
|
||||
self.setState({
|
||||
body : content
|
||||
});
|
||||
jQuery.get("/fetchBody?id=" + id ,function(resObj){
|
||||
if(resObj && resObj.id){
|
||||
if(resObj.type && resObj.type == "image" && resObj.ref){
|
||||
self.setState({
|
||||
body : {
|
||||
img : resObj.ref,
|
||||
id : resObj.id
|
||||
}
|
||||
});
|
||||
}else if(resObj.content){
|
||||
self.setState({
|
||||
body : {
|
||||
body : resObj.content,
|
||||
id : resObj.id
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
@@ -55,9 +67,13 @@ function init(React){
|
||||
);
|
||||
|
||||
if(this.props.data.statusCode){
|
||||
|
||||
if(this.state.body.id == this.props.data.id){
|
||||
bodyContent = (<pre className="resBodyContent">{this.state.body.body}</pre>);
|
||||
if(this.state.body.img){
|
||||
var imgEl = { __html : '<img src="'+ this.state.body.img +'" />'};
|
||||
bodyContent = (<div dangerouslySetInnerHTML={imgEl}></div>);
|
||||
}else{
|
||||
bodyContent = (<pre className="resBodyContent">{this.state.body.body}</pre>);
|
||||
}
|
||||
}else{
|
||||
bodyContent = null;
|
||||
this.loadBody();
|
||||
|
Reference in New Issue
Block a user