Show Task's "last touched" in the web interface

This commit is contained in:
Sybren A. Stüvel 2022-06-09 11:59:43 +02:00
parent 1c9846bb8f
commit 92d6693871
2 changed files with 7 additions and 0 deletions

View File

@ -265,6 +265,10 @@ func taskDBtoAPI(dbTask *persistence.Task) api.Task {
} }
} }
if !dbTask.LastTouchedAt.IsZero() {
apiTask.LastTouched = &dbTask.LastTouchedAt
}
for i := range dbTask.Commands { for i := range dbTask.Commands {
apiTask.Commands[i] = commandDBtoAPI(dbTask.Commands[i]) apiTask.Commands[i] = commandDBtoAPI(dbTask.Commands[i])
} }

View File

@ -26,6 +26,9 @@
<dt class="field-updated">Updated</dt> <dt class="field-updated">Updated</dt>
<dd>{{ datetime.relativeTime(taskData.updated) }}</dd> <dd>{{ datetime.relativeTime(taskData.updated) }}</dd>
<dt class="field-last-touched">Last Touched by Worker</dt>
<dd>{{ datetime.relativeTime(taskData.last_touched) }}</dd>
</dl> </dl>
<h3 class="sub-title">Commands</h3> <h3 class="sub-title">Commands</h3>