Commit 2a355e16 authored by Aurélien Campéas's avatar Aurélien Campéas
Browse files

tasks: proper display of the timestamps

parent b96517f18d32
......@@ -2,11 +2,14 @@ from hashlib import md5
from time import sleep
from pkg_resources import iter_entry_points
import tzlocal
from pml import HTML
from sqlhelp import select, insert
from rework.task import Task
TZ = tzlocal.get_localzone()
def latest_table_hash(engine, domain):
q = select(
......@@ -124,17 +127,17 @@ def generate_tasks_table(engine, taskstates):
href='taskerror/{}'.format(row.id))
r.td(row.domain)
r.td(job._propvalue('queued').strftime('%Y-%m-%d %H:%M:%S'))
r.td(job._propvalue('queued').astimezone(TZ).strftime('%Y-%m-%d %H:%M:%S%z'))
started = job._propvalue('started')
if started is None:
r.td('')
else:
r.td(started.strftime('%Y-%m-%d %H:%M:%S'))
r.td(started.astimezone(TZ).strftime('%Y-%m-%d %H:%M:%S%z'))
finished = job._propvalue('finished')
if finished is None:
r.td('')
else:
r.td(finished.strftime('%Y-%m-%d %H:%M:%S'))
r.td(finished.astimezone(TZ).strftime('%Y-%m-%d %H:%M:%S%z'))
# user plus maybe run name
meta = job.metadata
......
......@@ -20,9 +20,9 @@
<span><a title="show the tasks log (if any)" target="_blank" href="tasklogs/<X>">bad_job</a></span><span> <a title="show the error" target="_blank" href="taskerror/<X>">[traceback]</a></span>
</td>
<td>default</td>
<td><X>-<X>-<X> <X>:<X>:<X></td>
<td><X>-<X>-<X> <X>:<X>:<X></td>
<td><X>-<X>-<X> <X>:<X>:<X></td>
<td><X>-<X>-<X> <X>:<X>:<X>+<X></td>
<td><X>-<X>-<X> <X>:<X>:<X>+<X></td>
<td><X>-<X>-<X> <X>:<X>:<X>+<X></td>
<td>Babar</td>
<td>#<X></td>
<td class="failed" title="Traceback (most recent call last):
......@@ -40,9 +40,9 @@ Exception: I am a little crasher.
<th scope="row"><X></th>
<td><span><a title="show the tasks log (if any)" target="_blank" href="tasklogs/<X>">good_job</a></span></td>
<td>default</td>
<td><X>-<X>-<X> <X>:<X>:<X></td>
<td><X>-<X>-<X> <X>:<X>:<X></td>
<td><X>-<X>-<X> <X>:<X>:<X></td>
<td><X>-<X>-<X> <X>:<X>:<X>+<X></td>
<td><X>-<X>-<X> <X>:<X>:<X>+<X></td>
<td><X>-<X>-<X> <X>:<X>:<X>+<X></td>
<td>Babar</td>
<td>#<X></td>
<td class="done">done</td>
......
<br>
<table class="table table-sm table-bordered table-striped table-hover">
<thead class="thead-inverse"><tr><th>#</th><th>service</th><th>domain</th><th>queued</th><th>started</th><th>finished</th><th>user</th><th>worker</th><th>status</th><th>action</th></tr></thead>
<tr><th scope="row"><X></th><td><span><a title="show the tasks log (if any)" target="_blank" href="tasklogs/<X>">justdoit</a></span></td><td>uranus</td><td><X>-<X>-<X> <X>:<X>:<X></td><td><X>-<X>-<X> <X>:<X>:<X></td><td><X>-<X>-<X> <X>:<X>:<X></td><td>Celeste</td><td>#<X></td><td class="done">done</td><td><button type="button" class="btn btn-warning btn-sm" onclick="delete_task(<X>)">delete</button><span> </span><button type="button" class="btn btn-primary btn-sm" onclick="relaunch_task(<X>)">relaunch</button><span> </span><button type="button" class="btn btn-info btn-sm" onclick="download_input(<X>, &quot;xml&quot;)">input</button><span> </span><button type="button" class="btn btn-success btn-sm" onclick="download_results(<X>)">results</button></td></tr>
<tr><th scope="row"><X></th><td><span><a title="show the tasks log (if any)" target="_blank" href="tasklogs/<X>">justdoit</a></span></td><td>uranus</td><td><X>-<X>-<X> <X>:<X>:<X>+<X></td><td><X>-<X>-<X> <X>:<X>:<X>+<X></td><td><X>-<X>-<X> <X>:<X>:<X>+<X></td><td>Celeste</td><td>#<X></td><td class="done">done</td><td><button type="button" class="btn btn-warning btn-sm" onclick="delete_task(<X>)">delete</button><span> </span><button type="button" class="btn btn-primary btn-sm" onclick="relaunch_task(<X>)">relaunch</button><span> </span><button type="button" class="btn btn-info btn-sm" onclick="download_input(<X>, &quot;xml&quot;)">input</button><span> </span><button type="button" class="btn btn-success btn-sm" onclick="download_results(<X>)">results</button></td></tr>
</table>
\ No newline at end of file
<br>
<table class="table table-sm table-bordered table-striped table-hover">
<thead class="thead-inverse"><tr><th>#</th><th>service</th><th>domain</th><th>queued</th><th>started</th><th>finished</th><th>user</th><th>worker</th><th>status</th><th>action</th></tr></thead>
<tr><th scope="row"><X></th><td><span><a title="show the tasks log (if any)" target="_blank" href="tasklogs/<X>">good_job</a></span></td><td>default</td><td><X>-<X>-<X> <X>:<X>:<X></td><td><X>-<X>-<X> <X>:<X>:<X></td><td><X>-<X>-<X> <X>:<X>:<X></td><td>Babar</td><td>#<X></td><td class="done">done</td><td><button type="button" class="btn btn-warning btn-sm" onclick="delete_task(<X>)">delete</button><span> </span><button type="button" class="btn btn-primary btn-sm" onclick="relaunch_task(<X>)">relaunch</button><span> </span><button type="button" class="btn btn-info btn-sm" onclick="download_input(<X>, &quot;xml&quot;)">input</button><span> </span><button type="button" class="btn btn-success btn-sm" onclick="download_results(<X>)">results</button></td></tr>
<tr><th scope="row"><X></th><td><span><a title="show the tasks log (if any)" target="_blank" href="tasklogs/<X>">good_job</a></span></td><td>default</td><td><X>-<X>-<X> <X>:<X>:<X>+<X></td><td><X>-<X>-<X> <X>:<X>:<X>+<X></td><td><X>-<X>-<X> <X>:<X>:<X>+<X></td><td>Babar</td><td>#<X></td><td class="done">done</td><td><button type="button" class="btn btn-warning btn-sm" onclick="delete_task(<X>)">delete</button><span> </span><button type="button" class="btn btn-primary btn-sm" onclick="relaunch_task(<X>)">relaunch</button><span> </span><button type="button" class="btn btn-info btn-sm" onclick="download_input(<X>, &quot;xml&quot;)">input</button><span> </span><button type="button" class="btn btn-success btn-sm" onclick="download_results(<X>)">results</button></td></tr>
</table>
\ 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