Hide download response button for non-JSON responses
This commit is contained in:
@@ -973,7 +973,7 @@
|
|||||||
class="icon"
|
class="icon"
|
||||||
@click="downloadResponse"
|
@click="downloadResponse"
|
||||||
ref="downloadResponse"
|
ref="downloadResponse"
|
||||||
v-if="response.body"
|
v-if="response.body && canDownloadResponse"
|
||||||
v-tooltip="$t('download_file')"
|
v-tooltip="$t('download_file')"
|
||||||
>
|
>
|
||||||
<i class="material-icons">get_app</i>
|
<i class="material-icons">get_app</i>
|
||||||
@@ -1612,6 +1612,14 @@ export default {
|
|||||||
isJSONContentType(this.contentType)
|
isJSONContentType(this.contentType)
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
canDownloadResponse() {
|
||||||
|
return (
|
||||||
|
this.response &&
|
||||||
|
this.response.headers &&
|
||||||
|
this.response.headers["content-type"] &&
|
||||||
|
isJSONContentType(this.response.headers["content-type"])
|
||||||
|
)
|
||||||
|
},
|
||||||
uri: {
|
uri: {
|
||||||
get() {
|
get() {
|
||||||
return this.$store.state.request.uri ? this.$store.state.request.uri : this.url + this.path
|
return this.$store.state.request.uri ? this.$store.state.request.uri : this.url + this.path
|
||||||
|
|||||||
Reference in New Issue
Block a user