diff --git a/packages/hoppscotch-app/assets/icons/arrow-down-left.svg b/packages/hoppscotch-app/assets/icons/arrow-down-left.svg new file mode 100644 index 000000000..583988208 --- /dev/null +++ b/packages/hoppscotch-app/assets/icons/arrow-down-left.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/hoppscotch-app/assets/icons/arrow-down.svg b/packages/hoppscotch-app/assets/icons/arrow-down.svg new file mode 100644 index 000000000..ad365d5fc --- /dev/null +++ b/packages/hoppscotch-app/assets/icons/arrow-down.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/packages/hoppscotch-app/assets/icons/arrow-up-right.svg b/packages/hoppscotch-app/assets/icons/arrow-up-right.svg new file mode 100644 index 000000000..6ac911836 --- /dev/null +++ b/packages/hoppscotch-app/assets/icons/arrow-up-right.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/hoppscotch-app/assets/icons/arrow-up.svg b/packages/hoppscotch-app/assets/icons/arrow-up.svg new file mode 100644 index 000000000..9966fa544 --- /dev/null +++ b/packages/hoppscotch-app/assets/icons/arrow-up.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/packages/hoppscotch-app/assets/icons/chevrons-down.svg b/packages/hoppscotch-app/assets/icons/chevrons-down.svg new file mode 100644 index 000000000..b46abe3a6 --- /dev/null +++ b/packages/hoppscotch-app/assets/icons/chevrons-down.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/packages/hoppscotch-app/assets/icons/chevrons-up.svg b/packages/hoppscotch-app/assets/icons/chevrons-up.svg new file mode 100644 index 000000000..d79fc4952 --- /dev/null +++ b/packages/hoppscotch-app/assets/icons/chevrons-up.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/packages/hoppscotch-app/assets/icons/info-disconnect.svg b/packages/hoppscotch-app/assets/icons/info-disconnect.svg new file mode 100644 index 000000000..ab55c86fd --- /dev/null +++ b/packages/hoppscotch-app/assets/icons/info-disconnect.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/packages/hoppscotch-app/assets/icons/info-realtime.svg b/packages/hoppscotch-app/assets/icons/info-realtime.svg new file mode 100644 index 000000000..ab55c86fd --- /dev/null +++ b/packages/hoppscotch-app/assets/icons/info-realtime.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/packages/hoppscotch-app/components/realtime/Log.vue b/packages/hoppscotch-app/components/realtime/Log.vue index 348a2fab7..e46dc21d0 100644 --- a/packages/hoppscotch-app/components/realtime/Log.vue +++ b/packages/hoppscotch-app/components/realtime/Log.vue @@ -1,77 +1,128 @@ - + diff --git a/packages/hoppscotch-app/components/realtime/LogEntry.vue b/packages/hoppscotch-app/components/realtime/LogEntry.vue new file mode 100644 index 000000000..941455294 --- /dev/null +++ b/packages/hoppscotch-app/components/realtime/LogEntry.vue @@ -0,0 +1,388 @@ + + + + + diff --git a/packages/hoppscotch-app/components/realtime/Mqtt.vue b/packages/hoppscotch-app/components/realtime/Mqtt.vue index 6cd482c20..b04000091 100644 --- a/packages/hoppscotch-app/components/realtime/Mqtt.vue +++ b/packages/hoppscotch-app/components/realtime/Mqtt.vue @@ -48,7 +48,11 @@ @@ -136,7 +140,8 @@ export default defineComponent({ { payload: this.$t("state.connecting_to", { name: this.server }), source: "info", - color: "var(--accent-color)", + event: "connecting", + ts: Date.now(), }, ] if (typeof EventSource !== "undefined") { @@ -149,8 +154,8 @@ export default defineComponent({ { payload: this.$t("state.connected_to", { name: this.server }), source: "info", - color: "var(--accent-color)", - ts: new Date().toLocaleTimeString(), + event: "connected", + ts: Date.now(), }, ] this.$toast.success(this.$t("state.connected")) @@ -164,9 +169,9 @@ export default defineComponent({ payload: this.$t("state.disconnected_from", { name: this.server, }), - source: "info", - color: "#ff5555", - ts: new Date().toLocaleTimeString(), + source: "disconnected", + event: "disconnected", + ts: Date.now(), }) this.$toast.error(this.$t("state.disconnected")) } @@ -174,7 +179,7 @@ export default defineComponent({ addSSELogLine({ payload: data, source: "server", - ts: new Date().toLocaleTimeString(), + ts: Date.now(), }) }) } catch (e) { @@ -185,9 +190,9 @@ export default defineComponent({ this.log = [ { payload: this.$t("error.browser_support_sse"), - source: "info", - color: "#ff5555", - ts: new Date().toLocaleTimeString(), + source: "disconnected", + event: "error", + ts: Date.now(), }, ] } @@ -201,22 +206,25 @@ export default defineComponent({ this.connectionSSEState = false addSSELogLine({ payload: this.$t("error.something_went_wrong"), - source: "info", - color: "#ff5555", - ts: new Date().toLocaleTimeString(), + source: "disconnected", + event: "error", + ts: Date.now(), }) if (error !== null) addSSELogLine({ payload: error, - source: "info", - color: "#ff5555", - ts: new Date().toLocaleTimeString(), + source: "disconnected", + event: "error", + ts: Date.now(), }) }, stop() { this.sse.close() this.sse.onclose() }, + clearLogEntries() { + this.log = [] + }, }, }) diff --git a/packages/hoppscotch-app/components/realtime/Websocket.vue b/packages/hoppscotch-app/components/realtime/Websocket.vue index cd1ce8ee5..9ac8705a8 100644 --- a/packages/hoppscotch-app/components/realtime/Websocket.vue +++ b/packages/hoppscotch-app/components/realtime/Websocket.vue @@ -137,22 +137,23 @@ class="inline-flex flex-col object-contain object-center w-16 h-16 my-4" :alt="$t('empty.protocols')" /> - - {{ $t("empty.protocols") }} - + {{ $t("empty.protocols") }}