Merge branch 'master' into feat/extension-toggle

This commit is contained in:
Andrew Bastin
2020-02-04 13:17:46 -05:00
committed by GitHub
3 changed files with 157 additions and 22 deletions

View File

@@ -538,6 +538,7 @@ input[type="radio"],
display: none;
}
.method,
kbd,
select,
input,
@@ -557,6 +558,7 @@ code {
transition: all 0.2s ease-in-out;
user-select: text;
width: calc(100% - 8px);
min-width: 128px;
resize: vertical;
text-overflow: ellipsis;
@@ -587,6 +589,14 @@ pre {
.select-wrapper {
position: relative;
input {
text-transform: uppercase;
}
.trigger {
width: 100%;
}
&:after {
display: inline-block;
position: absolute;

View File

@@ -566,19 +566,19 @@
<div slot="body">
<div>
<label>{{ $t("send_request") }}</label>
<kbd> G</kbd>
<kbd>{{ getSpecialKey() }} G</kbd>
</div>
<div>
<label>{{ $t("save_to_collections") }}</label>
<kbd> S</kbd>
<kbd>{{ getSpecialKey() }} S</kbd>
</div>
<div>
<label>{{ $t("copy_request_link") }}</label>
<kbd> K</kbd>
<kbd>{{ getSpecialKey() }} K</kbd>
</div>
<div>
<label>{{ $t("reset_request") }}</label>
<kbd> L</kbd>
<kbd>{{ getSpecialKey() }} L</kbd>
</div>
</div>
<div slot="footer"></div>
@@ -677,6 +677,9 @@ export default {
},
methods: {
getSpecialKey() {
return (/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)) ? "⌘" : "Ctrl";
},
linkActive(path) {
return {
"nuxt-link-exact-active": this.$route.path === path,

View File

@@ -45,17 +45,138 @@
<li>
<label for="method">{{ $t("method") }}</label>
<span class="select-wrapper">
<select id="method" v-model="method" @change="methodChange">
<option value="GET">GET</option>
<option value="HEAD">HEAD</option>
<option value="POST">POST</option>
<option value="PUT">PUT</option>
<option value="DELETE">DELETE</option>
<option value="CONNECT">CONNECT</option>
<option value="OPTIONS">OPTIONS</option>
<option value="TRACE">TRACE</option>
<option value="PATCH">PATCH</option>
</select>
<v-popover>
<input
id="method"
class="method"
v-if="!customMethod"
v-model="method"
readonly
/>
<input v-else v-model="method" placeholder="CUSTOM" />
<template slot="popover">
<div>
<button
class="icon"
@click="
customMethod = false;
method = 'GET';
"
v-close-popover
>
GET
</button>
</div>
<div>
<button
class="icon"
@click="
customMethod = false;
method = 'HEAD';
"
v-close-popover
>
HEAD
</button>
</div>
<div>
<button
class="icon"
@click="
customMethod = false;
method = 'POST';
"
v-close-popover
>
POST
</button>
</div>
<div>
<button
class="icon"
@click="
customMethod = false;
method = 'PUT';
"
v-close-popover
>
PUT
</button>
</div>
<div>
<button
class="icon"
@click="
customMethod = false;
method = 'DELETE';
"
v-close-popover
>
DELETE
</button>
</div>
<div>
<button
class="icon"
@click="
customMethod = false;
method = 'CONNECT';
"
v-close-popover
>
CONNECT
</button>
</div>
<div>
<button
class="icon"
@click="
customMethod = false;
method = 'OPTIONS';
"
v-close-popover
>
OPTIONS
</button>
</div>
<div>
<button
class="icon"
@click="
customMethod = false;
method = 'TRACE';
"
v-close-popover
>
TRACE
</button>
</div>
<div>
<button
class="icon"
@click="
customMethod = false;
method = 'PATCH';
"
v-close-popover
>
PATCH
</button>
</div>
<div>
<button
class="icon"
@click="
customMethod = true;
method = 'CUSTOM';
"
v-close-popover
>
CUSTOM
</button>
</div>
</template>
</v-popover>
</span>
</li>
<li>
@@ -1484,7 +1605,8 @@ export default {
responseBodyType: "text",
responseBodyMaxLines: 16,
activeSidebar: true,
fb
fb,
customMethod: false
};
},
watch: {
@@ -1574,6 +1696,12 @@ export default {
editingRequest(newValue) {
this.editRequest = newValue;
this.showRequestModal = true;
},
method() {
// this.$store.commit('setState', { 'value': ["POST", "PUT", "PATCH"].includes(this.method) ? 'application/json' : '', 'attribute': 'contentType' })
this.contentType = ["POST", "PUT", "PATCH"].includes(this.method)
? "application/json"
: "";
}
},
computed: {
@@ -2669,12 +2797,6 @@ export default {
}
this.setRouteQueryState();
},
methodChange() {
// this.$store.commit('setState', { 'value': ["POST", "PUT", "PATCH"].includes(this.method) ? 'application/json' : '', 'attribute': 'contentType' })
this.contentType = ["POST", "PUT", "PATCH"].includes(this.method)
? "application/json"
: "";
},
uploadPayload() {
this.rawInput = true;
const file = this.$refs.payload.files[0];