From 39cbe8a858ad706993e0c25024d77e89d567c00d Mon Sep 17 00:00:00 2001 From: liyasthomas Date: Sat, 12 Oct 2019 22:18:42 +0530 Subject: [PATCH] :sparkles: Added elapsed request time toast --- assets/css/styles.scss | 1 + pages/index.vue | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/assets/css/styles.scss b/assets/css/styles.scss index aa0e76219..c3f12d3b8 100644 --- a/assets/css/styles.scss +++ b/assets/css/styles.scss @@ -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); diff --git a/pages/index.vue b/pages/index.vue index 94c6b69d9..c62788f84 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -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;