#88 leere Liste keine Weiterleitung mehr
This commit is contained in:
74
package-lock.json
generated
74
package-lock.json
generated
@@ -13,6 +13,7 @@
|
|||||||
"@tailwindcss/forms": "^0.5.10",
|
"@tailwindcss/forms": "^0.5.10",
|
||||||
"autoprefixer": "^10.4.21",
|
"autoprefixer": "^10.4.21",
|
||||||
"better-sqlite3": "^12.2.0",
|
"better-sqlite3": "^12.2.0",
|
||||||
|
"fix": "^0.0.6",
|
||||||
"jsonwebtoken": "^9.0.2",
|
"jsonwebtoken": "^9.0.2",
|
||||||
"jssha": "^3.3.1",
|
"jssha": "^3.3.1",
|
||||||
"minio": "^8.0.5",
|
"minio": "^8.0.5",
|
||||||
@@ -1479,6 +1480,12 @@
|
|||||||
"win32"
|
"win32"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"node_modules/@standard-schema/spec": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.0.0.tgz",
|
||||||
|
"integrity": "sha512-m2bOd0f2RT9k8QJx1JN85cZYyH1RqFBdlwtkSlf4tBDYLCiiZnv1fIIwacK6cqwXavOydf0NPToMQgpKq+dVlA==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/@sveltejs/acorn-typescript": {
|
"node_modules/@sveltejs/acorn-typescript": {
|
||||||
"version": "1.0.5",
|
"version": "1.0.5",
|
||||||
"resolved": "https://registry.npmjs.org/@sveltejs/acorn-typescript/-/acorn-typescript-1.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/@sveltejs/acorn-typescript/-/acorn-typescript-1.0.5.tgz",
|
||||||
@@ -1502,9 +1509,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@sveltejs/adapter-node": {
|
"node_modules/@sveltejs/adapter-node": {
|
||||||
"version": "5.2.13",
|
"version": "5.3.1",
|
||||||
"resolved": "https://registry.npmjs.org/@sveltejs/adapter-node/-/adapter-node-5.2.13.tgz",
|
"resolved": "https://registry.npmjs.org/@sveltejs/adapter-node/-/adapter-node-5.3.1.tgz",
|
||||||
"integrity": "sha512-yS2TVFmIrxjGhYaV5/iIUrJ3mJl6zjaYn0lBD70vTLnYvJeqf3cjvLXeXCUCuYinhSBoyF4DpfGla49BnIy7sQ==",
|
"integrity": "sha512-PSoGfa9atkmuixe7jvuS2tsUohVZF20So87ASzfMRGTTNqEd8s48KAodlv3CzHwq9XO/BM8KsQLpqqsr/6dmuA==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@rollup/plugin-commonjs": "^28.0.1",
|
"@rollup/plugin-commonjs": "^28.0.1",
|
||||||
@@ -1517,16 +1524,17 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@sveltejs/kit": {
|
"node_modules/@sveltejs/kit": {
|
||||||
"version": "2.26.0",
|
"version": "2.37.0",
|
||||||
"resolved": "https://registry.npmjs.org/@sveltejs/kit/-/kit-2.26.0.tgz",
|
"resolved": "https://registry.npmjs.org/@sveltejs/kit/-/kit-2.37.0.tgz",
|
||||||
"integrity": "sha512-TUxMYoK6Yim4uRIW0L7TXtlEtyLchy90PmInI7d1lPAPMchkBEvN3nVMkn5iTMUobxdLE5nR/YEU/4aYqezMuQ==",
|
"integrity": "sha512-xgKtpjQ6Ry4mdShd01ht5AODUsW7+K1iValPDq7QX8zI1hWOKREH9GjG8SRCN5tC4K7UXmMhuQam7gbLByVcnw==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@standard-schema/spec": "^1.0.0",
|
||||||
"@sveltejs/acorn-typescript": "^1.0.5",
|
"@sveltejs/acorn-typescript": "^1.0.5",
|
||||||
"@types/cookie": "^0.6.0",
|
"@types/cookie": "^0.6.0",
|
||||||
"acorn": "^8.14.1",
|
"acorn": "^8.14.1",
|
||||||
"cookie": "^0.6.0",
|
"cookie": "^0.6.0",
|
||||||
"devalue": "^5.1.0",
|
"devalue": "^5.3.2",
|
||||||
"esm-env": "^1.2.2",
|
"esm-env": "^1.2.2",
|
||||||
"kleur": "^4.1.5",
|
"kleur": "^4.1.5",
|
||||||
"magic-string": "^0.30.5",
|
"magic-string": "^0.30.5",
|
||||||
@@ -1542,9 +1550,15 @@
|
|||||||
"node": ">=18.13"
|
"node": ">=18.13"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
|
"@opentelemetry/api": "^1.0.0",
|
||||||
"@sveltejs/vite-plugin-svelte": "^3.0.0 || ^4.0.0-next.1 || ^5.0.0 || ^6.0.0-next.0",
|
"@sveltejs/vite-plugin-svelte": "^3.0.0 || ^4.0.0-next.1 || ^5.0.0 || ^6.0.0-next.0",
|
||||||
"svelte": "^4.0.0 || ^5.0.0-next.0",
|
"svelte": "^4.0.0 || ^5.0.0-next.0",
|
||||||
"vite": "^5.0.3 || ^6.0.0 || ^7.0.0-beta.0"
|
"vite": "^5.0.3 || ^6.0.0 || ^7.0.0-beta.0"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"@opentelemetry/api": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@sveltejs/vite-plugin-svelte": {
|
"node_modules/@sveltejs/vite-plugin-svelte": {
|
||||||
@@ -3116,9 +3130,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/devalue": {
|
"node_modules/devalue": {
|
||||||
"version": "5.1.1",
|
"version": "5.3.2",
|
||||||
"resolved": "https://registry.npmjs.org/devalue/-/devalue-5.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/devalue/-/devalue-5.3.2.tgz",
|
||||||
"integrity": "sha512-maua5KUiapvEwiEAe+XnlZ3Rh0GD+qI1J/nb9vrJc3muPXvcF/8gXYTWF76+5DAqHyDUtOIImEuo0YKE9mshVw==",
|
"integrity": "sha512-UDsjUbpQn9kvm68slnrs+mfxwFkIflOhkanmyabZ8zOYk8SMEIbJ3TK+88g70hSIeytu4y18f0z/hYHMTrXIWw==",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/didyoumean": {
|
"node_modules/didyoumean": {
|
||||||
@@ -3745,6 +3759,19 @@
|
|||||||
"url": "https://github.com/sponsors/sindresorhus"
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/fix": {
|
||||||
|
"version": "0.0.6",
|
||||||
|
"resolved": "https://registry.npmjs.org/fix/-/fix-0.0.6.tgz",
|
||||||
|
"integrity": "sha512-UQ+8m0GnIakgpY+92a9y+pYoX3Y6eaW7WNTkPolQ7r58Fjzq7NhyRLMrZ6J6U1u4y7H7APugjRmZ+i6CAn4+Dg==",
|
||||||
|
"dependencies": {
|
||||||
|
"pipe": "0.0.2",
|
||||||
|
"underscore": "1.1.6",
|
||||||
|
"underscore.string": "1.1.4"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.4.8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/flat-cache": {
|
"node_modules/flat-cache": {
|
||||||
"version": "4.0.1",
|
"version": "4.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz",
|
||||||
@@ -5602,6 +5629,14 @@
|
|||||||
"node": ">=0.10.0"
|
"node": ">=0.10.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/pipe": {
|
||||||
|
"version": "0.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/pipe/-/pipe-0.0.2.tgz",
|
||||||
|
"integrity": "sha512-67s0/X7rv2PX1sl64FQqC0qQuSpd1tv8Wh6c+U1lprj6Q7NxDYulCxZTbVbDvc/HSpZLYh7Oo821xReXSCZikQ==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.4.8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/pirates": {
|
"node_modules/pirates": {
|
||||||
"version": "4.0.7",
|
"version": "4.0.7",
|
||||||
"resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.7.tgz",
|
"resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.7.tgz",
|
||||||
@@ -7407,6 +7442,25 @@
|
|||||||
"typescript": ">=4.8.4 <5.9.0"
|
"typescript": ">=4.8.4 <5.9.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/underscore": {
|
||||||
|
"version": "1.1.6",
|
||||||
|
"resolved": "https://registry.npmjs.org/underscore/-/underscore-1.1.6.tgz",
|
||||||
|
"integrity": "sha512-aqSzrO92Cjmeo8G7F49+ZHWBo3IJpjpsUZZaqfOHJGN61flbpLxQw/sP91p4kf/2+nkFrG6AG2WHlJh6RCf+/g==",
|
||||||
|
"engines": {
|
||||||
|
"node": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/underscore.string": {
|
||||||
|
"version": "1.1.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-1.1.4.tgz",
|
||||||
|
"integrity": "sha512-WsF8NWzIbTvxUaSOpSLq+AiO0tzweXdWQZ4w9Op8S/1BT9Fh7hCS7bfrF17vZu9kJg3pcqO+8WXfQSr1ah0f2g==",
|
||||||
|
"dependencies": {
|
||||||
|
"underscore": "1.1.6"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/undici-types": {
|
"node_modules/undici-types": {
|
||||||
"version": "7.8.0",
|
"version": "7.8.0",
|
||||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.8.0.tgz",
|
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.8.0.tgz",
|
||||||
|
|||||||
@@ -48,6 +48,7 @@
|
|||||||
"@tailwindcss/forms": "^0.5.10",
|
"@tailwindcss/forms": "^0.5.10",
|
||||||
"autoprefixer": "^10.4.21",
|
"autoprefixer": "^10.4.21",
|
||||||
"better-sqlite3": "^12.2.0",
|
"better-sqlite3": "^12.2.0",
|
||||||
|
"fix": "^0.0.6",
|
||||||
"jsonwebtoken": "^9.0.2",
|
"jsonwebtoken": "^9.0.2",
|
||||||
"jssha": "^3.3.1",
|
"jssha": "^3.3.1",
|
||||||
"minio": "^8.0.5",
|
"minio": "^8.0.5",
|
||||||
|
|||||||
Binary file not shown.
@@ -1,11 +1,8 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import AddProcess from '$lib/icons/Add-Process.svelte';
|
import AddProcess from '$lib/icons/Add-Process.svelte';
|
||||||
import FileRect from '$lib/icons/File-rect.svelte';
|
|
||||||
import ListIcon from '$lib/icons/List-icon.svelte';
|
import ListIcon from '$lib/icons/List-icon.svelte';
|
||||||
|
|
||||||
|
|
||||||
export let data;
|
export let data;
|
||||||
export let outline = true;
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
@@ -20,7 +17,7 @@
|
|||||||
<ListIcon class=" group-hover:text-indigo-600" />
|
<ListIcon class=" group-hover:text-indigo-600" />
|
||||||
</div>
|
</div>
|
||||||
<a href="/list" class="mt-6 block font-semibold text-gray-900">
|
<a href="/list" class="mt-6 block font-semibold text-gray-900">
|
||||||
Liste
|
Vorgänge
|
||||||
<span class="absolute inset-0"></span>
|
<span class="absolute inset-0"></span>
|
||||||
</a>
|
</a>
|
||||||
<p class="mt-1 text-gray-600">
|
<p class="mt-1 text-gray-600">
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
import ModalContent from '$lib/components/Modal/ModalContent.svelte';
|
import ModalContent from '$lib/components/Modal/ModalContent.svelte';
|
||||||
import ModalFooter from '$lib/components/Modal/ModalFooter.svelte';
|
import ModalFooter from '$lib/components/Modal/ModalFooter.svelte';
|
||||||
import Cube from '$lib/icons/Cube.svelte';
|
import Cube from '$lib/icons/Cube.svelte';
|
||||||
import { invalidate, invalidateAll } from '$app/navigation';
|
import { invalidateAll } from '$app/navigation';
|
||||||
import NameItemEditor from '$lib/components/NameItemEditor.svelte';
|
import NameItemEditor from '$lib/components/NameItemEditor.svelte';
|
||||||
|
|
||||||
//Seite für die Tatort-Liste
|
//Seite für die Tatort-Liste
|
||||||
@@ -35,9 +35,9 @@
|
|||||||
let open = $state(false);
|
let open = $state(false);
|
||||||
let inProgress = $state(false);
|
let inProgress = $state(false);
|
||||||
let isError = $state(false);
|
let isError = $state(false);
|
||||||
|
|
||||||
//Variable um nur admin UI anzuzeigen
|
//Variable um nur admin UI anzuzeigen
|
||||||
let admin = data?.user?.admin;
|
let admin = data?.user?.admin;
|
||||||
|
let emptyList = $derived(!data.crimesList || data.crimesList.length === 0);
|
||||||
|
|
||||||
async function handleSave(newName: string, oldName: string) {
|
async function handleSave(newName: string, oldName: string) {
|
||||||
open = true;
|
open = true;
|
||||||
@@ -60,6 +60,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (!res.ok) {
|
if (!res.ok) {
|
||||||
|
//?? welches Ergebnis bekomme ich bei res, wie ändern, damit es wieder passt.
|
||||||
const msg = await res.text();
|
const msg = await res.text();
|
||||||
console.error('❌ Fehler beim Umbenennen:', msg);
|
console.error('❌ Fehler beim Umbenennen:', msg);
|
||||||
isError = true;
|
isError = true;
|
||||||
@@ -147,56 +148,62 @@
|
|||||||
|
|
||||||
{#if admin}
|
{#if admin}
|
||||||
Zugangs-PIN: {vorgangPIN}
|
Zugangs-PIN: {vorgangPIN}
|
||||||
<a class="pt-2 pb-6" href={constructMailToLink()}><Button>Share Link</Button></a>
|
<a class="pt-2 pb-6" href={constructMailToLink()}
|
||||||
|
><Button disabled={emptyList}>Share Link</Button></a
|
||||||
|
>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
<div class="mx-auto flex justify-center max-w-7xl h-full">
|
<div class="mx-auto flex justify-center max-w-7xl h-full">
|
||||||
<ul class="divide-y divide-gray-100">
|
{#if emptyList}
|
||||||
{#each data.crimesList as item, crimeListItemIndex}
|
<p>Keine Einträge vorhanden.</p>
|
||||||
<li>
|
{:else}
|
||||||
<div class=" flex gap-x-4">
|
<ul class="divide-y divide-gray-100">
|
||||||
<a
|
{#each data.crimesList as item, crimeListItemIndex}
|
||||||
href="/view/{vorgangToken}/{item.name}?pin={vorgangPIN}"
|
<li>
|
||||||
class=" flex justify-between gap-x-6 py-5"
|
<div class=" flex gap-x-4">
|
||||||
aria-label="/view/{vorgangToken}/{item.name}?pin={vorgangPIN}"
|
<a
|
||||||
title={item.name}
|
href="/view/{vorgangToken}/{item.name}?pin={vorgangPIN}"
|
||||||
>
|
class=" flex justify-between gap-x-6 py-5"
|
||||||
<Cube />
|
aria-label="/view/{vorgangToken}/{item.name}?pin={vorgangPIN}"
|
||||||
</a>
|
title={item.name}
|
||||||
<div class="min-w-0 flex-auto">
|
>
|
||||||
{#if admin}
|
<Cube />
|
||||||
<NameItemEditor
|
</a>
|
||||||
list={data.crimesList}
|
<div class="min-w-0 flex-auto">
|
||||||
editedName={data.crimeNames[crimeListItemIndex]}
|
{#if admin}
|
||||||
currentName={item.name}
|
<NameItemEditor
|
||||||
onSave={handleSave}
|
list={data.crimesList}
|
||||||
onDelete={handleDelete}
|
editedName={data.crimeNames[crimeListItemIndex]}
|
||||||
></NameItemEditor>
|
currentName={item.name}
|
||||||
{:else}
|
onSave={handleSave}
|
||||||
<span class="text-sm font-semibold leading-6 text-gray-900 inline-block min-w-1"
|
onDelete={handleDelete}
|
||||||
>{item.name}</span
|
></NameItemEditor>
|
||||||
>
|
{:else}
|
||||||
{/if}
|
<span class="text-sm font-semibold leading-6 text-gray-900 inline-block min-w-1"
|
||||||
{#if item.size}
|
>{item.name}</span
|
||||||
<p class="mt-1 truncate text-xs leading-5 text-gray-500">
|
>
|
||||||
{shortenFileSize(item.size)}
|
{/if}
|
||||||
|
{#if item.size}
|
||||||
|
<p class="mt-1 truncate text-xs leading-5 text-gray-500">
|
||||||
|
{shortenFileSize(item.size)}
|
||||||
|
</p>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="hidden sm:flex sm:flex-col sm:items-end">
|
||||||
|
<p class="text-sm leading-6 text-gray-900">3D Tatort</p>
|
||||||
|
{#if item.lastModified}
|
||||||
|
<p class="mt-1 text-xs leading-5 text-gray-500">
|
||||||
|
Zuletzt geändert <time datetime="2023-01-23T13:23Z"
|
||||||
|
>{timeElapsed(new Date(item.lastModified))}</time
|
||||||
|
>
|
||||||
</p>
|
</p>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</li>
|
||||||
<div class="hidden sm:flex sm:flex-col sm:items-end">
|
{/each}
|
||||||
<p class="text-sm leading-6 text-gray-900">3D Tatort</p>
|
</ul>
|
||||||
{#if item.lastModified}
|
{/if}
|
||||||
<p class="mt-1 text-xs leading-5 text-gray-500">
|
|
||||||
Zuletzt geändert <time datetime="2023-01-23T13:23Z"
|
|
||||||
>{timeElapsed(new Date(item.lastModified))}</time
|
|
||||||
>
|
|
||||||
</p>
|
|
||||||
{/if}
|
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
{/each}
|
|
||||||
</ul>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Modal {open}
|
<Modal {open}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { redirect } from '@sveltejs/kit';
|
|
||||||
|
|
||||||
export async function load({fetch, params, url}){
|
export async function load({fetch, params, url}){
|
||||||
const vorgangResponse = await fetch(`/api/list`);
|
const vorgangResponse = await fetch(`/api/list`);
|
||||||
@@ -14,9 +13,7 @@ export async function load({fetch, params, url}){
|
|||||||
//Variabeln für NameItemEditor
|
//Variabeln für NameItemEditor
|
||||||
const crimeNames: string[] = crimesList.map((l) => l.name);
|
const crimeNames: string[] = crimesList.map((l) => l.name);
|
||||||
|
|
||||||
if (crimesList.length === 0) {
|
|
||||||
throw redirect(302, '/upload'); // weiterleiten auf die hinzufügen seite
|
|
||||||
}
|
|
||||||
return {
|
return {
|
||||||
vorgang,
|
vorgang,
|
||||||
vorgangList,
|
vorgangList,
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { BUCKET, client } from '$lib/minio';
|
import { BUCKET, client } from '$lib/minio';
|
||||||
import { json } from '@sveltejs/kit';
|
import { json } from '@sveltejs/kit';
|
||||||
import { getVorgangByName } from '$lib/server/vorgangService';
|
|
||||||
|
|
||||||
export async function GET() {
|
export async function GET() {
|
||||||
const stream = client.listObjectsV2(BUCKET, '', true);
|
const stream = client.listObjectsV2(BUCKET, '', true);
|
||||||
|
|||||||
Reference in New Issue
Block a user