Merge pull request #1343 from hariaakash/main
Request method labels & custom method width fix
This commit is contained in:
@@ -13,7 +13,7 @@
|
|||||||
@click="!doc ? selectRequest() : {}"
|
@click="!doc ? selectRequest() : {}"
|
||||||
v-tooltip="!doc ? $t('use_request') : ''"
|
v-tooltip="!doc ? $t('use_request') : ''"
|
||||||
>
|
>
|
||||||
<i class="material-icons">insert_drive_file</i>
|
<span :class="getRequestLabelColor(request.method)">{{ request.method }}</span>
|
||||||
<span>{{ request.name }}</span>
|
<span>{{ request.name }}</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -68,6 +68,13 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
dragging: false,
|
dragging: false,
|
||||||
|
requestMethodLabels: {
|
||||||
|
get: "text-green-400",
|
||||||
|
post: "text-yellow-400",
|
||||||
|
put: "text-blue-400",
|
||||||
|
delete: "text-red-400",
|
||||||
|
default: "text-gray-400",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -100,6 +107,9 @@ export default {
|
|||||||
})
|
})
|
||||||
this.syncCollections()
|
this.syncCollections()
|
||||||
},
|
},
|
||||||
|
getRequestLabelColor(method) {
|
||||||
|
return this.requestMethodLabels[method.toLowerCase()] || this.requestMethodLabels.default
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -9,14 +9,12 @@
|
|||||||
<span class="select-wrapper">
|
<span class="select-wrapper">
|
||||||
<v-popover>
|
<v-popover>
|
||||||
<input
|
<input
|
||||||
v-if="!customMethod"
|
|
||||||
id="method"
|
id="method"
|
||||||
class="method"
|
class="method"
|
||||||
v-model="method"
|
v-model="method"
|
||||||
readonly
|
:readonly="!customMethod"
|
||||||
autofocus
|
autofocus
|
||||||
/>
|
/>
|
||||||
<input v-else v-model="method" placeholder="CUSTOM" />
|
|
||||||
<template slot="popover">
|
<template slot="popover">
|
||||||
<div>
|
<div>
|
||||||
<button
|
<button
|
||||||
|
|||||||
Reference in New Issue
Block a user