OpenSource Projekt-Management-Software
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

49 lines
1.0 KiB

<script>
import { onMount } from 'svelte';
import { api } from '../../urls.svelte.js';
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();
}
}
onMount(loadTimes);
</script>
<h1>{t('timetracking')}</h1>
{#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}&nbsp;
{/each}
</td>
</tr>
{/each}
</tbody>
</table>
{/if}