This commit is contained in:
@@ -182,7 +182,7 @@ export const CCDoclingViewer: React.FC<{
|
||||
setError(null);
|
||||
try {
|
||||
// Try page-images manifest first
|
||||
const API_BASE = import.meta.env.VITE_API_BASE || (location.port.startsWith('517') ? 'http://127.0.0.1:8080' : '/api');
|
||||
const API_BASE = import.meta.env.VITE_API_BASE || '/api';
|
||||
try {
|
||||
const mRes = await fetch(`${API_BASE}/database/files/${encodeURIComponent(fileId)}/page-images/manifest`, {
|
||||
headers: { 'Authorization': `Bearer ${accessToken || ''}` }
|
||||
@@ -199,7 +199,7 @@ export const CCDoclingViewer: React.FC<{
|
||||
}
|
||||
|
||||
// Legacy: Load artefacts for file to find docling JSON artefacts
|
||||
const artefactsRes = await fetch(`${import.meta.env.VITE_API_BASE || (location.port.startsWith('517') ? 'http://127.0.0.1:8080' : '/api')}/database/files/${encodeURIComponent(fileId)}/artefacts`, {
|
||||
const artefactsRes = await fetch(`${import.meta.env.VITE_API_BASE || '/api'}/database/files/${encodeURIComponent(fileId)}/artefacts`, {
|
||||
headers: { 'Authorization': `Bearer ${accessToken || ''}` }
|
||||
});
|
||||
if (!artefactsRes.ok) throw new Error(await artefactsRes.text());
|
||||
@@ -239,7 +239,7 @@ export const CCDoclingViewer: React.FC<{
|
||||
run();
|
||||
}, [fileId]); /* eslint-disable-line react-hooks/exhaustive-deps */
|
||||
|
||||
const API_BASE = useMemo(() => import.meta.env.VITE_API_BASE || (location.port.startsWith('517') ? 'http://127.0.0.1:8080' : '/api'), []);
|
||||
const API_BASE = useMemo(() => import.meta.env.VITE_API_BASE || '/api', []);
|
||||
|
||||
const pageProxyUrl = useMemo(() => {
|
||||
if (!manifest) return undefined;
|
||||
|
||||
Reference in New Issue
Block a user