package web import "git.jmbit.de/jmb/scanfile/server/web/templui/components/table" import "git.jmbit.de/jmb/scanfile/server/internal/sqlc" templ Admin(jobs []sqlc.ProcessingJob) { @Base("Admin") { @ProcessingJobs(jobs) } } templ ProcessingJobs(jobs []sqlc.ProcessingJob) { @table.Table() { @table.Caption() { Processing jobs } @table.Header() { @table.Row() { @table.Head() { ID } @table.Head() { File ID } @table.Head() { Created } @table.Head() { Started } @table.Head() { Completed } @table.Head() { Type } @table.Head() { Status } @table.Head() { Error } } } @table.Body() { for _, job := range jobs { @table.Row() { @table.Cell() { {job.ID} } @table.Cell() { {job.FileID.String()} } @table.Cell() { {job.Created.Time.String()} } @table.Cell() { if job.Started.Valid { {job.Started.Time.String()} } else { - } } @table.Cell() { if job.Completed.Valid { {job.Completed.Time.String()} } else { - } } @table.Cell() { {job.JobType.String} } @table.Cell() { {job.Status.String} } @table.Cell() { {job.Error.String} } } } } } }