29 Commits

Author SHA1 Message Date
810b020d7d Merge pull request 'b999_chrome_file_upload' (#47) from b999_chrome_file_upload into development
All checks were successful
InnoHub Processor/tatort/pipeline/head This commit looks good
Reviewed-on: #47
2025-12-16 13:24:37 +01:00
5be89f83fd add .GLD file verification for drag and drop 2025-12-16 13:20:18 +01:00
2a7783004a fix chrome issue: selecting the same file does not work properly 2025-12-16 12:54:28 +01:00
6f9b386c18 Merge pull request 'implement drag and drop feature' (#46) from f120_drag_and_drop into development
All checks were successful
InnoHub Processor/tatort/pipeline/head This commit looks good
Reviewed-on: #46
2025-12-16 09:43:49 +01:00
b4d9824942 implement drag and drop feature 2025-12-16 09:23:22 +01:00
776cc7a1f0 Merge pull request 'fix file upload for Chrome' (#45) from b119_model_upload_chrome into development
All checks were successful
InnoHub Processor/tatort/pipeline/head This commit looks good
Reviewed-on: #45
2025-12-15 12:19:11 +01:00
eaa75833df fix file upload for Chrome 2025-12-15 12:18:00 +01:00
30d457f562 Merge pull request 'sync dev with main' (#44) from main into development
All checks were successful
InnoHub Processor/tatort/pipeline/head This commit looks good
Reviewed-on: #44
2025-12-15 10:43:14 +01:00
titver968
c1dd9092ea config_prod und dev auf s3 minio 2025-12-10 14:37:03 +01:00
79e0b01796 Merge pull request 'development' (#43) from development into main
Reviewed-on: #43
2025-12-10 10:28:32 +01:00
f008cee404 make share-button secondary style for less emphasis
All checks were successful
InnoHub Processor/tatort/pipeline/head This commit looks good
2025-12-10 08:36:43 +01:00
bb91162438 copy link into clipboard and open mail client
All checks were successful
InnoHub Processor/tatort/pipeline/head This commit looks good
2025-12-09 11:37:47 +01:00
c078266449 change config to new minio setup for prod
All checks were successful
InnoHub Processor/tatort/pipeline/head This commit looks good
2025-12-09 10:26:30 +01:00
922b840c9a fix jenkins pipeline: update packages
All checks were successful
InnoHub Processor/tatort/pipeline/head This commit looks good
2025-12-09 10:18:30 +01:00
68823d6ced change config to new minio setup
Some checks failed
InnoHub Processor/tatort/pipeline/head There was a failure building this commit
2025-12-09 10:01:56 +01:00
9bb4d23a2d Merge pull request 'main' (#42) from main into development
Some checks failed
InnoHub Processor/tatort/pipeline/head There was a failure building this commit
Reviewed-on: #42
2025-12-09 09:34:26 +01:00
titver968
e2cd6945f5 Dockerfile.prod 2025-12-02 14:44:35 +01:00
titver968
ba21f797de src/lib/config.ts -> config.json 2025-12-02 14:36:02 +01:00
titver968
646ff668f7 Dockerfile.prod und tailwind.config.cjs 2025-12-02 14:23:12 +01:00
8b6d35b66f remove old configs 2025-11-25 11:44:32 +01:00
e0d6e3cc62 Merge branch 'development' 2025-11-25 11:43:18 +01:00
1158c88d43 fix SonarQube issues: mainly unused imports
All checks were successful
InnoHub Processor/tatort/pipeline/head This commit looks good
2025-11-24 08:41:46 +01:00
e6add823a5 update packages 2025-11-24 08:36:42 +01:00
titver968
2d9acb402d Merge branch 'main' of ssh://gitea.innovation-hub-niedersachsen.de:4422/innohub/tatort 2025-06-25 12:27:00 +02:00
titver968
a71807c63a Dockerfile end config.json for prod and dev 2025-06-25 12:26:18 +02:00
78bf7c7dbc Jenkinsfile gelöscht 2025-06-25 09:29:34 +02:00
aeccb684b4 Jenkinsfile aktualisiert
All checks were successful
InnoHub Processor/tatort/pipeline/head This commit looks good
rename file
2025-06-25 09:11:37 +02:00
425b1ee8fa Jenkins hinzugefügt 2025-06-24 17:20:25 +02:00
6b1a49583e Merge pull request 'refactor-login-page' (#7) from refactor-login-page into main
Reviewed-on: #7
2025-06-18 13:10:25 +02:00
11 changed files with 483 additions and 752 deletions

View File

@@ -1,7 +1,5 @@
# --- Build stage --- # --- Build stage ---
FROM node:22 AS build FROM node:22 AS build
ENV NODE_ENV=production
ENV ORIGIN=https://tatort.innovation-hub-niedersachsen.de
WORKDIR /app WORKDIR /app
COPY package*.json ./ COPY package*.json ./
RUN npm ci RUN npm ci
@@ -11,7 +9,13 @@ RUN npm run build
# --- Production stage --- # --- Production stage ---
FROM node:22-alpine3.20 FROM node:22-alpine3.20
COPY --from=build /app . WORKDIR /app
ENV NODE_ENV=production
ENV ORIGIN=https://tatort.innovation-hub-niedersachsen.de
COPY --from=build /app/build ./build
COPY --from=build /app/package*.json ./
COPY --from=build /app/config.json ./config.json
RUN npm ci --omit=dev
ENV HOST=0.0.0.0 ENV HOST=0.0.0.0
EXPOSE 3000 EXPOSE 3000
CMD ["sh", "-c", "ORIGIN=https://tatort.innovation-hub-niedersachsen.de node build/index.js"] CMD ["node", "build/index.js"]

View File

@@ -1,10 +1,10 @@
{ {
"minio": { "minio": {
"endPoint": "sws3.innovation-hub-niedersachsen.de", "endPoint": "api-s3.innovation-hub-niedersachsen.de",
"port": 443, "port": 443,
"useSSL": true, "useSSL": true,
"accessKey": "wjpKrmaqXra99rX3D61H", "accessKey": "AbCdEfGhIjKlMnOpQrSt",
"secretKey": "fTPi0u0FR6Lv9Y9IKydWv6WM0EA5XrsK008HCt9u" "secretKey": "UvWxYz1234567890AbCdEfGhIjKlMnOpQrStUvWx"
}, },
"jwt": { "jwt": {
"secret": "@S2!q@@wXz$dCQ8JoVsHLpzaJ6JCfB", "secret": "@S2!q@@wXz$dCQ8JoVsHLpzaJ6JCfB",

View File

@@ -1,10 +1,10 @@
{ {
"minio": { "minio": {
"endPoint": "sws3.innovation-hub-niedersachsen.de", "endPoint": "api-s3.innovation-hub-niedersachsen.de",
"port": 443, "port": 443,
"useSSL": true, "useSSL": true,
"accessKey": "wjpKrmaqXra99rX3D61H", "accessKey": "AbCdEfGhIjKlMnOpQrSt",
"secretKey": "fTPi0u0FR6Lv9Y9IKydWv6WM0EA5XrsK008HCt9u" "secretKey": "UvWxYz1234567890AbCdEfGhIjKlMnOpQrStUvWx"
}, },
"jwt": { "jwt": {
"secret": "@S2!q@@wXz$dCQ8JoVsHLpzaJ6JCfB", "secret": "@S2!q@@wXz$dCQ8JoVsHLpzaJ6JCfB",

View File

@@ -1,10 +1,10 @@
{ {
"minio": { "minio": {
"endPoint": "sws3.innovation-hub-niedersachsen.de", "endPoint": "api-s3.innovation-hub-niedersachsen.de",
"port": 443, "port": 443,
"useSSL": true, "useSSL": true,
"accessKey": "wjpKrmaqXra99rX3D61H", "accessKey": "GxKhfnfkNvlDU7qzsz0D",
"secretKey": "fTPi0u0FR6Lv9Y9IKydWv6WM0EA5XrsK008HCt9u" "secretKey": "cqSM5rIRr4MPtqzu2sNKgmB9k2OghPbyxwAWogeM"
}, },
"jwt": { "jwt": {
"secret": "@S2!q@@wXz$dCQ8JoVsHLpzaJ6JCfB", "secret": "@S2!q@@wXz$dCQ8JoVsHLpzaJ6JCfB",

1107
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,3 +1,3 @@
import { readFileSync } from 'fs'; import { readFileSync } from 'fs';
export default JSON.parse(readFileSync('./config_prod.json').toString()); export default JSON.parse(readFileSync('./config.json').toString());

View File

@@ -1,8 +1,6 @@
import { type ServerLoadEvent } from '@sveltejs/kit'; import { type ServerLoadEvent } from '@sveltejs/kit';
import type { PageServerLoad } from '../anmeldung/$types'; import type { PageServerLoad } from '../anmeldung/$types';
import { ROUTE_NAMES } from '..';
export const load: PageServerLoad = (event: ServerLoadEvent) => { export const load: PageServerLoad = (event: ServerLoadEvent) => {
if (event.locals.user) { if (event.locals.user) {
return { return {

View File

@@ -1,10 +1,8 @@
import { Readable } from 'stream'; import { Readable } from 'stream';
import { BUCKET, client } from '$lib/minio'; import { BUCKET, client } from '$lib/minio';
import { fail, error } from '@sveltejs/kit'; import { fail, error } from '@sveltejs/kit';
import { v4 as uuidv4 } from 'uuid';
import { db } from '$lib/server/dbService'; import { getVorgangByName } from '$lib/server/vorgangService';
import { getVorgangByName, vorgangNameExists } from '$lib/server/vorgangService';
const isRequiredFieldValid = (value: unknown) => { const isRequiredFieldValid = (value: unknown) => {
if (value == null) return false; if (value == null) return false;

View File

@@ -1,4 +1,5 @@
<script lang="ts"> <script lang="ts">
import { fade } from 'svelte/transition';
import shortenFileSize from '$lib/helper/shortenFileSize'; import shortenFileSize from '$lib/helper/shortenFileSize';
import timeElapsed from '$lib/helper/timeElapsed'; import timeElapsed from '$lib/helper/timeElapsed';
import { deserialize } from '$app/forms'; import { deserialize } from '$app/forms';
@@ -41,11 +42,15 @@
let formErrors: Record<string, any> | null = $state(null); let formErrors: Record<string, any> | null = $state(null);
let etag: string | null = $state(null); let etag: string | null = $state(null);
let files: FileList | null = $state(null); let files: FileList | null = $state(null);
let fileInput = $state(null);
// Model Variablen für Upload // Model Variablen für Upload
let openUL = $state(false); let openUL = $state(false);
let inProgressUL = $state(form === null); let inProgressUL = $state(form === null);
// Variablen für Copy-Funktion
let copied = $state(false);
async function buttonClick(event: MouseEvent) { async function buttonClick(event: MouseEvent) {
if (!(await validateForm())) { if (!(await validateForm())) {
event.preventDefault(); event.preventDefault();
@@ -98,6 +103,7 @@
openUL = false; openUL = false;
name = ''; name = '';
files = null; files = null;
fileInput.value = "";
await invalidateAll(); await invalidateAll();
crimesList = data.crimesList; crimesList = data.crimesList;
} }
@@ -128,17 +134,17 @@
// big endian! // big endian!
let file = files[0]; let file = files[0];
let file_header = file.slice(0, 4); const fileHeader = file.slice(0, 4);
console.log(file_header); const buffer = await fileHeader.arrayBuffer();
let header_bytes = await file_header.bytes(); console.log(fileHeader);
let file_header_hex = '0x' + header_bytes.toHex().toString(); let headerBytes = new Uint8Array(buffer);
let fileHeaderHex = '0x' + headerBytes.toHex().toString();
if (GLD_MAGIC == swap_endian(file_header_hex)) { if (GLD_MAGIC == swap_endian(fileHeaderHex)) {
return true; return true;
} else { } else {
return false; return false;
} }
return true;
} }
async function getUrl() { async function getUrl() {
@@ -248,9 +254,8 @@
} }
} }
function constructMailToLink() { async function copyAndOpenMail() {
const subject = 'Link zum Tatvorgang'; const subject = 'Link zum Tatvorgang';
const link = data.url.origin + data.url.pathname; const link = data.url.origin + data.url.pathname;
const body = `Hallo, const body = `Hallo,
@@ -262,17 +267,56 @@ Der Zugangs-PIN wird zur Sicherheit über einen zweiten Kommunikationskanal übe
Mit freundlichen Grüßen, Mit freundlichen Grüßen,
`; `;
const mailtoLink = `mailto:?subject=${encodeURIComponent(subject)}&body=${encodeURIComponent(body)}`; try {
await navigator.clipboard.writeText(body);
return mailtoLink; copied = true;
}
// Kurz warten, dann Mail öffnen
setTimeout(() => {
const mailtoLink = `mailto:?subject=${encodeURIComponent(subject)}`;
window.location.href = mailtoLink;
}, 1000);
setTimeout(() => copied = false, 2000);
} catch (err) {
console.error('Clipboard-Fehler:', err);
error = 'Konnte Text nicht kopieren. Bitte manuell markieren und kopieren.';
}
}
function closeModal() { function closeModal() {
open = false; open = false;
isError = false; isError = false;
} }
// drag and drop functionality
let isDragging = $state(false);
async function handleDrop(event) {
event.preventDefault();
isDragging = false;
if (event.dataTransfer?.files?.length) {
files = event.dataTransfer.files;
}
if (!(await check_valid_glb_file())) {
formErrors = { file: 'Keine gültige .GLD-Datei' }
// reset form fields etc.
files = null;
fileInput.value = '';
} else {
formErrors = { ...formErrors, file: ''}
};
}
</script> </script>
<svelte:window
on:dragover|preventDefault
on:drop|preventDefault
/>
{#if data.vorgang && crimesList} {#if data.vorgang && crimesList}
<div class="-z-10 bg-white"> <div class="-z-10 bg-white">
<div class="flex flex-col items-center justify-center w-full"> <div class="flex flex-col items-center justify-center w-full">
@@ -288,9 +332,10 @@ Mit freundlichen Grüßen,
onDelete={null} onDelete={null}
/> />
</div> </div>
<a class="pt-2 pb-6" href={constructMailToLink()} <Button variant="secondary" on:click={copyAndOpenMail} disabled={isEmptyList}>Link kopieren und Mail verfassen</Button>
><Button disabled={isEmptyList}>Share Link</Button></a {#if copied}
> <p transition:fade>✔ Kopiert! Per Ctrl+V einfügen.</p>
{/if}
{/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">
@@ -398,7 +443,13 @@ Mit freundlichen Grüßen,
</span> </span>
</label> </label>
<div <div
class="mt-2 flex justify-center rounded-lg border border-dashed border-gray-900/25 px-6 py-10" class="mt-2 flex justify-center rounded-lg border border-dashed px-6 py-10
{isDragging
? 'border-blue-500 bg-blue-50'
: 'border-gray-900/25'}"
on:dragover|preventDefault={() => (isDragging = true)}
on:dragleave={() => (isDragging = false)}
on:drop={handleDrop}
> >
<div class="text-center"> <div class="text-center">
<FileRect /> <FileRect />
@@ -408,7 +459,7 @@ Mit freundlichen Grüßen,
class="relative cursor-pointer rounded-md bg-white font-semibold text-indigo-600 focus-within:outline-none focus-within:ring-2 focus-within:ring-indigo-600 focus-within:ring-offset-2 hover:text-indigo-500" class="relative cursor-pointer rounded-md bg-white font-semibold text-indigo-600 focus-within:outline-none focus-within:ring-2 focus-within:ring-indigo-600 focus-within:ring-offset-2 hover:text-indigo-500"
> >
<span>Wähle eine Datei aus</span> <span>Wähle eine Datei aus</span>
<input id="file" bind:files name="file" type="file" class="sr-only" /> <input id="file" bind:this={fileInput} bind:files name="file" type="file" class="sr-only" />
</label> </label>
<p class="pl-1">oder ziehe sie ins Feld</p> <p class="pl-1">oder ziehe sie ins Feld</p>
</div> </div>

View File

@@ -1,4 +1,3 @@
import { json } from '@sveltejs/kit';
import { deleteUser } from '$lib/server/userService'; import { deleteUser } from '$lib/server/userService';
export async function DELETE({ params }) { export async function DELETE({ params }) {