From 95ffb5fa317dc057cccddc0a0b49fdf44ce8a1e3 Mon Sep 17 00:00:00 2001 From: Michael Wedl Date: Mon, 27 May 2024 08:47:46 +0200 Subject: [PATCH] Improve dev proxying --- api/src/reportcreator_api/pentests/admin.py | 3 +++ frontend/nuxt.config.ts | 11 +++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/api/src/reportcreator_api/pentests/admin.py b/api/src/reportcreator_api/pentests/admin.py index 2266812c6..808bba4b9 100644 --- a/api/src/reportcreator_api/pentests/admin.py +++ b/api/src/reportcreator_api/pentests/admin.py @@ -56,6 +56,9 @@ class PentestProjectAdmin(SimpleHistoryAdmin, BaseAdmin): def link_findings(self, obj): return admin_changelist_url('Findings of this project', 'pentests', 'pentestfinding', {'project_id': obj.id}) + def link_sections(self, obj): + return admin_changelist_url('Sections of this project', 'pentests', 'reportsection', {'project_id': obj.id}) + def link_project_type(self, obj): return admin_change_url(obj.project_type.name, 'pentests', 'projecttype', obj.project_type.id) diff --git a/frontend/nuxt.config.ts b/frontend/nuxt.config.ts index 5782846e4..167fb4e48 100644 --- a/frontend/nuxt.config.ts +++ b/frontend/nuxt.config.ts @@ -83,10 +83,17 @@ export default defineNuxtConfig({ changeOrigin: false, ws: true, }, - - '/admin': 'http://api:8000', + '/admin': { + target: 'http://api:8000', + changeOrigin: false, + }, + '/__debug__': { + target: 'http://api:8000', + changeOrigin: false, + }, '/static': { target: 'http://api:8000', + changeOrigin: false, bypass(req) { if (['/static/logo.svg', '/static/logo-text.svg', '/static/favicon.ico'].includes(req.url!) || req.url!.startsWith('/static/pdfviewer/')) { return req.url;