Compare commits
5 Commits
e17fdbc619
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 1d7b47aaa0 | |||
| f49b44cd56 | |||
| 60777feaa3 | |||
| bcc1182dea | |||
| 4a83bb6bee |
@@ -41,11 +41,6 @@ jobs:
|
|||||||
docker push ${{ secrets.REGISTRY_PATH }}/umbrella:${{ gitea.ref_name }}
|
docker push ${{ secrets.REGISTRY_PATH }}/umbrella:${{ gitea.ref_name }}
|
||||||
docker push ${{ secrets.REGISTRY_PATH }}/umbrella:$TAG
|
docker push ${{ secrets.REGISTRY_PATH }}/umbrella:$TAG
|
||||||
|
|
||||||
- name: Restart umbrella.srsoftware.de
|
|
||||||
if: github.ref == 'refs/heads/dev'
|
|
||||||
run: |
|
|
||||||
curl -X POST -H "Authorization: Bearer ${{ secrets.ELDORADO_MAKE_BEARER }}" -d umbrella_25_start https://make.eldorado.srsoftware.de/launch
|
|
||||||
|
|
||||||
Clean-Registry:
|
Clean-Registry:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
|||||||
@@ -90,7 +90,7 @@
|
|||||||
{#if messages.warning}
|
{#if messages.warning}
|
||||||
<span class="warn">{@html messages.warning}</span>
|
<span class="warn">{@html messages.warning}</span>
|
||||||
{/if}
|
{/if}
|
||||||
<Route path="/" component={User} />
|
<Route path="/" component={ProjectList} />
|
||||||
<Route path="/account/:id" component={Account} />
|
<Route path="/account/:id" component={Account} />
|
||||||
<Route path="/accounting" component={Accounts} />
|
<Route path="/accounting" component={Accounts} />
|
||||||
<Route path="/accounting/new" component={NewAccount} />
|
<Route path="/accounting/new" component={NewAccount} />
|
||||||
|
|||||||
@@ -44,9 +44,9 @@
|
|||||||
</span>
|
</span>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
{#each accounts as account (account.id)}
|
{#each accounts.toSorted((a,b) => a.name.localeCompare(b.name)) as account (account.id)}
|
||||||
<li>
|
<li>
|
||||||
<a {onclick} href="/account/{account.id}">{account.name} ({account.id})</a>
|
<a {onclick} href="/account/{account.id}">{account.name}</a>
|
||||||
</li>
|
</li>
|
||||||
{/each}
|
{/each}
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
import { useTinyRouter } from 'svelte-tiny-router';
|
import { useTinyRouter } from 'svelte-tiny-router';
|
||||||
import { api, drop, patch, post } from '../../urls.svelte.js';
|
import { api, drop, get, patch, post } from '../../urls.svelte.js';
|
||||||
import { error, yikes } from '../../warn.svelte';
|
import { error, yikes } from '../../warn.svelte';
|
||||||
import { t } from '../../translations.svelte.js';
|
import { t } from '../../translations.svelte.js';
|
||||||
import { timetrack } from '../../user.svelte.js';
|
import { timetrack } from '../../user.svelte.js';
|
||||||
@@ -41,10 +41,18 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
async function addTime(task_id){
|
async function addTime(task_id){
|
||||||
const url = api(`time/track_task/${task_id}`);
|
let url = api(`time/track_task/${task_id}`);
|
||||||
const resp = await post(url,now()); // create new time or return time with assigned tasks
|
let resp = await post(url,now()); // create new time or return time with assigned tasks
|
||||||
if (resp.ok) {
|
if (resp.ok) {
|
||||||
const track = await resp.json();
|
const track = await resp.json();
|
||||||
|
if (timetrack.running){
|
||||||
|
url = api(`time/${timetrack.running.id}`);
|
||||||
|
resp = await get(url);
|
||||||
|
if (resp.ok){
|
||||||
|
let previous = await resp.json();
|
||||||
|
times[previous.id] = previous;
|
||||||
|
}
|
||||||
|
}
|
||||||
timetrack.running = track;
|
timetrack.running = track;
|
||||||
} else {
|
} else {
|
||||||
error(resp);
|
error(resp);
|
||||||
|
|||||||
@@ -79,8 +79,15 @@ public class TimeModule extends BaseHandler implements TimeService {
|
|||||||
if (user.isEmpty()) return unauthorized(ex);
|
if (user.isEmpty()) return unauthorized(ex);
|
||||||
var head = path.pop();
|
var head = path.pop();
|
||||||
return switch (head) {
|
return switch (head) {
|
||||||
case STARTED -> getStartedTime(user.get(),ex);
|
case STARTED -> getStartedTime(user.get(),ex);
|
||||||
case null, default -> super.doGet(path,ex);
|
case null -> super.doGet(path,ex);
|
||||||
|
default -> {
|
||||||
|
try {
|
||||||
|
yield sendContent(ex,timeDb.load(Long.parseLong(head)));
|
||||||
|
} catch (NumberFormatException ignored) {
|
||||||
|
yield super.doGet(path,ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
} catch (UmbrellaException e){
|
} catch (UmbrellaException e){
|
||||||
return send(ex,e);
|
return send(ex,e);
|
||||||
|
|||||||
Reference in New Issue
Block a user