From 079e8e95b69dee67c2fd5c29a164eebd833313b0 Mon Sep 17 00:00:00 2001 From: Sergey Shkurov Date: Tue, 25 Jul 2023 02:24:58 +0400 Subject: [PATCH] Show timing between packets --- src/App.vue | 4 ---- src/components/Packet.vue | 13 ++++++++----- src/main.js | 1 + src/views/ContentStream.vue | 20 +++++++++++++++++--- 4 files changed, 26 insertions(+), 12 deletions(-) diff --git a/src/App.vue b/src/App.vue index 926714e..5befa74 100644 --- a/src/App.vue +++ b/src/App.vue @@ -307,7 +307,3 @@ padding-top: 55px; /* Space for fixed navbar */ } - - diff --git a/src/components/Packet.vue b/src/components/Packet.vue index 0d51f71..ce5b4a0 100644 --- a/src/components/Packet.vue +++ b/src/components/Packet.vue @@ -1,16 +1,18 @@ @@ -29,6 +31,7 @@ tlsDecrypted: Boolean(), content: String(), }, + offset: Number(), }, computed: { hexdata() { diff --git a/src/main.js b/src/main.js index 1895376..94ff28b 100644 --- a/src/main.js +++ b/src/main.js @@ -9,6 +9,7 @@ import store from './store'; import 'bootstrap/dist/css/bootstrap.css'; import 'bootstrap-vue/dist/bootstrap-vue.css'; import '@fortawesome/fontawesome-free/css/all.css'; +import "bootstrap-darkmode/scss/darktheme.scss"; Vue.config.productionTip = false; Vue.use(BootstrapVue); diff --git a/src/views/ContentStream.vue b/src/views/ContentStream.vue index b8f5e22..af8ee70 100644 --- a/src/views/ContentStream.vue +++ b/src/views/ContentStream.vue @@ -5,9 +5,10 @@ response.

- + @@ -26,6 +27,19 @@ packets: [], }; }, + computed: { + packetsWithOffsets: function() { + return this.packets.map((el, i) => { + let offset = null; + + if (i !== 0) { + offset = el.timestamp - this.packets[i - 1].timestamp; + } + + return {packet: el, offset: offset,} + }) + }, + }, watch: { '$route.params.streamId': function () { this.packets = [];