From 215b348553ed1b286a143b21e0c1582c71e8230c Mon Sep 17 00:00:00 2001 From: Sascha Roloff Date: Mon, 12 May 2025 12:59:11 +0200 Subject: Invocation server: add css style file --- doc/invocations-http-server/server.py | 20 ++++++++++++++------ doc/invocations-http-server/static/style.css | 13 +++++++++++++ doc/invocations-http-server/templates/base.html | 1 + .../templates/invocations.html | 2 +- 4 files changed, 29 insertions(+), 7 deletions(-) create mode 100644 doc/invocations-http-server/static/style.css (limited to 'doc') diff --git a/doc/invocations-http-server/server.py b/doc/invocations-http-server/server.py index 7121ec75..bb9d2260 100755 --- a/doc/invocations-http-server/server.py +++ b/doc/invocations-http-server/server.py @@ -22,6 +22,7 @@ import werkzeug.routing import werkzeug.utils from werkzeug.wrappers import Request, Response +from werkzeug.middleware.shared_data import SharedDataMiddleware def core_config(conf): new_conf = {} @@ -442,6 +443,13 @@ class InvocationServer: return self.render("invocation.html", params) +def create_app(logsdir, **kwargs): + app = InvocationServer(logsdir, **kwargs) + app = SharedDataMiddleware(app, { + '/static': os.path.join(os.path.dirname(__file__), 'static') + }) + return app + if __name__ == '__main__': import sys from argparse import ArgumentParser @@ -472,10 +480,10 @@ if __name__ == '__main__': print("just-mr argument should be valid json, but %r is not: %s" % (args.just_mr, e), file=sys.stderr) sys.exit(1) - app = InvocationServer(args.DIR, - just_mr=just_mr, - graph=args.graph, - artifacts=args.artifacts, - meta=args.meta, - profile=args.profile) + app = create_app(args.DIR, + just_mr=just_mr, + graph=args.graph, + artifacts=args.artifacts, + meta=args.meta, + profile=args.profile) make_server(args.interface, args.port, app).serve_forever() diff --git a/doc/invocations-http-server/static/style.css b/doc/invocations-http-server/static/style.css new file mode 100644 index 00000000..163cd951 --- /dev/null +++ b/doc/invocations-http-server/static/style.css @@ -0,0 +1,13 @@ +body { + background: #e8eff0; + font-family: "Helvetica"; + font-size: large; +} +a { + color: #11557c; +} +h1, +h2, +h3 { + color: #11557c; +} diff --git a/doc/invocations-http-server/templates/base.html b/doc/invocations-http-server/templates/base.html index cf591652..d7a13f0b 100644 --- a/doc/invocations-http-server/templates/base.html +++ b/doc/invocations-http-server/templates/base.html @@ -4,6 +4,7 @@ {% block heading %}Invocation Browser{% endblock %} + {% block content %} diff --git a/doc/invocations-http-server/templates/invocations.html b/doc/invocations-http-server/templates/invocations.html index a98babae..c5680240 100644 --- a/doc/invocations-http-server/templates/invocations.html +++ b/doc/invocations-http-server/templates/invocations.html @@ -8,7 +8,7 @@ Recent Invocations

Invocations filtered by {{ filter_info | e }}

{% else %}

Recent Invocations

-Filter by: +Filter by: only not fully cached {% if context_filters %}
-- cgit v1.2.3