working on timetracking module
This commit is contained in:
@@ -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));
|
||||
|
||||
@@ -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} />
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -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',
|
||||
|
||||
23
frontend/src/routes/time/Index.svelte
Normal file
23
frontend/src/routes/time/Index.svelte
Normal 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}
|
||||
@@ -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);
|
||||
|
||||
@@ -229,7 +229,7 @@
|
||||
"template": "Vorlage",
|
||||
"theme": "Design",
|
||||
"times": "Zeiterfassung",
|
||||
"timetrack": "Zeiterfassung",
|
||||
"timetracking": "Zeiterfassung",
|
||||
"title_or_desc": "Titel/Beschreibung",
|
||||
"tutorial": "Tutorial",
|
||||
"type": "Dokumententyp",
|
||||
|
||||
Reference in New Issue
Block a user