From d67d6c7b59c0454e0fdfdc3adcfd2064c9b1810e Mon Sep 17 00:00:00 2001 From: therealbobo Date: Sat, 12 Sep 2020 17:17:12 +0200 Subject: fixed scrollbar in connection-content class --- frontend/src/components/ConnectionContent.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'frontend') diff --git a/frontend/src/components/ConnectionContent.scss b/frontend/src/components/ConnectionContent.scss index a1b4afd..5a17066 100644 --- a/frontend/src/components/ConnectionContent.scss +++ b/frontend/src/components/ConnectionContent.scss @@ -3,7 +3,7 @@ .connection-content { background-color: $color-primary-3; height: 100%; - overflow: auto; + overflow: fixed; pre { background-color: $color-primary-0; @@ -11,7 +11,7 @@ word-break: break-word; max-width: 100%; white-space: pre-wrap; - height: 100%; + height: 95%; } .from-client { -- cgit v1.2.3-70-g09d2 From e7c2428e24d0fc6aebf524130531800a89332829 Mon Sep 17 00:00:00 2001 From: therealbobo Date: Sat, 12 Sep 2020 17:41:03 +0200 Subject: initial decoding support --- frontend/src/components/ConnectionContent.js | 29 +++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'frontend') diff --git a/frontend/src/components/ConnectionContent.js b/frontend/src/components/ConnectionContent.js index 905a56d..2100a68 100644 --- a/frontend/src/components/ConnectionContent.js +++ b/frontend/src/components/ConnectionContent.js @@ -1,6 +1,6 @@ import React, {Component} from 'react'; import './ConnectionContent.scss'; -import {Dropdown} from 'react-bootstrap'; +import {Dropdown, Button} from 'react-bootstrap'; import axios from 'axios'; class ConnectionContent extends Component { @@ -10,7 +10,8 @@ class ConnectionContent extends Component { this.state = { loading: false, connectionContent: null, - format: "default" + format: "default", + decoded: false, }; this.validFormats = ["default", "hex", "hexdump", "base32", "base64", "ascii", "binary", "decimal", "octal"]; @@ -37,6 +38,10 @@ class ConnectionContent extends Component { } } + toggleDecoded() { + this.setState({decoded: !this.state.decoded}); + } + render() { let content = this.state.connectionContent; @@ -46,7 +51,22 @@ class ConnectionContent extends Component { let payload = content.map((c, i) => - {c.content} + {c.from_client + ? +
{c.content}
+ : + <> + {c.decoded_content + ? + <> +
{c.content}
+
{c.decoded_content}
+ + : +
{c.content}
+ } + + }
); @@ -69,6 +89,9 @@ class ConnectionContent extends Component { decimal octal + + + -- cgit v1.2.3-70-g09d2