Show build time in bottom-right corner
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
b9c5f835f4
commit
e1b18f392e
6 changed files with 23 additions and 0 deletions
|
|
@ -38,3 +38,4 @@ jobs:
|
||||||
context: .
|
context: .
|
||||||
push: true
|
push: true
|
||||||
tags: fg.creamfresh.xyz/mrwnslz/diora-web:${{ steps.tag.outputs.tag }}
|
tags: fg.creamfresh.xyz/mrwnslz/diora-web:${{ steps.tag.outputs.tag }}
|
||||||
|
build-args: BUILD_TIME=${{ github.event.head_commit.timestamp }}
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
COPY requirements.txt .
|
COPY requirements.txt .
|
||||||
RUN pip install --no-cache-dir -r requirements.txt gunicorn
|
RUN pip install --no-cache-dir -r requirements.txt gunicorn
|
||||||
|
|
||||||
|
ARG BUILD_TIME
|
||||||
|
ENV BUILD_TIME=${BUILD_TIME}
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
RUN python manage.py collectstatic --noinput && mkdir -p /app/data
|
RUN python manage.py collectstatic --noinput && mkdir -p /app/data
|
||||||
|
|
|
||||||
5
diora/context_processors.py
Normal file
5
diora/context_processors.py
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
from django.conf import settings
|
||||||
|
|
||||||
|
|
||||||
|
def build_info(request):
|
||||||
|
return {'BUILD_TIME': getattr(settings, 'BUILD_TIME', '')}
|
||||||
|
|
@ -60,6 +60,7 @@ TEMPLATES = [
|
||||||
'django.template.context_processors.request',
|
'django.template.context_processors.request',
|
||||||
'django.contrib.auth.context_processors.auth',
|
'django.contrib.auth.context_processors.auth',
|
||||||
'django.contrib.messages.context_processors.messages',
|
'django.contrib.messages.context_processors.messages',
|
||||||
|
'diora.context_processors.build_info',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -113,3 +114,5 @@ LASTFM_API_SECRET = os.environ.get('LASTFM_API_SECRET', '')
|
||||||
# Amazon affiliate
|
# Amazon affiliate
|
||||||
AMAZON_AFFILIATE_TAG = os.environ.get('AMAZON_AFFILIATE_TAG', 'diora-20')
|
AMAZON_AFFILIATE_TAG = os.environ.get('AMAZON_AFFILIATE_TAG', 'diora-20')
|
||||||
AMAZON_AFFILIATE_ENABLED = os.environ.get('AMAZON_AFFILIATE_ENABLED', 'True') == 'True'
|
AMAZON_AFFILIATE_ENABLED = os.environ.get('AMAZON_AFFILIATE_ENABLED', 'True') == 'True'
|
||||||
|
|
||||||
|
BUILD_TIME = os.environ.get('BUILD_TIME', '')
|
||||||
|
|
|
||||||
|
|
@ -1587,3 +1587,13 @@ mark.reader-search-match.active { background:rgba(230,57,70,.7); }
|
||||||
/* Toast */
|
/* Toast */
|
||||||
.reader-toast { position:fixed; bottom:calc(var(--bar-h) + 16px); left:50%; transform:translateX(-50%); background:var(--fg); color:var(--bg); padding:6px 14px; border-radius:var(--radius); font-size:13px; z-index:600; animation:toast-fade 2s ease forwards; pointer-events:none; }
|
.reader-toast { position:fixed; bottom:calc(var(--bar-h) + 16px); left:50%; transform:translateX(-50%); background:var(--fg); color:var(--bg); padding:6px 14px; border-radius:var(--radius); font-size:13px; z-index:600; animation:toast-fade 2s ease forwards; pointer-events:none; }
|
||||||
@keyframes toast-fade { 0%,70%{opacity:1} 100%{opacity:0} }
|
@keyframes toast-fade { 0%,70%{opacity:1} 100%{opacity:0} }
|
||||||
|
|
||||||
|
.build-time {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 4px;
|
||||||
|
right: 6px;
|
||||||
|
font-size: 0.65rem;
|
||||||
|
color: #444;
|
||||||
|
pointer-events: none;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,7 @@
|
||||||
{% block content %}{% endblock %}
|
{% block content %}{% endblock %}
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
{% if BUILD_TIME %}<span class="build-time">{{ BUILD_TIME|slice:":16"|cut:"T" }}</span>{% endif %}
|
||||||
<script src="/static/js/jszip.min.js"></script>
|
<script src="/static/js/jszip.min.js"></script>
|
||||||
<script src="/static/js/pdf.min.js"></script>
|
<script src="/static/js/pdf.min.js"></script>
|
||||||
{% block extra_js %}{% endblock %}
|
{% block extra_js %}{% endblock %}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue