prvi kod za live uporabu
Some checks failed
ERP CI Pipeline / test (push) Has been cancelled

This commit is contained in:
mariomitte
2026-07-09 21:21:17 +02:00
parent 857bb65d52
commit 5d39e048ba
239 changed files with 25151 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
---
export const prerender = false;
import Layout from '../layouts/Layout.astro';
import FleetDashboardShell from '../components/dashboard/FleetDashboardShell.jsx';
---
<Layout title="Klijenti">
<FleetDashboardShell client:load pageMode="clients" initialSection="clients" />
</Layout>

View File

@@ -0,0 +1,37 @@
---
import Layout from '../../layouts/Layout.astro';
import DataView from '../../components/data/DataView';
import { fetchJson } from '../../lib/api';
export const prerender = false;
const slugParts = Astro.params.slug?.split('/').filter(Boolean) ?? [];
const endpoint = slugParts.length ? `${slugParts.join('/')}/` : 'fleet/work-orders/';
const cacheKey = `data:${endpoint}`;
let initialData: unknown[] | null = null;
let initialError: string | null = null;
try {
// SSR fetch for first paint; client island revalidates and syncs IndexedDB after hydration.
const payload = await fetchJson<unknown[]>(endpoint, { method: 'GET', timeoutMs: 8000 });
initialData = Array.isArray(payload) ? payload : [];
} catch (error) {
initialError = error instanceof Error ? error.message : 'SSR data fetch failed.';
}
---
<Layout title={`Data | ${endpoint}`}>
<div class="space-y-4">
<p class="text-sm text-text-muted">
Endpoint: <code class="rounded bg-canvas-deep px-2 py-1 text-text-main">{endpoint}</code>
</p>
<DataView
client:load
endpoint={endpoint}
cacheKey={cacheKey}
initialData={initialData}
initialError={initialError}
/>
</div>
</Layout>

View File

@@ -0,0 +1,9 @@
---
export const prerender = false;
import Layout from '../layouts/Layout.astro';
import FleetDashboardShell from '../components/dashboard/FleetDashboardShell.jsx';
---
<Layout title="ERP Dashboard">
<FleetDashboardShell client:load />
</Layout>

View File

@@ -0,0 +1,10 @@
---
import Layout from '../layouts/Layout.astro';
import LoginForm from '../components/auth/LoginForm.jsx';
---
<Layout title="Prijava" isAuthPage={true}>
<div class="flex min-h-[60vh] items-center justify-center py-10">
<LoginForm client:load />
</div>
</Layout>

View File

@@ -0,0 +1,9 @@
---
export const prerender = false;
import Layout from '../layouts/Layout.astro';
import FleetDashboardShell from '../components/dashboard/FleetDashboardShell.jsx';
---
<Layout title="Putni nalozi">
<FleetDashboardShell client:load pageMode="work-orders" initialSection="work-orders" />
</Layout>

View File

@@ -0,0 +1,9 @@
---
export const prerender = false;
import Layout from '../../layouts/Layout.astro';
import WorkOrderInvoicesPdfPage from '../../components/dashboard/WorkOrderInvoicesPdfPage.jsx';
---
<Layout title="Izrada putnog naloga" minimalNav={false}>
<WorkOrderInvoicesPdfPage client:load />
</Layout>

View File

@@ -0,0 +1,9 @@
---
export const prerender = false;
import Layout from '../layouts/Layout.astro';
import FleetDashboardShell from '../components/dashboard/FleetDashboardShell.jsx';
---
<Layout title="Servisni zapisi">
<FleetDashboardShell client:load pageMode="service-records" initialSection="service-records" />
</Layout>

View File

@@ -0,0 +1,9 @@
---
export const prerender = false;
import Layout from '../layouts/Layout.astro';
import FleetDashboardShell from '../components/dashboard/FleetDashboardShell.jsx';
---
<Layout title="Servisni zapisi">
<FleetDashboardShell client:load pageMode="service-records" initialSection="service-records" />
</Layout>

View File

@@ -0,0 +1,9 @@
---
export const prerender = false;
import Layout from '../layouts/Layout.astro';
import FleetDashboardShell from '../components/dashboard/FleetDashboardShell.jsx';
---
<Layout title="Vozila i dizalice">
<FleetDashboardShell client:load pageMode="vehicles" initialSection="cranes" />
</Layout>

View File

@@ -0,0 +1,9 @@
---
export const prerender = false;
import Layout from '../layouts/Layout.astro';
import FleetDashboardShell from '../components/dashboard/FleetDashboardShell.jsx';
---
<Layout title="Putni nalozi">
<FleetDashboardShell client:load pageMode="work-orders" initialSection="work-orders" />
</Layout>