Commit 859208f6 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Update to display the last log for cronjob updating citations table.

parent f7dab14f
""" Controllers for application
"""
from pathlib import Path
PATH_CITATIONS_LOG = "static/cron/citations"
def cronjobs():
"""Display last logs for cron jobs.
"""
# citations
log = f"{request.application}.log"
plog = Path(request.folder, PATH_CITATIONS_LOG, log)
if plog.exists():
data = plog.read_text()
else:
data = "no log for citation cronjob"
return dict(lines=data.split("\n"))
\ No newline at end of file
......@@ -358,6 +358,7 @@
'Key V': 'Clé V',
'Keys already exist!': 'La clé existe!',
'Last name': 'Last name',
'Last update citations table': 'Dernière mise à jour de la table des citations',
'Level': 'Niveau',
'Level 1': 'Niveau 1',
'Level 2': 'Niveau 2',
......@@ -386,6 +387,7 @@
'Load in the database': 'Chargé dans la base de données',
'Loading failed': 'Echec du chargement',
'Loading...': 'Chargement en cours...',
'log cron jobs': 'journaux des taches planifiées',
'Log In': 'Log In',
'Logged in': 'Logged in',
'Logged out': 'Déconnexion',
......@@ -643,7 +645,10 @@
'Scan': 'Scan',
'Scan %s': 'Scan %s',
'Scan between %s and %s': 'Scan between %s and %s',
'Scan duration': 'Durée du balayage',
'Scan end': 'Fin du balayage',
'Scan from %s to %s': 'Scan de %s à %s',
'Scan start': 'Début du balayage',
'schema': 'schema',
'Section': 'Section',
'Sections': 'Sections',
......
......@@ -111,6 +111,14 @@ class ViewportUi(object):
T("relation user / groups"),
to_grid("auth_membership"))
loader = dict(
autoLoad=True,
renderer="html",
url=URL("application", "cronjobs"))
cronjob_panel = Panel(loader=loader, autoScroll=True)
add_child(T("log cron jobs"), cronjob_panel)
return node
@staticmethod
......
{{
mytable = "margin-left: 6%;"
mytd = "text-align: right;"
table = []
for line in lines:
idx = line.find(":")
if line.find("Application") == -1 and idx != -1:
item = line[:idx].replace("\t", "").strip()
table.append( [T(item), TD(line[idx+1:], _style=mytd)])
pass
pass
= H2(T("Last update citations table"), _class="my-h2")
= TABLE(*[TR(*row, _class="dbui-tr") for row in table], _style=mytable)
}}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment