added request method label in collections
This commit is contained in:
parent
77862cdf9b
commit
d9bab319e3
1 changed files with 11 additions and 1 deletions
|
|
@ -13,7 +13,7 @@
|
|||
@click="!doc ? selectRequest() : {}"
|
||||
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>
|
||||
</button>
|
||||
</div>
|
||||
|
|
@ -68,6 +68,13 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
dragging: false,
|
||||
requestMethodLabels: {
|
||||
get: "text-green-400",
|
||||
post: "text-yellow-400",
|
||||
put: "text-blue-400",
|
||||
delete: "text-red-400",
|
||||
default: "text-gray-400",
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
@ -100,6 +107,9 @@ export default {
|
|||
})
|
||||
this.syncCollections()
|
||||
},
|
||||
getRequestLabelColor(method) {
|
||||
return this.requestMethodLabels[method.toLowerCase()] || this.requestMethodLabels.default
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Reference in a new issue