This commit is contained in:
9
frontend/src/pages/clients.astro
Normal file
9
frontend/src/pages/clients.astro
Normal 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>
|
||||
37
frontend/src/pages/data/[...slug].astro
Normal file
37
frontend/src/pages/data/[...slug].astro
Normal 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>
|
||||
9
frontend/src/pages/index.astro
Normal file
9
frontend/src/pages/index.astro
Normal 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>
|
||||
10
frontend/src/pages/login.astro
Normal file
10
frontend/src/pages/login.astro
Normal 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>
|
||||
9
frontend/src/pages/putni-nalozi.astro
Normal file
9
frontend/src/pages/putni-nalozi.astro
Normal 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>
|
||||
9
frontend/src/pages/putni-nalozi/racuni.astro
Normal file
9
frontend/src/pages/putni-nalozi/racuni.astro
Normal 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>
|
||||
9
frontend/src/pages/service-recordsssss.astro
Normal file
9
frontend/src/pages/service-recordsssss.astro
Normal 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>
|
||||
9
frontend/src/pages/servisni-zapisi.astro
Normal file
9
frontend/src/pages/servisni-zapisi.astro
Normal 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>
|
||||
9
frontend/src/pages/vehicles.astro
Normal file
9
frontend/src/pages/vehicles.astro
Normal 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>
|
||||
9
frontend/src/pages/work-orders.astro
Normal file
9
frontend/src/pages/work-orders.astro
Normal 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>
|
||||
Reference in New Issue
Block a user