From f80a0cbd07ebbe8a3627b32049069d380b21d846 Mon Sep 17 00:00:00 2001 From: Liyas Thomas Date: Sun, 25 Aug 2019 14:03:15 +0530 Subject: [PATCH 01/13] Fixing CI build errors --- .travis.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 46a545351..8aa80c5b5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,10 +35,10 @@ notifications: deploy: provider: pages - skip_cleanup: true + skip-cleanup: true # Refer to: https://docs.travis-ci.com/user/deployment/pages/#Setting-the-GitHub-token - github_token: $GITHUB_ACCESS_TOKEN + github-token: $GITHUB_ACCESS_TOKEN target-branch: gh-pages - local_dir: dist + local-dir: dist on: - branch: master \ No newline at end of file + branch: master From 8759b245ea701ca92f237cca91b8ce8200418d17 Mon Sep 17 00:00:00 2001 From: Nicholas Palenchar Date: Sun, 25 Aug 2019 11:53:23 -0400 Subject: [PATCH 02/13] wip - basic functionality achieved --- pages/index.vue | 64 ++++++++++++++++++++++++++++--------------------- 1 file changed, 37 insertions(+), 27 deletions(-) diff --git a/pages/index.vue b/pages/index.vue index bc1c3f052..501be50c7 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -36,34 +36,40 @@ + + Raw Input -
    -
  1. - - -
  2. -
  3. - - -
  4. -
  5. - - -
  6. -
- - +
+
    +
  1. + + +
  2. +
  3. + + +
  4. +
  5. + + +
  6. +
+
    +
  • + + +
  • +
+
    +
  • + + +
  • +
