webcmd: cosmetic fixes to the taskinfo page

This commit is contained in:
mappu 2017-03-25 16:06:13 +13:00
parent 68c25fa139
commit 8f0782b829
1 changed files with 10 additions and 5 deletions

View File

@ -24,10 +24,8 @@ func (this *App) Serve_TaskInfo(w http.ResponseWriter, task_ref string) {
fmt.Fprintf(w, `
<ul>
<li>Type: %s</li>
<li>Start time: %s</li>
`,
"???",
hesc(time.Unix(taskinfo.started, 0).Format(time.RFC822Z)),
)
@ -39,6 +37,8 @@ func (this *App) Serve_TaskInfo(w http.ResponseWriter, task_ref string) {
hesc(time.Unix(taskinfo.stopped, 0).Format(time.RFC822Z)),
taskinfo.exitCode,
)
} else {
fmt.Fprint(w, `<li>Currently running</li>`)
}
fmt.Fprint(w, `
@ -69,13 +69,18 @@ func (this *App) Serve_TaskInfo(w http.ResponseWriter, task_ref string) {
fmt.Fprintf(w, `
</tbody>
</table>
`)
if !taskinfo.Finished() {
fmt.Fprintf(w, `
<form method="POST" action="/x-abandon-task">
<input type="hidden" name="task_ref" value="%s">
<input type="submit" value="Cancel &raquo;">
</form>
`,
hesc(task_ref),
)
`,
hesc(task_ref),
)
}
this.ServePartial_Footer(w)
}