working on timetracking module

This commit is contained in:
2025-08-15 14:35:56 +02:00
parent 84075b4634
commit 5a4028d774
7 changed files with 34 additions and 3 deletions

View File

@@ -27,6 +27,7 @@
import SendDoc from "./routes/document/Send.svelte";
import TagUses from "./routes/tags/TagUses.svelte";
import TaskList from "./routes/task/Index.svelte";
import Times from "./routes/time/Index.svelte";
import User from "./routes/user/User.svelte";
import ViewDoc from "./routes/document/View.svelte";
import ViewPrj from "./routes/project/View.svelte";
@@ -74,6 +75,7 @@
<Route path="/task/:parent_task_id/add_subtask" component={AddTask} />
<Route path="/task/:id/edit" component={ViewTask} />
<Route path="/task/:id/view" component={ViewTask} />
<Route path="/time" component={Times} />
<Route path="/user" component={User} />
<Route path="/user/create" component={EditUser} />
<Route path="/user/login" component={User} />

View File

@@ -44,6 +44,7 @@ onMount(fetchModules);
<a href="#" onclick={() => go('/document')}>{t('documents')}</a>
<a href="#" onclick={() => go('/bookmark')}>{t('bookmarks')}</a>
<a href="#" onclick={() => go('/notes')}>{t('notes')}</a>
<a href="#" onclick={() => go('/time')}>{t('timetracking')}</a>
<a href="https://svelte.dev/tutorial/svelte/state" target="_blank">{t('tutorial')}</a>
{#each modules as module,i}
{#if module.name.trim()}<a href={module.url}>{module.name}</a>{/if}

View File

@@ -29,7 +29,7 @@
}
async function loadTimes(projectId){
const url = api('times/list');
const url = api('time/list');
let data = { company_id: company_id, project_id: projectId };
const resp = await fetch(url,{
credentials : 'include',

View File

@@ -0,0 +1,23 @@
<script>
import { onMount } from 'svelte';
import { api } from '../../urls.svelte.js';
import { t } from '../../translations.svelte.js';
let error = $state(null);
async function loadTimes(){
const url = api('time');
const resp = await fetch(url,{credentials:'include'});
if (resp.ok){
} else {
error = await resp.text();
}
}
onMount(loadTimes);
</script>
<h1>{t('timetracking')}</h1>
{#if error}
<span class="error">{error}</span>
{/if}