|
|
|
|
@ -4,11 +4,13 @@
@@ -4,11 +4,13 @@
|
|
|
|
|
import { t } from '../../translations.svelte.js'; |
|
|
|
|
|
|
|
|
|
let error = $state(null); |
|
|
|
|
let times = $state(null); |
|
|
|
|
|
|
|
|
|
async function loadTimes(){ |
|
|
|
|
const url = api('time'); |
|
|
|
|
const resp = await fetch(url,{credentials:'include'}); |
|
|
|
|
if (resp.ok){ |
|
|
|
|
times = await resp.json(); |
|
|
|
|
} else { |
|
|
|
|
error = await resp.text(); |
|
|
|
|
} |
|
|
|
|
@ -21,3 +23,27 @@
@@ -21,3 +23,27 @@
|
|
|
|
|
{#if error} |
|
|
|
|
<span class="error">{error}</span> |
|
|
|
|
{/if} |
|
|
|
|
{#if times} |
|
|
|
|
<table> |
|
|
|
|
<thead> |
|
|
|
|
|
|
|
|
|
</thead> |
|
|
|
|
<tbody> |
|
|
|
|
{#each Object.entries(times) as [tid,time]} |
|
|
|
|
<tr> |
|
|
|
|
<td> |
|
|
|
|
{time.start_time}…{time.end_time} |
|
|
|
|
</td> |
|
|
|
|
<td> |
|
|
|
|
{time.subject} |
|
|
|
|
</td> |
|
|
|
|
<td> |
|
|
|
|
{#each time.task_ids as tid} |
|
|
|
|
{tid} |
|
|
|
|
{/each} |
|
|
|
|
</td> |
|
|
|
|
</tr> |
|
|
|
|
{/each} |
|
|
|
|
</tbody> |
|
|
|
|
</table> |
|
|
|
|
{/if} |