+
+ +
@@ -213,6 +219,8 @@ bearerToken: '', params: [], bodyParams: [], + rawParams: '', + rawInput: false, contentType: 'application/json', response: { status: '', @@ -244,6 +252,7 @@ return validIP.test(this.url) || validHostname.test(this.url); }, rawRequestBody() { + debugger; const { bodyParams } = this @@ -329,7 +338,8 @@ xhr.setRequestHeader('Authorization', 'Bearer ' + this.bearerToken); } if (this.method === 'POST' || this.method === 'PUT') { - const requestBody = this.rawRequestBody + debugger; + const requestBody = this.rawInput ? this.rawParams : this.rawRequestBody; xhr.setRequestHeader('Content-Length', requestBody.length) xhr.setRequestHeader('Content-Type', `${this.contentType}; charset=utf-8`) xhr.send(requestBody) From fddd41f6b41a7bbf7e60aa2963669d4cb07c2f4f Mon Sep 17 00:00:00 2001 From: Nicholas Palenchar Date: Sun, 25 Aug 2019 14:41:34 -0400 Subject: [PATCH 03/13] wip - some raw text formtting with one small return bug to fix --- pages/index.vue | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/pages/index.vue b/pages/index.vue index 501be50c7..82788ad02 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -68,7 +68,7 @@
- +
@@ -379,6 +379,31 @@ }, removeRequestBodyParam(index) { this.bodyParams.splice(index, 1) + }, + formatRawParams(event) { + if ((event.which !== 13 && event.which !== 9)) { + console.log('not not returning'); + return + } + + const textBody = event.target.value; + const textBeforeCursor = textBody.substring(0, event.target.selectionStart); + const textAfterCursor = textBody.substring(event.target.selectionEnd); + + if (event.which === 13) { + const lastLine = textBody.split('\n').slice(-1)[0]; + const rightPadding = lastLine.match(/([\s\t]*).*/)[1] || ""; + setTimeout(() => event.target.value = textBeforeCursor + '\n' + rightPadding + textAfterCursor, 1); + } + else if (event.which === 9) { + event.preventDefault(); + const oldSelectionStart = event.target.selectionStart; + const oldSelectionEnd = event.target.selectionEnd; + event.target.value = textBeforeCursor + '\xa0\xa0' + textAfterCursor; + debugger; + event.target.selectionStart = event.target.selectionEnd = oldSelectionStart + 2; + return false; + } } } } From bfffdbc4d876c4a8b509e7577278513967dd417e Mon Sep 17 00:00:00 2001 From: Nicholas Palenchar Date: Sun, 25 Aug 2019 17:10:17 -0400 Subject: [PATCH 04/13] closes #36 raw body option --- pages/index.vue | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/pages/index.vue b/pages/index.vue index 82788ad02..52cc456d6 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -36,8 +36,10 @@ - - Raw Input + + + +
@@ -252,7 +254,6 @@ return validIP.test(this.url) || validHostname.test(this.url); }, rawRequestBody() { - debugger; const { bodyParams } = this @@ -338,7 +339,6 @@ xhr.setRequestHeader('Authorization', 'Bearer ' + this.bearerToken); } if (this.method === 'POST' || this.method === 'PUT') { - debugger; const requestBody = this.rawInput ? this.rawParams : this.rawRequestBody; xhr.setRequestHeader('Content-Length', requestBody.length) xhr.setRequestHeader('Content-Type', `${this.contentType}; charset=utf-8`) @@ -382,8 +382,7 @@ }, formatRawParams(event) { if ((event.which !== 13 && event.which !== 9)) { - console.log('not not returning'); - return + return; } const textBody = event.target.value; @@ -391,8 +390,17 @@ const textAfterCursor = textBody.substring(event.target.selectionEnd); if (event.which === 13) { - const lastLine = textBody.split('\n').slice(-1)[0]; + event.preventDefault(); + const oldSelectionStart = event.target.selectionStart; + const lastLine = textBeforeCursor.split('\n').slice(-1)[0]; const rightPadding = lastLine.match(/([\s\t]*).*/)[1] || ""; + event.target.value = textBeforeCursor + '\n' + rightPadding + textAfterCursor; + setTimeout(() => event.target.selectionStart = event.target.selectionEnd = oldSelectionStart + rightPadding.length + 1, 1); + return; + + // const lastLine = textBeforeCursor.split('\n').slice(-1)[0]; + // const rightPadding = lastLine.match(/([\s\t]*).*/)[1] || ""; + event.target.value = textBeforeCursor + '\n' + rightPadding + textAfterCursor setTimeout(() => event.target.value = textBeforeCursor + '\n' + rightPadding + textAfterCursor, 1); } else if (event.which === 9) { From b46b2c1e8edab334b56ad8357aa90097f283c89f Mon Sep 17 00:00:00 2001 From: Nick Palenchar Date: Sun, 25 Aug 2019 17:16:13 -0400 Subject: [PATCH 05/13] Update index.vue remove stubborn debugger statement --- pages/index.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/pages/index.vue b/pages/index.vue index 52cc456d6..e6240b709 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -408,7 +408,6 @@ const oldSelectionStart = event.target.selectionStart; const oldSelectionEnd = event.target.selectionEnd; event.target.value = textBeforeCursor + '\xa0\xa0' + textAfterCursor; - debugger; event.target.selectionStart = event.target.selectionEnd = oldSelectionStart + 2; return false; } From 54876e6db301c6c81b95497ee3fb6b135a158cac Mon Sep 17 00:00:00 2001 From: Nick Palenchar Date: Sun, 25 Aug 2019 17:20:14 -0400 Subject: [PATCH 06/13] ohter updates that didn't get included --- pages/index.vue | 8 -------- 1 file changed, 8 deletions(-) diff --git a/pages/index.vue b/pages/index.vue index e6240b709..6ca2dd0ec 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -384,7 +384,6 @@ if ((event.which !== 13 && event.which !== 9)) { return; } - const textBody = event.target.value; const textBeforeCursor = textBody.substring(0, event.target.selectionStart); const textAfterCursor = textBody.substring(event.target.selectionEnd); @@ -396,17 +395,10 @@ const rightPadding = lastLine.match(/([\s\t]*).*/)[1] || ""; event.target.value = textBeforeCursor + '\n' + rightPadding + textAfterCursor; setTimeout(() => event.target.selectionStart = event.target.selectionEnd = oldSelectionStart + rightPadding.length + 1, 1); - return; - - // const lastLine = textBeforeCursor.split('\n').slice(-1)[0]; - // const rightPadding = lastLine.match(/([\s\t]*).*/)[1] || ""; - event.target.value = textBeforeCursor + '\n' + rightPadding + textAfterCursor - setTimeout(() => event.target.value = textBeforeCursor + '\n' + rightPadding + textAfterCursor, 1); } else if (event.which === 9) { event.preventDefault(); const oldSelectionStart = event.target.selectionStart; - const oldSelectionEnd = event.target.selectionEnd; event.target.value = textBeforeCursor + '\xa0\xa0' + textAfterCursor; event.target.selectionStart = event.target.selectionEnd = oldSelectionStart + 2; return false; From 3cd8d94ceb1bc45674cfb3363015a211bf8d83e1 Mon Sep 17 00:00:00 2001 From: Edison Augusthy Date: Mon, 26 Aug 2019 11:46:18 +0530 Subject: [PATCH 07/13] added Copy Response button --- pages/index.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pages/index.vue b/pages/index.vue index bc1c3f052..abf516551 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -138,9 +138,12 @@
    -
  • +
  • +
    - + +
    +
From 6bed41b8c16e07c9bca0658893834dea86ff66e9 Mon Sep 17 00:00:00 2001 From: Edison Augusthy Date: Mon, 26 Aug 2019 11:48:36 +0530 Subject: [PATCH 08/13] response copy Script Changes --- pages/index.vue | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pages/index.vue b/pages/index.vue index abf516551..ab63fb258 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -372,6 +372,11 @@ }, removeRequestBodyParam(index) { this.bodyParams.splice(index, 1) + }, + copyResponse() { + var copyText = document.getElementById("response-details"); + copyText.select(); + document.execCommand("copy"); } } } From 40c27f51393a8a4c3d488afa998801deea437766 Mon Sep 17 00:00:00 2001 From: Edison Augusthy Date: Mon, 26 Aug 2019 11:49:23 +0530 Subject: [PATCH 09/13] Button css changes --- assets/css/styles.scss | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/assets/css/styles.scss b/assets/css/styles.scss index 6fc3f46ab..05362c9ec 100644 --- a/assets/css/styles.scss +++ b/assets/css/styles.scss @@ -234,6 +234,16 @@ ol li { flex-direction: column; flex-grow: 1; } +.flex-wrap{ + display: flex; + justify-content: space-between; +} +.btn-copy{ + padding: 6px 14px; + font-size: 11px; + margin-right: 15px; + +} @media (max-width: $responsiveWidth) { ul, @@ -269,4 +279,4 @@ ol li { .sv-error-response { background-color: #b71c1c; -} \ No newline at end of file +} From 8403b9c40902b3556aaf214d30fde763ffb6ab2f Mon Sep 17 00:00:00 2001 From: Liyas Thomas Date: Mon, 26 Aug 2019 11:51:47 +0530 Subject: [PATCH 10/13] :pencil2: Updated contributors list --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 01e211e30..67ce43df4 100644 --- a/README.md +++ b/README.md @@ -113,8 +113,13 @@ See the [CHANGELOG](CHANGELOG.md) file for details. * [Liyas Thomas](https://github.com/liyasthomas) ### Contributors +* [NBTX](https://github.com/NBTX) * [Andrew Bastin](https://github.com/AndrewBastin) +* [Nick Palenchar](https://github.com/nickpalenchar) * [Abraham Williams](https://github.com/abraham) +* [Nicholas La Roux](https://github.com/larouxn) +* [RifqiAlAbqary](https://github.com/reefqi037) +* [izerozlu](https://github.com/izerozlu) ### Thanks * [Dribbble](https://dribbble.com) From 6f7fd2fc7b6e8585d27edb901ccb651f334dccee Mon Sep 17 00:00:00 2001 From: Edison Augusthy Date: Mon, 26 Aug 2019 12:08:01 +0530 Subject: [PATCH 11/13] Update index.vue --- pages/index.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/pages/index.vue b/pages/index.vue index fe73369a9..ea89abcf2 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -412,6 +412,7 @@ var copyText = document.getElementById("response-details"); copyText.select(); document.execCommand("copy"); + } } } From e1889c1db05f2e8f0ae35194d5a021ff47109e1e Mon Sep 17 00:00:00 2001 From: Liyas Thomas Date: Mon, 26 Aug 2019 14:37:02 +0530 Subject: [PATCH 12/13] :art: Updated status color codes --- assets/css/styles.scss | 10 +++++----- pages/websocket.vue | 19 ++++++------------- 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/assets/css/styles.scss b/assets/css/styles.scss index 05362c9ec..0bba48c1a 100644 --- a/assets/css/styles.scss +++ b/assets/css/styles.scss @@ -262,21 +262,21 @@ ol li { } .info-response { - background-color: #ffeb3b; + background-color: #FFEB3B; } .success-response { - background-color: #66BB6A; + background-color: #4BB543; } .redir-response { - background-color: #ff5722; + background-color: #FF5722; } .cl-error-response { - background-color: #ef5350; + background-color: #A63232; } .sv-error-response { - background-color: #b71c1c; + background-color: #B71C1C; } diff --git a/pages/websocket.vue b/pages/websocket.vue index cb24a92ca..cd371346c 100644 --- a/pages/websocket.vue +++ b/pages/websocket.vue @@ -7,9 +7,9 @@ -
  • +
  • - +
  • @@ -18,7 +18,7 @@
    • -
      +
      {{ getSourcePrefix(logEntry.source) }} {{ logEntry.payload }} @@ -33,9 +33,9 @@
    • -
    • +
    • - +
    @@ -44,13 +44,6 @@