From 10deecfb35b94fc325c645f2822684a32bce1fb1 Mon Sep 17 00:00:00 2001 From: MrUnknownDE Date: Mon, 27 Apr 2026 12:04:34 +0200 Subject: [PATCH] remove placeholder sentry and add mobil menu --- backend/server.js | 45 +++---------------------------- frontend/app/index.html | 14 +++++++--- frontend/app/pages/home.js | 16 +++++------ frontend/app/router.js | 13 +++++++++ frontend/app/shared.css | 54 ++++++++++++++++++++++++++++++++++---- 5 files changed, 82 insertions(+), 60 deletions(-) diff --git a/backend/server.js b/backend/server.js index d953b10..f1dbc8a 100644 --- a/backend/server.js +++ b/backend/server.js @@ -5,22 +5,14 @@ const Sentry = require("@sentry/node"); // Initialize Sentry BEFORE requiring any other modules! Sentry.init({ - // DSN should now be available from process.env if set in .env - dsn: process.env.SENTRY_DSN || "https://aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa@oooooooooooooooo.ingest.sentry.io/123456", - // Enable tracing - Adjust sample rate as needed + dsn: process.env.SENTRY_DSN, tracesSampleRate: process.env.NODE_ENV === 'production' ? 0.1 : 1.0, integrations: [ - // send console.log, console.warn, and console.error calls as logs to Sentry - Sentry.consoleLoggingIntegration({ levels: ["log", "warn", "error"] }), + Sentry.consoleLoggingIntegration({ levels: ["warn", "error"] }), ], - // Enable logs to be sent to Sentry enableLogs: true, }); -// DEBUG: Check Sentry object after init -console.log("Sentry object after init:", typeof Sentry, Sentry ? Object.keys(Sentry) : 'Sentry is undefined/null'); -// --- Ende Sentry Initialisierung --- - // Require necessary core modules AFTER Sentry is initialized const express = require('express'); @@ -53,20 +45,6 @@ const logger = pino({ const app = express(); const PORT = process.env.PORT || 3000; -// --- Sentry Middleware (Request Handler & Tracing) --- -// Must be the first middleware -if (Sentry.Handlers && Sentry.Handlers.requestHandler) { - app.use(Sentry.Handlers.requestHandler()); -} else { - logger.error("Sentry.Handlers.requestHandler is not available!"); -} -// Must be after requestHandler, before routes -if (Sentry.Handlers && Sentry.Handlers.tracingHandler) { - app.use(Sentry.Handlers.tracingHandler()); -} else { - logger.error("Sentry.Handlers.tracingHandler is not available!"); -} -// --- Ende Sentry Middleware --- // --- Core Middleware --- @@ -112,23 +90,8 @@ app.use('/api/mac-lookup', macLookupRoutes); app.use('/api/asn-lookup', asnLookupRoutes); -// --- Sentry Error Handler --- -// Must be AFTER all controllers and BEFORE any other error handling middleware -if (Sentry.Handlers && Sentry.Handlers.errorHandler) { - app.use(Sentry.Handlers.errorHandler({ - shouldHandleError(error) { - // Capture all 500 errors - if (error.status === 500) return true; - // Capture specific client errors if needed, e.g., 403 - // if (error.status === 403) return true; - // By default, capture only server errors (5xx) - return error.status >= 500; - }, - })); -} else { - logger.error("Sentry.Handlers.errorHandler is not available!"); -} -// --- Ende Sentry Error Handler --- +// Sentry error handler — must be after routes, before custom error handler +Sentry.setupExpressErrorHandler(app); // --- Fallback Error Handler --- diff --git a/frontend/app/index.html b/frontend/app/index.html index 6aedd6c..7f2b1a4 100644 --- a/frontend/app/index.html +++ b/frontend/app/index.html @@ -4,6 +4,7 @@ uTools – Network Suite + @@ -12,10 +13,15 @@
-

- uTools Network Suite -

-