task-card.html
19 lines1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{{if .}}
<div class="space-y-1">
{{range $task := .}}
<div class="flex items-center gap-2.5 rounded-lg px-3 py-2 bg-slate-50/80">
{{if eq $task.Status "running"}}
<span class="loading loading-spinner loading-xs text-indigo-500"></span>
{{else if eq $task.Status "completed"}}
<svg xmlns="http://www.w3.org/2000/svg" class="w-3.5 h-3.5 text-emerald-500 shrink-0" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7" /></svg>
{{else if eq $task.Status "failed"}}
<svg xmlns="http://www.w3.org/2000/svg" class="w-3.5 h-3.5 text-red-500 shrink-0" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" /></svg>
{{end}}
<span class="text-[12px] text-slate-600 truncate flex-1">{{$task.Name}}</span>
<span class="text-[10px] text-slate-300 font-mono shrink-0">{{$task.Ago}}</span>
</div>
{{end}}
</div>
{{else}}
<p class="text-[12px] text-slate-400 py-0.5">No active tasks</p>
{{end}}