⚡ Minor tweaks
This commit is contained in:
@@ -37,7 +37,6 @@
|
|||||||
<label>Collection is empty</label>
|
<label>Collection is empty</label>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li v-for="(request, index) in collection.requests" :key="index">
|
<li v-for="(request, index) in collection.requests" :key="index">
|
||||||
<request
|
<request
|
||||||
|
|||||||
@@ -17,16 +17,20 @@
|
|||||||
<div slot="body">
|
<div slot="body">
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<input type="text" v-model="requestUpdateData.name" v-bind:placeholder="request.name" />
|
<label for="selectLabel">Label</label>
|
||||||
<select type="text" v-model="requestUpdateData.collectionIndex">
|
<input type="text" id="selectLabel" v-model="requestUpdateData.name" :placeholder="request.name" />
|
||||||
|
<label for="selectCollection">Collection</label>
|
||||||
|
<select type="text" id="selectCollection" v-model="requestUpdateData.collectionIndex">
|
||||||
|
<option :key="undefined" :value="undefined" hidden disabled selected>Current Collection</option>
|
||||||
<option
|
<option
|
||||||
v-for="(collection, index) in $store.state.postwoman.collections"
|
v-for="(collection, index) in $store.state.postwoman.collections"
|
||||||
:key="index"
|
:key="index"
|
||||||
:value="index"
|
:value="index"
|
||||||
>{{ collection.name }}</option>
|
>{{ collection.name }}</option>
|
||||||
</select>
|
</select>
|
||||||
<select type="text" v-model="requestUpdateData.folderIndex">
|
<label for="selectFolder">Folder</label>
|
||||||
<option :key="undefined" :value="undefined"></option>
|
<select type="text" id="selectFolder" v-model="requestUpdateData.folderIndex">
|
||||||
|
<option :key="undefined" :value="undefined">/</option>
|
||||||
<option v-for="(folder, index) in folders" :key="index" :value="index">{{ folder.name }}</option>
|
<option v-for="(folder, index) in folders" :key="index" :value="index">{{ folder.name }}</option>
|
||||||
</select>
|
</select>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
/>
|
/>
|
||||||
<label for="selectCollection">Collection</label>
|
<label for="selectCollection">Collection</label>
|
||||||
<select type="text" id="selectCollection" v-model="requestData.collectionIndex">
|
<select type="text" id="selectCollection" v-model="requestData.collectionIndex">
|
||||||
|
<option :key="undefined" :value="undefined" hidden disabled selected>Select a Collection</option>
|
||||||
<option
|
<option
|
||||||
v-for="(collection, index) in $store.state.postwoman.collections"
|
v-for="(collection, index) in $store.state.postwoman.collections"
|
||||||
:key="index"
|
:key="index"
|
||||||
|
|||||||
@@ -258,7 +258,7 @@
|
|||||||
>
|
>
|
||||||
<i class="material-icons">save</i>
|
<i class="material-icons">save</i>
|
||||||
</button>
|
</button>
|
||||||
<button class="icon" @click="clearContent" v-tooltip.bottom="'Clear All'">
|
<button class="icon" @click="clearContent('', $event)" v-tooltip.bottom="'Clear All'">
|
||||||
<i class="material-icons">clear_all</i>
|
<i class="material-icons">clear_all</i>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -317,9 +317,8 @@
|
|||||||
<div class="flex-wrap">
|
<div class="flex-wrap">
|
||||||
<label for="auth">Authentication Type</label>
|
<label for="auth">Authentication Type</label>
|
||||||
<div>
|
<div>
|
||||||
<button class="icon" @click="clearContent('auth')">
|
<button class="icon" @click="clearContent('auth', $event)" v-tooltip.bottom="'Clear'">
|
||||||
<i class="material-icons">clear_all</i>
|
<i class="material-icons">clear_all</i>
|
||||||
<span>Clear</span>
|
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -377,9 +376,8 @@
|
|||||||
<div class="flex-wrap">
|
<div class="flex-wrap">
|
||||||
<label for="headerList">Header List</label>
|
<label for="headerList">Header List</label>
|
||||||
<div>
|
<div>
|
||||||
<button class="icon" @click="clearContent('headers')">
|
<button class="icon" @click="clearContent('headers', $event)" v-tooltip.bottom="'Clear'">
|
||||||
<i class="material-icons">clear_all</i>
|
<i class="material-icons">clear_all</i>
|
||||||
<span>Clear</span>
|
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -442,9 +440,8 @@
|
|||||||
<div class="flex-wrap">
|
<div class="flex-wrap">
|
||||||
<label for="paramList">Parameter List</label>
|
<label for="paramList">Parameter List</label>
|
||||||
<div>
|
<div>
|
||||||
<button class="icon" @click="clearContent('parameters')">
|
<button class="icon" @click="clearContent('parameters', $event)" v-tooltip.bottom="'Clear'">
|
||||||
<i class="material-icons">clear_all</i>
|
<i class="material-icons">clear_all</i>
|
||||||
<span>Clear</span>
|
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -766,6 +763,7 @@ export default {
|
|||||||
this.url = newValue.url;
|
this.url = newValue.url;
|
||||||
this.path = newValue.path;
|
this.path = newValue.path;
|
||||||
this.method = newValue.method;
|
this.method = newValue.method;
|
||||||
|
this.label = newValue.label;
|
||||||
this.auth = newValue.auth;
|
this.auth = newValue.auth;
|
||||||
this.httpUser = newValue.httpUser;
|
this.httpUser = newValue.httpUser;
|
||||||
this.httpPassword = newValue.httpPassword;
|
this.httpPassword = newValue.httpPassword;
|
||||||
@@ -1143,14 +1141,17 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
scrollInto(view) {
|
||||||
|
this.$refs[view].$el.scrollIntoView({
|
||||||
|
behavior: "smooth"
|
||||||
|
});
|
||||||
|
},
|
||||||
handleUseHistory({ label, method, url, path }) {
|
handleUseHistory({ label, method, url, path }) {
|
||||||
this.label = label;
|
this.label = label;
|
||||||
this.method = method;
|
this.method = method;
|
||||||
this.url = url;
|
this.url = url;
|
||||||
this.path = path;
|
this.path = path;
|
||||||
this.$refs.request.$el.scrollIntoView({
|
this.scrollInto('request');
|
||||||
behavior: "smooth"
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
getVariablesFromPreRequestScript() {
|
getVariablesFromPreRequestScript() {
|
||||||
if (!this.preRequestScript) {
|
if (!this.preRequestScript) {
|
||||||
@@ -1206,6 +1207,7 @@ export default {
|
|||||||
},
|
},
|
||||||
async sendRequest() {
|
async sendRequest() {
|
||||||
this.$toast.clear();
|
this.$toast.clear();
|
||||||
|
this.scrollInto('response');
|
||||||
|
|
||||||
if (!this.isValidURL) {
|
if (!this.isValidURL) {
|
||||||
this.$toast.error("URL is not formatted properly", {
|
this.$toast.error("URL is not formatted properly", {
|
||||||
@@ -1221,9 +1223,6 @@ export default {
|
|||||||
if (this.$refs.response.$el.classList.contains("hidden")) {
|
if (this.$refs.response.$el.classList.contains("hidden")) {
|
||||||
this.$refs.response.$el.classList.toggle("hidden");
|
this.$refs.response.$el.classList.toggle("hidden");
|
||||||
}
|
}
|
||||||
this.$refs.response.$el.scrollIntoView({
|
|
||||||
behavior: "smooth"
|
|
||||||
});
|
|
||||||
this.previewEnabled = false;
|
this.previewEnabled = false;
|
||||||
this.response.status = "Fetching...";
|
this.response.status = "Fetching...";
|
||||||
this.response.body = "Loading...";
|
this.response.body = "Loading...";
|
||||||
@@ -1641,7 +1640,7 @@ export default {
|
|||||||
this.passwordFieldType =
|
this.passwordFieldType =
|
||||||
this.passwordFieldType === "password" ? "text" : "password";
|
this.passwordFieldType === "password" ? "text" : "password";
|
||||||
},
|
},
|
||||||
clearContent(name) {
|
clearContent(name, e) {
|
||||||
switch (name) {
|
switch (name) {
|
||||||
case "auth":
|
case "auth":
|
||||||
this.auth = "None";
|
this.auth = "None";
|
||||||
@@ -1670,9 +1669,16 @@ export default {
|
|||||||
this.bodyParams = [];
|
this.bodyParams = [];
|
||||||
this.rawParams = "";
|
this.rawParams = "";
|
||||||
}
|
}
|
||||||
|
e.target.innerHTML = this.copiedButton;
|
||||||
this.$toast.info("Cleared", {
|
this.$toast.info("Cleared", {
|
||||||
icon: "clear_all"
|
icon: "clear_all"
|
||||||
});
|
});
|
||||||
|
setTimeout(
|
||||||
|
() =>
|
||||||
|
(e.target.innerHTML =
|
||||||
|
'<i class="material-icons">clear_all</i>'),
|
||||||
|
1000
|
||||||
|
);
|
||||||
},
|
},
|
||||||
saveRequest() {
|
saveRequest() {
|
||||||
this.editRequest = {
|
this.editRequest = {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
export default {
|
export default () => ({
|
||||||
request: {
|
request: {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
url: 'https://reqres.in',
|
url: 'https://reqres.in',
|
||||||
@@ -7,13 +7,14 @@ export default {
|
|||||||
auth: 'None',
|
auth: 'None',
|
||||||
httpUser: '',
|
httpUser: '',
|
||||||
httpPassword: '',
|
httpPassword: '',
|
||||||
|
passwordFieldType: 'password',
|
||||||
bearerToken: '',
|
bearerToken: '',
|
||||||
headers: [],
|
headers: [],
|
||||||
params: [],
|
params: [],
|
||||||
bodyParams: [],
|
bodyParams: [],
|
||||||
rawParams: '',
|
rawParams: '',
|
||||||
rawInput: false,
|
rawInput: false,
|
||||||
requestType: '',
|
requestType: 'JavaScript XHR',
|
||||||
contentType: '',
|
contentType: '',
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user