upgrade auf svelte5

This commit is contained in:
titver968
2025-04-08 11:13:23 +02:00
parent 31570ff196
commit a7f9a2b4a9
85 changed files with 8596 additions and 23 deletions

View File

@@ -0,0 +1,35 @@
import { client } from '$lib/minio';
/** @type {import('./$types').RequestHandler} */
export async function GET({ params }) {
const prefix = params.vorgang ? `${params.vorgang}/` : '';
let stream = client.listObjectsV2('tatort', prefix, false, '');
const result = new ReadableStream({
start(controller) {
stream.on('data', (data) => {
if (prefix === '') {
if (data.prefix)
controller.enqueue(`${JSON.stringify({ ...data, name: data.prefix.slice(0, -1) })}\n`);
return;
}
const name = data.name.slice(prefix.length);
if (name === 'config.json') return;
controller.enqueue(`${JSON.stringify({ ...data, name, prefix })}\n`);
});
stream.on('end', () => {
controller.close();
});
},
cancel() {
stream.destroy();
}
});
return new Response(result, {
headers: {
'content-type': 'text/event-stream'
}
});
}

View File

@@ -0,0 +1,26 @@
import { client } from '$lib/minio';
/** @type {import('./$types').RequestHandler} */
export async function GET() {
var stream = client.listObjectsV2('tatort', '', true);
const result = new ReadableStream({
start(controller) {
stream.on('data', (data) => {
//console.log(data);
controller.enqueue(`${JSON.stringify(data)}\n`);
});
stream.on('end', () => {
controller.close();
});
},
cancel() {
stream.destroy();
}
});
return new Response(result, {
headers: {
'content-type': 'text/event-stream'
}
});
}

View File

@@ -0,0 +1,6 @@
import { client } from '$lib/minio';
/** @type {import('./$types').RequestHandler} */
export async function GET(params) {
console.log('GET', params);
}