finished basic about page, and including 15 recent commits by default
This commit is contained in:
@@ -20,7 +20,7 @@ RUN pip3 install --upgrade pillow --user
|
||||
EXPOSE 443
|
||||
EXPOSE 55432
|
||||
COPY . .
|
||||
RUN git log -n 5 > ./internal/git-log.txt
|
||||
RUN git log -n 15 > ./internal/git-log.txt
|
||||
RUN rm -rf .git
|
||||
RUN chown mythtv:mythtv /code
|
||||
RUN chown mythtv:mythtv ./static
|
||||
|
||||
2
TODO
2
TODO
@@ -15,8 +15,6 @@
|
||||
|
||||
* change the rotation code to use that jpeg util to reduce/remove compression loss?
|
||||
|
||||
* About page -> find a way to push git commit/date through to f/e, so we can see what release we are running
|
||||
|
||||
* should allow context menu from View thumbs (particularly useful on search) to show other files around this one by date (maybe that folder or something?)
|
||||
|
||||
* could get better AI optim, by keeping track of just new files since scan (even if we did this from the DB),
|
||||
|
||||
33
main.py
33
main.py
@@ -134,6 +134,38 @@ def login():
|
||||
|
||||
return render_template("login.html", form=form)
|
||||
|
||||
################################################################################
|
||||
# simple about route/page that shows build date and because Prod version is
|
||||
# Docker built, it picks up a git log for displaying recent commits
|
||||
################################################################################
|
||||
@app.route('/about')
|
||||
@login_required
|
||||
def about():
|
||||
commits=[]
|
||||
try:
|
||||
with open( 'internal/git-log.txt', 'r' ) as fp:
|
||||
can_add=False
|
||||
for l in fp:
|
||||
if l.startswith( 'commit' ) or l.startswith( 'Author:' ):
|
||||
pass
|
||||
elif l.startswith( 'Date:' ):
|
||||
if can_add:
|
||||
commits.append(o)
|
||||
o={}
|
||||
o['date']=l.replace("Date: ", "")
|
||||
o['str']=''
|
||||
can_add=True
|
||||
else:
|
||||
o['str']=o['str']+l
|
||||
except FileNotFoundError:
|
||||
o={}
|
||||
o['date']="No known date"
|
||||
o['str']='No commits to display (if this is DEV then last build is now)'
|
||||
|
||||
# add last commit (or fake commit if no file)
|
||||
commits.append(o)
|
||||
return render_template("about.html", commits=commits)
|
||||
|
||||
@app.route('/logout')
|
||||
@login_required
|
||||
def logout():
|
||||
@@ -163,4 +195,3 @@ def _jinja2_filter_parentpath(dn):
|
||||
s+=1
|
||||
f=username.index(',')
|
||||
return username[s:f]
|
||||
|
||||
|
||||
@@ -124,6 +124,7 @@
|
||||
</a>
|
||||
<div class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdownMenuLink">
|
||||
<div><a class="dropdown-item" href="{{url_for('states')}}">{{current_user.dn|Username}}</a></div>
|
||||
<div><a class="dropdown-item" href="{{url_for('about')}}">About</a></div>
|
||||
<div><a class="dropdown-item" href="{{url_for('logout')}}">Logout</a></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user