From 94e5079a608d333b115e90846a3326c9745baa20 Mon Sep 17 00:00:00 2001 From: aewing Date: Fri, 19 Dec 2025 22:55:48 +0000 Subject: [PATCH] many edits --- backend/server.ts | 10 +- frontend/index.html | 255 ++++++++++++++++++++++++++++++++++++++----- frontend/signin.html | 13 ++- 3 files changed, 244 insertions(+), 34 deletions(-) diff --git a/backend/server.ts b/backend/server.ts index 325d279..a55ba06 100644 --- a/backend/server.ts +++ b/backend/server.ts @@ -63,7 +63,9 @@ const fetchJson = async (url: string, token: string) => { }); if (!res.ok) { const text = await res.text(); - throw new Error(`Graph ${res.status}: ${text}`); + const err: any = new Error(`Graph ${res.status}: ${text}`); + err.status = res.status; + throw err; } return res.json(); }; @@ -158,8 +160,9 @@ app.get('/api/job-files', async (c) => { return c.json({ items: mapped, total: mapped.length, source: q ? 'search' : 'walk', driveId }); } catch (err) { const message = (err as Error)?.message || String(err); + const status = (err as any)?.status || 500; logLine('logs/error.log', `/api/job-files error: ${message}`); - return c.json({ error: message }, 500); + return c.json({ error: message }, status); } }); @@ -187,8 +190,9 @@ app.get('/api/job-file-content', async (c) => { return new Response(res.body, { status: 200, headers }); } catch (err) { const message = (err as Error)?.message || String(err); + const status = (err as any)?.status || 500; logLine('logs/error.log', `/api/job-file-content error: ${message}`); - return c.json({ error: message }, 500); + return c.json({ error: message }, status); } }); diff --git a/frontend/index.html b/frontend/index.html index b74e74a..435651a 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -77,7 +77,10 @@
- v1.0.0-beta2 +
+ + v1.0.0-beta2 +
@@ -150,9 +153,9 @@ -
- -