From 563dc8dc4c335f8eb0412121766fe39c8e57ae34 Mon Sep 17 00:00:00 2001 From: Tasio Mendez Date: Wed, 31 Jan 2018 11:33:36 +0100 Subject: [PATCH] Navbar controls --- server.py | 19 ++++++++++--------- templates/css/main.css | 31 ++++++++++++++++++++++++++----- templates/index.html | 38 +++++++++++++++++++++++++++----------- templates/js/socket.js | 4 ++-- templates/js/template.js | 4 ++-- 5 files changed, 67 insertions(+), 29 deletions(-) diff --git a/server.py b/server.py index f62c95a..d649965 100644 --- a/server.py +++ b/server.py @@ -89,15 +89,6 @@ class SocketHandler(tornado.websocket.WebSocketHandler): self.send_log('INFO.soil', 'Using config: {name}'.format(name=config['name'])) self.name = config['name'] - - with self.logging(self.application.model.name): - self.application.model.run(config) - - trials = [] - for i in range(config['num_trials']): - trials.append('{}_trial_{}'.format(self.name, i)) - self.write_message({'type': 'trials', - 'data': trials }) settings = [] for key in config['environment_params']: @@ -116,6 +107,16 @@ class SocketHandler(tornado.websocket.WebSocketHandler): self.write_message({'type': 'settings', 'data': settings}) + + # Run simulation and capture logs + with self.logging(self.application.model.name): + self.application.model.run(config) + + trials = [] + for i in range(config['num_trials']): + trials.append('{}_trial_{}'.format(self.name, i)) + self.write_message({'type': 'trials', + 'data': trials }) elif msg['type'] == 'get_trial': if self.application.verbose: diff --git a/templates/css/main.css b/templates/css/main.css index c430c30..f67a731 100644 --- a/templates/css/main.css +++ b/templates/css/main.css @@ -1,5 +1,5 @@ -html, body, .carousel-inner { +html, body { height: 100%; } @@ -7,12 +7,17 @@ html, body, .carousel-inner { height: calc(100% - 150px); } -.carousel-indicators li { - border-color: black; +.carousel-inner { + height: calc(100% - 50px) !important; } -.carousel-indicators li.active { - background-color: black; +.carousel-inner .item, +.carousel-inner .item .container-fluid { + height: 100%; +} + +.navbar { + box-shadow: 0px -2px 5px 3px rgba(0, 0, 0, .3); } .node { @@ -297,6 +302,8 @@ table#link-distance .max { #wrapper-settings { padding: 15px !important; + height: 100%; + overflow-y: auto; } #wrapper-settings .btn-group button:focus { @@ -308,3 +315,17 @@ table#link-distance .max { font-size: xx-small; padding: 3px 6px; } + +.item.settings .container-fluid { + padding-top: 10px !important; +} + +#wrapper-settings::-webkit-scrollbar { + width: 6px; + background-color: #F5F5F5; +} + +#wrapper-settings::-webkit-scrollbar-thumb { + -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,.3); + background-color: #ccc; +} diff --git a/templates/index.html b/templates/index.html index 70838c2..20ddfeb 100644 --- a/templates/index.html +++ b/templates/index.html @@ -138,13 +138,30 @@ -