Added elapsed request time toast

This commit is contained in:
liyasthomas
2019-10-12 22:18:42 +05:30
parent ac29f7eeb0
commit 39cbe8a858
2 changed files with 8 additions and 0 deletions

View File

@@ -202,6 +202,7 @@ pre {
width: calc(100% - 8px);
min-height: 40px;
resize: vertical;
text-overflow: ellipsis;
&:not([readonly]):hover {
background-color: var(--bg-dark-color);

View File

@@ -767,6 +767,7 @@
headers = headersObject;
try {
const startTime = new Date().getTime();
const payload = await this.$axios({
method: this.method,
url: this.url + this.pathName + this.queryString,
@@ -775,6 +776,12 @@
data: requestBody ? requestBody.toString() : null
});
const endTime = new Date().getTime();
const duration = endTime - startTime;
this.$toast.info(`Finished in ${duration}ms`, {
icon: 'done'
});
(() => {
const status = this.response.status = payload.status;
const headers = this.response.headers = payload.headers;