From 18287f888b0c3ae80422d4068c511614b55bfa6d Mon Sep 17 00:00:00 2001 From: Emiliano Ciavatta Date: Mon, 19 Oct 2020 12:40:53 +0200 Subject: Add resizable layout --- frontend/src/components/Header.js | 28 ++++----- frontend/src/components/Header.scss | 17 ++++-- frontend/src/components/Timeline.js | 2 +- .../src/components/pages/ConfigurationPage.scss | 9 +-- frontend/src/components/pages/MainPage.js | 69 ++++++++++++++-------- frontend/src/components/pages/MainPage.scss | 22 +++---- frontend/src/components/pages/common.scss | 15 +---- frontend/src/components/panels/StreamsPane.scss | 6 ++ 8 files changed, 90 insertions(+), 78 deletions(-) (limited to 'frontend/src/components') diff --git a/frontend/src/components/Header.js b/frontend/src/components/Header.js index c46d768..4db05a5 100644 --- a/frontend/src/components/Header.js +++ b/frontend/src/components/Header.js @@ -46,19 +46,17 @@ class Header extends Component { render() { return ( -
-
-
-

- - { - this.el = el; - }}/> - -

-
+
+
+

+ + { + this.el = el; + }}/> + +

- {this.props.configured &&
+ {this.props.configured &&
-
} + } - {this.props.configured &&
+ {this.props.configured &&
@@ -91,7 +89,7 @@ class Header extends Component {
-
} + }
); diff --git a/frontend/src/components/Header.scss b/frontend/src/components/Header.scss index fff28e6..c6a88b7 100644 --- a/frontend/src/components/Header.scss +++ b/frontend/src/components/Header.scss @@ -1,16 +1,18 @@ @import "../colors"; .header { - height: 80px; - padding: 15px 30px; + padding: 15px; - > .row { + .header-content { + display: flex; + width: 100%; + padding: 0 10px; background-color: $color-primary-0; } .header-title { width: 200px; - margin: 5px 0 5px -5px; + margin: 5px 0 5px 0; } .header-buttons { @@ -24,6 +26,7 @@ } .filters-bar { + flex: 1; padding: 3px 0; .filter, @@ -38,4 +41,10 @@ border-radius: 5px; } } + + @media screen and (max-width: 1530px) { + &.configured .header-title { + display: none; + } + } } diff --git a/frontend/src/components/Timeline.js b/frontend/src/components/Timeline.js index 9ecbd80..5443a3b 100644 --- a/frontend/src/components/Timeline.js +++ b/frontend/src/components/Timeline.js @@ -256,7 +256,7 @@ class Timeline extends Component { enablePanZoom={true} utc={false} onTimeRangeChanged={this.handleTimeRangeChange}> - + diff --git a/frontend/src/components/pages/ConfigurationPage.scss b/frontend/src/components/pages/ConfigurationPage.scss index 4254547..2ceccd5 100644 --- a/frontend/src/components/pages/ConfigurationPage.scss +++ b/frontend/src/components/pages/ConfigurationPage.scss @@ -10,16 +10,10 @@ .configuration-pane { display: flex; justify-content: center; - height: 100%; - padding-top: 100px; .section-content { - background-color: $color-primary-3; margin-top: 15px; - } - - .section-table table { - background-color: red !important; + background-color: $color-primary-3; } .section-footer { @@ -27,4 +21,3 @@ } } } - diff --git a/frontend/src/components/pages/MainPage.js b/frontend/src/components/pages/MainPage.js index c4dcd20..5d42f4d 100644 --- a/frontend/src/components/pages/MainPage.js +++ b/frontend/src/components/pages/MainPage.js @@ -16,6 +16,7 @@ */ import React, {Component} from "react"; +import {ReflexContainer, ReflexElement, ReflexSplitter} from "react-reflex"; import {Route, Switch} from "react-router-dom"; import Filters from "../dialogs/Filters"; import Header from "../Header"; @@ -29,10 +30,22 @@ import StreamsPane from "../panels/StreamsPane"; import Timeline from "../Timeline"; import "./common.scss"; import "./MainPage.scss"; +import 'react-reflex/styles.css' class MainPage extends Component { - state = {}; + state = { + timelineHeight: 175 + }; + + handleTimelineResize = (e) => { + if (this.timelineTimeoutHandle) { + clearTimeout(this.timelineTimeoutHandle); + } + + this.timelineTimeoutHandle = setTimeout(() => + this.setState({timelineHeight: e.domElement.clientHeight}), 100); + }; render() { let modal; @@ -41,34 +54,40 @@ class MainPage extends Component { } return ( -
-
+ +
this.setState({filterWindowOpen: true})} configured={true}/> -
+ {modal} + -
-
- this.setState({selectedConnection: c})}/> -
-
- - }/> - }/> - }/> - }/> - }/> - }/> - -
+ + + + this.setState({selectedConnection: c})}/> + - {modal} -
+ + + + + }/> + }/> + }/> + }/> + }/> + }/> + + + + + + -
- -
-
+ + + + ); } } diff --git a/frontend/src/components/pages/MainPage.scss b/frontend/src/components/pages/MainPage.scss index 4ca54c0..4fc5853 100644 --- a/frontend/src/components/pages/MainPage.scss +++ b/frontend/src/components/pages/MainPage.scss @@ -1,25 +1,25 @@ @import "../../colors"; .main-page { + .page-header { + min-height: 80px; + } + + .page-footer { + overflow: hidden !important; + min-height: 175px; + } + .page-content { - display: flex; - flex: 1; - padding: 0 15px; - background-color: $color-primary-2; + padding: 0 7.5px; .connections-pane { - flex: 1 0; margin-right: 7.5px; } .details-pane { - position: relative; - flex: 1 1; + overflow: hidden; margin-left: 7.5px; } } - - .page-footer { - flex: 0; - } } diff --git a/frontend/src/components/pages/common.scss b/frontend/src/components/pages/common.scss index fcf5c20..2b0cd05 100644 --- a/frontend/src/components/pages/common.scss +++ b/frontend/src/components/pages/common.scss @@ -1,16 +1,3 @@ .page { - position: relative; - display: flex; - flex-direction: column; - height: 100vh; - - .page-header, - .page-footer { - flex: 0; - } - - .page-content { - overflow: hidden; - flex: 1; - } + height: 100vh !important; } diff --git a/frontend/src/components/panels/StreamsPane.scss b/frontend/src/components/panels/StreamsPane.scss index 1f641f3..1d8a250 100644 --- a/frontend/src/components/panels/StreamsPane.scss +++ b/frontend/src/components/panels/StreamsPane.scss @@ -34,6 +34,9 @@ font-size: 11px; margin-top: 6px; margin-left: -10px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; } .connection-message-actions { @@ -99,6 +102,9 @@ font-size: 12px; padding-top: 7px; padding-left: 25px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; } .header-actions { -- cgit v1.2.3-70-g09d2