Merge branch 'master' into feature/env-manager
This commit is contained in:
@@ -315,7 +315,10 @@ See the [CHANGELOG](CHANGELOG.md) file for details.
|
|||||||
### Lead Developers
|
### Lead Developers
|
||||||
|
|
||||||
* **[Liyas Thomas](https://github.com/liyasthomas)** - *Author*
|
* **[Liyas Thomas](https://github.com/liyasthomas)** - *Author*
|
||||||
* **[Caneco](https://twitter.com/caneco)** - *Designer*
|
* **[John Harker](https://github.com/NBTX)** - *Lead developer*
|
||||||
|
* **[Andrew Bastin](https://github.com/andrewbastin)** - *Lead developer*
|
||||||
|
* **[James George](https://github.com/jamesgeorge007)** - *Lead maintainer*
|
||||||
|
* **[Caneco](https://twitter.com/caneco)** - *Logo and banner designer*
|
||||||
|
|
||||||
### Testing and Debugging
|
### Testing and Debugging
|
||||||
|
|
||||||
|
|||||||
11
functions/editorutils.js
Normal file
11
functions/editorutils.js
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
const mimeToMode = {
|
||||||
|
"text/plain": "plain_text",
|
||||||
|
"text/html": "html",
|
||||||
|
"application/xml": "xml",
|
||||||
|
"application/hal+json": "json",
|
||||||
|
"application/json": "json"
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getEditorLangForMimeType(mimeType) {
|
||||||
|
return mimeToMode[mimeType] || "plain_text";
|
||||||
|
}
|
||||||
@@ -375,7 +375,7 @@
|
|||||||
<label for="rawBody">{{ $t("raw_request_body") }}</label>
|
<label for="rawBody">{{ $t("raw_request_body") }}</label>
|
||||||
<Editor
|
<Editor
|
||||||
v-model="rawParams"
|
v-model="rawParams"
|
||||||
:lang="'json'"
|
:lang="rawInputEditorLang"
|
||||||
:options="{
|
:options="{
|
||||||
maxLines: '16',
|
maxLines: '16',
|
||||||
minLines: '8',
|
minLines: '8',
|
||||||
@@ -1390,6 +1390,7 @@ import AceEditor from "../components/ace-editor";
|
|||||||
import { tokenRequest, oauthRedirect } from "../assets/js/oauth";
|
import { tokenRequest, oauthRedirect } from "../assets/js/oauth";
|
||||||
import { sendNetworkRequest } from "../functions/network";
|
import { sendNetworkRequest } from "../functions/network";
|
||||||
import { fb } from "../functions/fb";
|
import { fb } from "../functions/fb";
|
||||||
|
import { getEditorLangForMimeType } from "~/functions/editorutils";
|
||||||
|
|
||||||
const statusCategories = [
|
const statusCategories = [
|
||||||
{
|
{
|
||||||
@@ -1814,6 +1815,9 @@ export default {
|
|||||||
this.$store.commit("setState", { value, attribute: "rawInput" });
|
this.$store.commit("setState", { value, attribute: "rawInput" });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
rawInputEditorLang() {
|
||||||
|
return getEditorLangForMimeType(this.contentType);
|
||||||
|
},
|
||||||
requestType: {
|
requestType: {
|
||||||
get() {
|
get() {
|
||||||
return this.$store.state.request.requestType;
|
return this.$store.state.request.requestType;
|
||||||
|
|||||||
Reference in New Issue
Block a user