Make lang prop dynamic.
This commit is contained in:
@@ -42,7 +42,6 @@ export default {
|
|||||||
this.editor.session.setValue(value,1);
|
this.editor.session.setValue(value,1);
|
||||||
this.cacheValue = value;
|
this.cacheValue = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
theme() {
|
theme() {
|
||||||
this.editor.setTheme('ace/theme/' + this.defineTheme())
|
this.editor.setTheme('ace/theme/' + this.defineTheme())
|
||||||
|
|||||||
@@ -570,7 +570,7 @@
|
|||||||
<div id="response-details-wrapper">
|
<div id="response-details-wrapper">
|
||||||
<ResponseBody
|
<ResponseBody
|
||||||
:value="responseBodyText"
|
:value="responseBodyText"
|
||||||
lang="json"
|
:lang="responseBodyType"
|
||||||
:options="{
|
:options="{
|
||||||
maxLines: '16',
|
maxLines: '16',
|
||||||
minLines: '16',
|
minLines: '16',
|
||||||
@@ -733,6 +733,7 @@ export default {
|
|||||||
|
|
||||||
urlExcludes: {},
|
urlExcludes: {},
|
||||||
responseBodyText: '',
|
responseBodyText: '',
|
||||||
|
responseBodyType: 'text'
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@@ -753,18 +754,26 @@ export default {
|
|||||||
else this.setRouteQueryState();
|
else this.setRouteQueryState();
|
||||||
},
|
},
|
||||||
"response.body": function(val) {
|
"response.body": function(val) {
|
||||||
if (
|
if (
|
||||||
this.response.body !== "(waiting to send request)" &&
|
this.response.body === "(waiting to send request)" ||
|
||||||
this.response.body !== "Loading..."
|
this.response.body === "Loading..."
|
||||||
|
) {
|
||||||
|
this.responseBodyText = this.response.body;
|
||||||
|
this.responseBodyType = 'text';
|
||||||
|
} else {
|
||||||
|
if(this.responseType === "application/json" ||
|
||||||
|
this.responseType === "application/hal+json"
|
||||||
) {
|
) {
|
||||||
this.responseBodyText =
|
this.responseBodyText = JSON.stringify(this.response.body, null, 2)
|
||||||
this.responseType === "application/json" ||
|
this.responseBodyType = 'json'
|
||||||
this.responseType === "application/hal+json"
|
} else if (this.responseType === "text/html") {
|
||||||
? JSON.stringify(this.response.body, null, 2)
|
this.responseBodyText = this.response.body;
|
||||||
: this.response.body;
|
this.responseBodyType = 'html'
|
||||||
} else {
|
} else {
|
||||||
this.responseBodyText = this.response.body;
|
this.responseBodyText = this.response.body;
|
||||||
|
this.responseBodyType = 'text';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
params: {
|
params: {
|
||||||
handler: function(newValue) {
|
handler: function(newValue) {
|
||||||
|
|||||||
Reference in New Issue
Block a user