Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion dashboard/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,11 @@ const App: React.FC = () => {
<Box sx={{ flexGrow: 1 }}>
<AppBar position="static" color="transparent" elevation={0}>
<Toolbar>
<Typography variant="h6" sx={{ fontWeight: 600, letterSpacing: 0.5 }}>The LaStBeRu Explorer</Typography>
{/* Logo SLComp à esquerda */}
<Box sx={{ display:'flex', alignItems:'center', mr:1 }}>
<img src="https://raw.githubusercontent.com/CosmoObs/slcomp/refs/heads/main/.figures/slcomp.png" alt="SLComp Logo" style={{ height:32, width:80, marginRight:8, borderRadius:1, background:'#000000ff' }} />
<Typography variant="h6" sx={{ fontWeight: 600, letterSpacing: 0.5 }}>The LaStBeRu Explorer</Typography>
</Box>
<Box flexGrow={1} />
<Tooltip title="Filters">
<IconButton color="primary" onClick={handleDrawerToggle} size="small"><FilterAltIcon /></IconButton>
Expand All @@ -239,6 +243,22 @@ const App: React.FC = () => {
<IconButton color="inherit" onClick={resetFilters} size="small" disabled={filters === initialFilters}><ClearAllIcon /></IconButton>
</span>
</Tooltip>
{/* Botão GitHub à direita */}
<Box sx={{ ml:2 }}>
<Tooltip title="slcomp Repository">
<IconButton
color="inherit"
component="a"
href="https://github.com/CosmoObs/slcomp"
target="_blank"
rel="noopener noreferrer"
size="small"
sx={{ p:0.0 }}
>
<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" alt="GitHub" style={{ height:28, width:28, borderRadius:'50%' }} />
</IconButton>
</Tooltip>
</Box>
</Toolbar>
</AppBar>
<Container maxWidth="xl" sx={{ py: 3 }}>
Expand Down
13 changes: 9 additions & 4 deletions dashboard/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,18 +89,23 @@ export const loadCutouts = (): Promise<CutoutRecord[]> => fetchJson<CutoutRecord
const RAW_ENDPOINT: string | undefined = "l5s5a0sibv6w.share.zrok.io";
const ENDPOINT_SCHEME: string = ((import.meta as { env?: Record<string, string> }).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<string, string> }).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}`;
Expand Down
Loading