Fix reproducible frontend Docker deployment
This commit is contained in:
@@ -1 +1,3 @@
|
||||
@import 'tailwindcss';
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const API_BASE_URL = import.meta.env.NSCT_API_BASE_URL || 'http://localhost:8080';
|
||||
const API_BASE_URL = import.meta.env.VITE_NSCT_API_BASE_URL || '/api';
|
||||
|
||||
interface ApiConfig {
|
||||
apiKey?: string;
|
||||
@@ -57,4 +57,4 @@ export async function apiDelete<T>(
|
||||
return res.json();
|
||||
}
|
||||
|
||||
export { API_BASE_URL };
|
||||
export { API_BASE_URL };
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
export let claims: ClaimInfo[] = [];
|
||||
export let sources: SourceInfo[] = [];
|
||||
export let onDismiss?: () => void;
|
||||
export let onDismiss: (() => void) | undefined = undefined;
|
||||
|
||||
// Find contradictions: claims with same topic but different conclusions
|
||||
// A simple heuristic: claims that reference the same source_id or overlapping text
|
||||
@@ -14,7 +14,7 @@
|
||||
sourceB: SourceInfo | undefined;
|
||||
}
|
||||
|
||||
$: contradictions: ContradictionPair[] = findContradictions(claims, sources);
|
||||
$: contradictions = findContradictions(claims, sources);
|
||||
|
||||
function findContradictions(claims: ClaimInfo[], sources: SourceInfo[]): ContradictionPair[] {
|
||||
const pairs: ContradictionPair[] = [];
|
||||
@@ -95,4 +95,4 @@
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
@@ -25,7 +25,7 @@ function createBanner(message: string, type: ErrorType, duration = 5000): Banner
|
||||
}
|
||||
|
||||
export function addError(message: string, type: ErrorType = 'error', duration?: number) {
|
||||
return banners.update(banners => {
|
||||
return errorBanners.update(banners => {
|
||||
const banner = createBanner(message, type, duration);
|
||||
return [...banners, banner];
|
||||
});
|
||||
@@ -70,4 +70,4 @@ function createErrorBannerStore() {
|
||||
};
|
||||
}
|
||||
|
||||
export const errorBanners = createErrorBannerStore();
|
||||
export const errorBanners = createErrorBannerStore();
|
||||
|
||||
@@ -16,9 +16,7 @@
|
||||
</script>
|
||||
|
||||
<div
|
||||
class="group flex flex-col gap-1 p-3 rounded-lg cursor-pointer transition-colors border border-transparent"
|
||||
class:ring-2 class:ring-indigo-500 class:bg-indigo-50 class:dark:bg-indigo-950/30 {isActive}
|
||||
class:hover:bg-gray-100 class:dark:hover:bg-gray-800
|
||||
class="group flex flex-col gap-1 p-3 rounded-lg cursor-pointer transition-colors border border-transparent hover:bg-gray-100 dark:hover:bg-gray-800 {isActive ? 'ring-2 ring-indigo-500 bg-indigo-50 dark:bg-indigo-950/30' : ''}"
|
||||
on:click={() => window.location.href = `/research/${item.id}`}
|
||||
>
|
||||
<div class="flex items-center justify-between gap-2">
|
||||
@@ -41,4 +39,4 @@
|
||||
></span>
|
||||
<span class="text-xs text-gray-500 font-medium">{item.status}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
<aside
|
||||
class="h-full flex flex-col bg-white dark:bg-gray-900 border-r border-gray-200 dark:border-gray-700 transition-transform duration-200 ease-in-out"
|
||||
style="width: 20rem;"
|
||||
class:{-translate-x-full: isMobile && !$sidebarOpen}
|
||||
class:-translate-x-full={isMobile && !$sidebarOpen}
|
||||
>
|
||||
<!-- Top bar -->
|
||||
<div class="flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-gray-700">
|
||||
@@ -95,10 +95,10 @@
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="flex items-center gap-2">
|
||||
<div class="w-7 h-7 rounded-full bg-indigo-500 flex items-center justify-center text-white text-xs font-bold">
|
||||
{$userObj?.apiKey?.[0]?.toUpperCase() ?? 'U'}
|
||||
{userObj?.apiKey?.[0]?.toUpperCase() ?? 'U'}
|
||||
</div>
|
||||
<span class="text-sm text-gray-700 dark:text-gray-300 truncate">
|
||||
{$userObj?.apiKey ? $userObj.apiKey.substring(0, 8) : 'Gast'}
|
||||
{userObj?.apiKey ? userObj.apiKey.substring(0, 8) : 'Gast'}
|
||||
</span>
|
||||
</div>
|
||||
<button
|
||||
@@ -154,4 +154,4 @@
|
||||
class="fixed inset-0 z-30 bg-black/50"
|
||||
on:click={toggleSidebar}
|
||||
></div>
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { theme } from '$lib/stores';
|
||||
|
||||
export { theme };
|
||||
|
||||
export function initTheme() {
|
||||
const stored = localStorage.getItem('nsct-theme');
|
||||
if (stored === 'dark' || stored === 'light') {
|
||||
@@ -17,4 +19,4 @@ export function toggleTheme() {
|
||||
export function applyTheme(t: 'dark' | 'light') {
|
||||
document.documentElement.classList.toggle('dark', t === 'dark');
|
||||
localStorage.setItem('nsct-theme', t);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script>
|
||||
import '../app.css';
|
||||
import { initTheme, applyTheme } from '$lib/theme';
|
||||
import { theme, initTheme, applyTheme } from '$lib/theme';
|
||||
import { onMount } from 'svelte';
|
||||
|
||||
initTheme();
|
||||
@@ -14,4 +14,4 @@
|
||||
<meta name="description" content="Neutraler Recherche- und Analyse-Report" />
|
||||
</svelte:head>
|
||||
|
||||
<slot />
|
||||
<slot />
|
||||
|
||||
@@ -94,17 +94,13 @@
|
||||
<div class="flex flex-wrap gap-2">
|
||||
{#each ['Deutsch', 'English', 'Multi'] as lang}
|
||||
<label
|
||||
class="flex items-center gap-2 px-4 py-2.5 border rounded-lg cursor-pointer transition-colors"
|
||||
class:ring-2 class:ring-indigo-500={language === lang}
|
||||
class:border-indigo-500={language === lang}
|
||||
class:border-gray-300 dark:border-gray-600={language !== lang}
|
||||
class:bg-indigo-50 dark:class:bg-indigo-900/20={language === lang}
|
||||
class="flex items-center gap-2 px-4 py-2.5 border rounded-lg cursor-pointer transition-colors {language === lang ? 'ring-2 ring-indigo-500 border-indigo-500 bg-indigo-50 dark:bg-indigo-900/20' : 'border-gray-300 dark:border-gray-600'}"
|
||||
>
|
||||
<input
|
||||
type="radio"
|
||||
name="language"
|
||||
value={lang}
|
||||
bind:value={language}
|
||||
bind:group={language}
|
||||
class="sr-only"
|
||||
disabled={submitting}
|
||||
/>
|
||||
@@ -122,17 +118,13 @@
|
||||
<div class="flex flex-wrap gap-2">
|
||||
{#each ['quick', 'normal', 'deep'] as d}
|
||||
<label
|
||||
class="flex items-center gap-2 px-4 py-2.5 border rounded-lg cursor-pointer transition-colors"
|
||||
class:ring-2 class:ring-indigo-500={depth === d}
|
||||
class:border-indigo-500={depth === d}
|
||||
class:border-gray-300 dark:border-gray-600={depth !== d}
|
||||
class:bg-indigo-50 dark:class:bg-indigo-900/20={depth === d}
|
||||
class="flex items-center gap-2 px-4 py-2.5 border rounded-lg cursor-pointer transition-colors {depth === d ? 'ring-2 ring-indigo-500 border-indigo-500 bg-indigo-50 dark:bg-indigo-900/20' : 'border-gray-300 dark:border-gray-600'}"
|
||||
>
|
||||
<input
|
||||
type="radio"
|
||||
name="depth"
|
||||
value={d}
|
||||
bind:value={depth}
|
||||
bind:group={depth}
|
||||
class="sr-only"
|
||||
disabled={submitting}
|
||||
/>
|
||||
@@ -171,4 +163,4 @@
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -254,9 +254,7 @@
|
||||
{#each tabs as tab}
|
||||
<button
|
||||
on:click={() => activeTab = tab}
|
||||
class="px-4 py-3 text-sm font-medium border-b-2 transition-colors whitespace-nowrap"
|
||||
class:border-indigo-500 class:text-indigo-600 class:dark:text-indigo-400={activeTab === tab}
|
||||
class:border-transparent class:text-gray-500 class:hover:text-gray-700 class:dark:text-gray-400 class:dark:hover:text-gray-300={activeTab !== tab}
|
||||
class="px-4 py-3 text-sm font-medium border-b-2 transition-colors whitespace-nowrap {activeTab === tab ? 'border-indigo-500 text-indigo-600 dark:text-indigo-400' : 'border-transparent text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300'}"
|
||||
>
|
||||
{tab}
|
||||
</button>
|
||||
@@ -328,4 +326,4 @@
|
||||
<!-- Share Modal -->
|
||||
{#if showShareModal}
|
||||
<ShareModal researchId={researchId} detail={detail} on:close={() => showShareModal = false} on:share={onShare} on:revoke={onRevoke} />
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { Markdown } from 'svelte-markdown';
|
||||
import Markdown from 'svelte-markdown';
|
||||
|
||||
export let methodology: string = '';
|
||||
export let loading = false;
|
||||
@@ -32,4 +32,4 @@
|
||||
Methodik wird nach Abschluss der Recherche verfügbar sein.
|
||||
</p>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { Markdown } from 'svelte-markdown';
|
||||
import Markdown from 'svelte-markdown';
|
||||
import type { ResearchDetail } from '$lib/research-api';
|
||||
|
||||
export let report: string = '';
|
||||
@@ -119,4 +119,4 @@
|
||||
Bericht wird generiert, sobald die Recherche abgeschlossen ist.
|
||||
</p>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -86,12 +86,7 @@
|
||||
<div class="relative flex items-start gap-3 pl-8">
|
||||
<!-- Timeline dot -->
|
||||
<div
|
||||
class="absolute left-2.5 w-3 h-3 rounded-full border-2 z-10"
|
||||
class:border-blue-500 class:bg-blue-500={i <= currentStepIndex() && statusText !== 'FAILED' && statusText !== 'STOPPED'}
|
||||
class:border-emerald-500 class:bg-emerald-500={statusText === 'COMPLETED' && i <= currentStepIndex()}
|
||||
class:border-red-500 class:bg-red-500={statusText === 'FAILED'}
|
||||
class:border-orange-500 class:bg-orange-500={statusText === 'STOPPED'}
|
||||
class:border-gray-300 class:bg-gray-100 dark:class:bg-gray-800 dark:class:border-gray-600={i > currentStepIndex()}
|
||||
class="absolute left-2.5 w-3 h-3 rounded-full border-2 z-10 {statusText === 'FAILED' ? 'border-red-500 bg-red-500' : statusText === 'STOPPED' ? 'border-orange-500 bg-orange-500' : statusText === 'COMPLETED' && i <= currentStepIndex() ? 'border-emerald-500 bg-emerald-500' : i <= currentStepIndex() ? 'border-blue-500 bg-blue-500' : 'border-gray-300 bg-gray-100 dark:bg-gray-800 dark:border-gray-600'}"
|
||||
></div>
|
||||
<!-- Step label -->
|
||||
<span class="text-sm {STEP_COLORS[statusText] || (i <= currentStepIndex() ? 'text-gray-700 dark:text-gray-300' : 'text-gray-400 dark:text-gray-600')}">
|
||||
@@ -156,4 +151,4 @@
|
||||
<p class="text-sm text-red-600 dark:text-red-400">{error}</p>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { getShareData } from '$lib/research-api';
|
||||
import type { ShareData, SourceInfo, ClaimInfo, EvidenceScore } from '$lib/research-api';
|
||||
import { truncateId, formatDate, getConfidenceBadge, getIndependenceBadge, scoreColor } from '$lib/utils/formatters';
|
||||
import { Markdown } from 'svelte-markdown';
|
||||
import Markdown from 'svelte-markdown';
|
||||
import { onMount } from 'svelte';
|
||||
import { errorBanners } from '$lib/components/ErrorBannerStore';
|
||||
|
||||
@@ -264,7 +264,7 @@
|
||||
Evidenz-Scores
|
||||
</h2>
|
||||
<div class="space-y-4">
|
||||
{#each shareData.evidence_scores as (key, value)}
|
||||
{#each Object.entries(shareData.evidence_scores) as [key, value]}
|
||||
<div>
|
||||
<div class="flex items-center justify-between mb-1">
|
||||
<span class="text-sm text-gray-700 dark:text-gray-300">
|
||||
@@ -323,4 +323,4 @@
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user