From 16e7e33e863d7e0ea49377247a8144d418f77db5 Mon Sep 17 00:00:00 2001 From: Shiv Tyagi Date: Thu, 4 May 2023 21:56:17 +0530 Subject: [PATCH] Show git version in footer --- app.py | 4 +++- templates/index.html | 7 +++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app.py b/app.py index dc04398..04198f4 100755 --- a/app.py +++ b/app.py @@ -668,13 +668,15 @@ def filter_build_options_by_category(build_options, category): def parse_build_categories(build_options): return sorted(list(set([f.category for f in build_options]))) +GIT_VERSION_SHORT = get_git_hash('HEAD', os.path.abspath(os.path.dirname(__file__)))[:10] + @app.route('/', defaults={'token': None}, methods=['GET']) @app.route('/', methods=['GET']) def home(token): if token: app.logger.info("Showing log for build id " + token) app.logger.info('Rendering index.html') - return render_template('index.html', token=token) + return render_template('index.html', token=token, app_git_version=GIT_VERSION_SHORT) @app.route("/builds/") def download_file(name): diff --git a/templates/index.html b/templates/index.html index 92c89ac..c22ee62 100644 --- a/templates/index.html +++ b/templates/index.html @@ -64,10 +64,13 @@ | Source: Ardupilot/CustomBuild + | + Git Version: + {{ app_git_version }} - To try out the newest features of the app, please visit our beta server - custom-beta.ardupilot.org + To try out the newest features of the app, please visit our + beta server