From 5db710648263b115714cbead28c29fce8716629b Mon Sep 17 00:00:00 2001 From: Renan Alves de Oliveira Date: Sun, 14 Sep 2025 19:34:27 -0300 Subject: [PATCH 1/2] refactor: improve cutout url generation - enhance cutout url construction for different environments - use local proxy in development for header injection and cors avoidance - fallback to relative path if external endpoint is not configured - construct url for external endpoint if available --- dashboard/src/api.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/dashboard/src/api.ts b/dashboard/src/api.ts index 3eaff49..ef53e89 100644 --- a/dashboard/src/api.ts +++ b/dashboard/src/api.ts @@ -89,18 +89,23 @@ export const loadCutouts = (): Promise => fetchJson }).env?.VITE_MINIO_SCHEME || 'https').replace(/:$/,''); export const buildCutoutUrl = (objectKey: string): string => { - const cleaned = objectKey.trim().replace(/^\/+/, ''); + const cleaned = objectKey.trim().replace(/^\/+/,''); const path = cleaned.startsWith('Cutouts/') ? cleaned : `Cutouts/${cleaned}`; - // In dev, go through local proxy to inject headers and avoid CORS + interstitial + // Em dev, usa proxy local if (import.meta.env && (import.meta as any).env.DEV) { - // Strip the prefix "Cutouts/" because the proxy rewrite adds it back (see vite proxy config) const proxied = '/proxy-cutouts/' + path.replace(/^Cutouts\//, ''); if((import.meta as { env?: Record }).env?.VITE_DEBUG_CUTOUTS) console.debug('[cutout-url-dev-proxy]', { objectKey, path, proxied }); return proxied; } - if(!RAW_ENDPOINT) return path; // fallback relative path if not configured + // Se não houver endpoint externo, monta caminho relativo ao BASE_URL + if(!RAW_ENDPOINT) { + const base = BASE_URL.endsWith('/') ? BASE_URL : `${BASE_URL}/`; + return `${base}${path}`; + } + + // Caso contrário, monta URL para endpoint externo let base = RAW_ENDPOINT.trim(); if(!/^https?:\/\//i.test(base)) { base = `${ENDPOINT_SCHEME}://${base}`; From 4c4556db0ed11a6a10cff9881ae1e53b003b6089 Mon Sep 17 00:00:00 2001 From: Renan Alves de Oliveira Date: Sun, 14 Sep 2025 19:45:06 -0300 Subject: [PATCH 2/2] feat: add slcomp logo and github link to header - add slcomp logo to the left of the title - add github link to the right of the filters - update styling for better visual appeal --- dashboard/src/App.tsx | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/dashboard/src/App.tsx b/dashboard/src/App.tsx index 8da1eb1..7ce2889 100644 --- a/dashboard/src/App.tsx +++ b/dashboard/src/App.tsx @@ -229,7 +229,11 @@ const App: React.FC = () => { - The LaStBeRu Explorer + {/* Logo SLComp à esquerda */} + + SLComp Logo + The LaStBeRu Explorer + @@ -239,6 +243,22 @@ const App: React.FC = () => { + {/* Botão GitHub à direita */} + + + + GitHub + + +