-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More easily extend web UI #1574
Conversation
If you have a chart with multiple values and the first value is 0, "No Data" was returned. Check all chart values and only return "No Data" if none of the values are non-zero.
These must be used with templates extending index.html in order to render the page properly.
Allows for easier reuse of styling and functionality in extended UI elements
Starting web UI server later caused problems with tests, likely would be a breaking change for people starting the web UI programmatically.
Codecov Report
@@ Coverage Diff @@
## master #1574 +/- ##
==========================================
- Coverage 82.34% 81.52% -0.83%
==========================================
Files 28 28
Lines 2572 2593 +21
Branches 392 395 +3
==========================================
- Hits 2118 2114 -4
- Misses 363 381 +18
- Partials 91 98 +7
Continue to review full report at Codecov.
|
Cool stuff! Can you add some documentation and an example for how to extend the UI? As I dont use the web ui and dont know the code behind very well, I'll take your word for it being sensible & working :) If something does break in the UI related to these changes, will you have some time to help fix it? Maybe you'd even be interested in being "the" UI maintainer for Locust :) (deciding what PRs are good, what direction we want to take the UI etc) |
Added example of extending the web UI. I can help with the UI code where I can. I'm not exactly an expert, just hacking away at it. I needed to do this for my work and decided to pass the improvements upstream so I didn't have to maintain them in a fork. I don't know if I can sign on to be a maintainer of the web UI but I can provide feedback and review PRs if I can. |
Lgtm. Can you just add a reference to the example in the documentation (extending-locust.rst) |
How's that? |
Question: is there anyway to extend the root page / ? or I can only add new routes? I mention I have no experience with Flask Thanks, |
I found a hacky solution. I am rewriting the url_map rules and adding a different http method for the default index so that it is not matched anymore:
|
Addresses #1530. Includes the following additions and changes:
index.html
is extendable with blocks for tabs, panes, and scriptsindex.html
are retrievable viaweb_ui.update_template_args()