From e5c2bfab1be1f15063395cb21dd23fb48784add5 Mon Sep 17 00:00:00 2001 From: thaffenden Date: Fri, 24 Feb 2017 15:26:56 +0000 Subject: [PATCH] Adds host name to header --- locust/static/style.css | 6 ++++++ locust/templates/index.html | 6 ++++++ locust/web.py | 10 +++++++++- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/locust/static/style.css b/locust/static/style.css index 688c4fbfe2..bfbf401c85 100644 --- a/locust/static/style.css +++ b/locust/static/style.css @@ -77,6 +77,8 @@ a:hover { color: #000; font-size: 16px; font-weight: bold; + max-width: 165px; + word-wrap: break-word; } .boxes .box_rps .value, .boxes .box_slaves .value { font-size: 32px; @@ -128,6 +130,10 @@ a:hover { background: #4e4141; } +#host_url { + font-size: 14px; + font-weight: normal; +} .boxes .box_running { display: none; } diff --git a/locust/templates/index.html b/locust/templates/index.html index edd04c9ba0..a0b4719046 100644 --- a/locust/templates/index.html +++ b/locust/templates/index.html @@ -10,6 +10,12 @@
+
+
HOST
+
+ {{host}} +
+
STATUS
diff --git a/locust/web.py b/locust/web.py index 12fe8fbfdb..8eab93047b 100644 --- a/locust/web.py +++ b/locust/web.py @@ -35,13 +35,21 @@ def index(): slave_count = runners.locust_runner.slave_count else: slave_count = 0 + + if runners.locust_runner.host: + host = runners.locust_runner.host + elif len(runners.locust_runner.locust_classes) > 0: + host = runners.locust_runner.locust_classes[0].host + else: + host = None return render_template("index.html", state=runners.locust_runner.state, is_distributed=is_distributed, slave_count=slave_count, user_count=runners.locust_runner.user_count, - version=version + version=version, + host=host ) @app.route('/swarm', methods=["POST"])