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

@@ -79,7 +79,7 @@ public class Application {
new ProjectModule(registry, config).bindPath("/api/project").on(server);
new ProjectLegacy(registry,config).bindPath("/legacy/project").on(server);
new TaskModule(registry, config).bindPath("/api/task").on(server);
new TimeModule(registry, config).bindPath("/api/times").on(server);
new TimeModule(registry, config).bindPath("/api/time").on(server);
new WebHandler().bindPath("/").on(server);
server.setExecutor(Executors.newFixedThreadPool(threads));

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}

View File

@@ -45,6 +45,11 @@ public class TimeModule extends BaseHandler implements TimeService {
this.registry = registry.add(this);
}
@Override
public boolean doGet(Path path, HttpExchange ex) throws IOException {
return super.doGet(path, ex);
}
@Override
public boolean doPost(Path path, HttpExchange ex) throws IOException {
addCors(ex);

View File

@@ -229,7 +229,7 @@
"template": "Vorlage",
"theme": "Design",
"times": "Zeiterfassung",
"timetrack": "Zeiterfassung",
"timetracking": "Zeiterfassung",
"title_or_desc": "Titel/Beschreibung",
"tutorial": "Tutorial",
"type": "Dokumententyp",