Skip to content

Commit

Permalink
Show git version in footer
Browse files Browse the repository at this point in the history
  • Loading branch information
shiv-tyagi committed May 4, 2023
1 parent 90b30b4 commit 16e7e33
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 3 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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('/<token>', 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/<path:name>")
def download_file(name):
Expand Down
7 changes: 5 additions & 2 deletions templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,13 @@
</span>|
<span class="mx-2">Source:
<a href="https://github.com/Ardupilot/CustomBuild" style="text-decoration: underline; color: white;">Ardupilot/CustomBuild</a>
</span>|
<span class="mx-2">Git Version:
<a href="https://github.com/Ardupilot/CustomBuild/commit/{{ app_git_version }}" style="text-decoration: underline; color: white;">{{ app_git_version }}</a>
</span>
</div>
<span>To try out the newest features of the app, please visit our beta server
<a href="https://custom-beta.ardupilot.org" style="text-decoration: underline; color: white;">custom-beta.ardupilot.org</a>
<span>To try out the newest features of the app, please visit our
<a href="https://custom-beta.ardupilot.org" style="text-decoration: underline; color: white;">beta server</a>
</span>
</div>
</div>
Expand Down

0 comments on commit 16e7e33

Please sign in to comment.