Skip to content

Commit 123e594

Browse files
committed
Show git version in footer
1 parent 90b30b4 commit 123e594

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

app.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,13 +668,15 @@ def filter_build_options_by_category(build_options, category):
668668
def parse_build_categories(build_options):
669669
return sorted(list(set([f.category for f in build_options])))
670670

671+
GIT_VERSION_SHORT = get_git_hash('HEAD', os.path.abspath(app.root_path))[:10]
672+
671673
@app.route('/', defaults={'token': None}, methods=['GET'])
672674
@app.route('/<token>', methods=['GET'])
673675
def home(token):
674676
if token:
675677
app.logger.info("Showing log for build id " + token)
676678
app.logger.info('Rendering index.html')
677-
return render_template('index.html', token=token)
679+
return render_template('index.html', token=token, app_git_version=GIT_VERSION_SHORT)
678680

679681
@app.route("/builds/<path:name>")
680682
def download_file(name):

templates/index.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,13 @@
6464
</span>|
6565
<span class="mx-2">Source:
6666
<a href="https://github.com/Ardupilot/CustomBuild" style="text-decoration: underline; color: white;">Ardupilot/CustomBuild</a>
67+
</span>|
68+
<span class="mx-2">Git Version:
69+
<a href="https://github.com/Ardupilot/CustomBuild/commit/{{ app_git_version }}" style="text-decoration: underline; color: white;">{{ app_git_version }}</a>
6770
</span>
6871
</div>
69-
<span>To try out the newest features of the app, please visit our beta server
70-
<a href="https://custom-beta.ardupilot.org" style="text-decoration: underline; color: white;">custom-beta.ardupilot.org</a>
72+
<span>To try out the newest features of the app, please visit our
73+
<a href="https://custom-beta.ardupilot.org" style="text-decoration: underline; color: white;">beta server</a>
7174
</span>
7275
</div>
7376
</div>

0 commit comments

Comments
 (0)