Liesten ProCon
This commit is contained in:
1 parent
d9962e22b8
commit
0de185c014
54 files changed
+1105
-392
No files matched your search
@@ -0,0 +1,12 @@
|
||||
import Link from 'next/link';
|
||||
import type { ReactNode } from 'react';
|
||||
|
||||
export default function AltLayout({ children }: { children: ReactNode }) {
|
||||
return <div>
|
||||
<header className="flex flex-wrap items-center gap-4 border-b bg-gray-100 px-6 py-3 text-sm">
|
||||
<Link className="underline" href="/">RK App</Link>
|
||||
<Link className="font-semibold underline" href="/alt">Alt – bisherige Seiten</Link>
|
||||
</header>
|
||||
{children}
|
||||
</div>;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import { Sites } from '@/_config/sites';
|
||||
import Link from 'next/link';
|
||||
|
||||
const entries = [Sites.anlagen, Sites.groups, Sites.elements, Sites.peripheries,
|
||||
Sites.visu, Sites.visu.create, Sites.visu.selectGroups, Sites.visu.elements, Sites.logNote];
|
||||
|
||||
export default function AltPage() {
|
||||
return <main className="space-y-4 p-6">
|
||||
<h1 className="text-xl font-semibold">Alt</h1>
|
||||
<nav aria-label="Bisherige Seiten"><ul className="space-y-2">
|
||||
{entries.map(entry => <li key={entry.url}><Link className="underline" href={entry.url}>{entry.name}</Link></li>)}
|
||||
</ul></nav>
|
||||
</main>;
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -20,7 +20,7 @@ export default async function ProConLayout({ children }: { children: ReactNode }
|
||||
<aside className="w-48 shrink-0 border-r bg-gray-50 p-4"><nav className="flex flex-col gap-3 text-sm">
|
||||
<Link href="/">Home</Link><Link href="/procon">ProCon-Start</Link>
|
||||
<Link href="/procon/aggregate">Aggregate</Link><Link href="/procon/zuordnung">Zuordnung</Link><Link href="/rk2/verbindungen">Verbindungen verwalten</Link>
|
||||
<Link href="/rk/anlagen">Anlage auswählen</Link>
|
||||
<Link href="/alt/rk/anlagen">Anlage auswählen</Link>
|
||||
<Link href="/visualisierung">Visualisierung</Link>
|
||||
</nav></aside>
|
||||
<main className="min-w-0 flex-1 p-4">{children}</main>
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
export async function GET() {
|
||||
try {
|
||||
const response = await fetch('http://localhost:3000/rk2/anzeigewerte/export', { cache: 'no-store' });
|
||||
if (!response.ok) return new Response('Excel-Export fehlgeschlagen', { status: 502 });
|
||||
return new Response(response.body, { headers: { 'Content-Type': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||
'Content-Disposition': 'attachment; filename="Anzeigewerte.xlsx"', 'Cache-Control': 'no-store' } });
|
||||
} catch { return new Response('Keine Verbindung zum Backend', { status: 502 }); }
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import { api_displays } from '@/actions/anzeigen/api-anzeigewerte';
|
||||
import DisplayTable from '@/components/anzeigen/displayTable';
|
||||
export default async function Page() {
|
||||
try { return <DisplayTable initial={await api_displays()} />; }
|
||||
catch (error) { return <p role="alert">{error instanceof Error ? error.message : 'Anzeigewerte konnten nicht geladen werden'}</p>; }
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
export async function GET() {
|
||||
try {
|
||||
const response = await fetch('http://localhost:3000/rk2/sensoren-analog/export', { cache: 'no-store' });
|
||||
if (!response.ok) return new Response('Sensoren-Export fehlgeschlagen', { status: 502 });
|
||||
return new Response(response.body, { headers: { 'Content-Type': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||
'Content-Disposition': 'attachment; filename="Sensoren_Analog.xlsx"', 'Cache-Control': 'no-store' } });
|
||||
} catch { return new Response('Keine Verbindung zum Backend', { status: 502 }); }
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import { api_analog, api_analogSources } from '@/actions/sensoren/api-analog';
|
||||
import AnalogTable from '@/components/sensoren/analogTable';
|
||||
export default async function Page() {
|
||||
try {
|
||||
const [table, sources] = await Promise.all([api_analog(), api_analogSources()]);
|
||||
if (table.anlageId !== sources.anlageId) throw new Error('Anlage geändert. Neu laden.');
|
||||
return <AnalogTable initial={table} sources={sources.sources} />;
|
||||
} catch (error) { return <p role="alert">{error instanceof Error ? error.message : 'Sensoren konnten nicht geladen werden'}</p>; }
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
export async function GET() {
|
||||
try {
|
||||
const response = await fetch('http://localhost:3000/rk2/sensoren-analog/xaml-zip', { cache: 'no-store' });
|
||||
if (!response.ok) return new Response('XAML-Export fehlgeschlagen', { status: 502 });
|
||||
return new Response(response.body, { headers: { 'Content-Type': 'application/zip', 'Content-Disposition': 'attachment; filename="Sensoren_Analog-XAML.zip"', 'Cache-Control': 'no-store' } });
|
||||
} catch { return new Response('Keine Verbindung zum Backend', { status: 502 }); }
|
||||
}
|
||||
@@ -19,7 +19,7 @@ export default async function VisuAggregatePage() {
|
||||
return <div>
|
||||
<Breadcrumbs items={[{ label: 'Anlage', href: '/rk2' }, { label: 'VisuAggregate' }]} />
|
||||
<h1 className="my-4 text-xl font-semibold">VisuAggregate</h1>
|
||||
<p className="mb-4">Werte direkt in der Tabelle bearbeiten und je Zeile speichern. Weitere Spalten sind durch horizontales Scrollen erreichbar.</p>
|
||||
<p className="mb-4">Aggregat in der Übersicht auswählen und die Werte im Detailbereich bearbeiten.</p>
|
||||
<VisuAggregateTable rows={rows} />
|
||||
</div>;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ export default function Layout({ children }: { children: ReactNode }) {
|
||||
<nav className="mt-2 flex flex-wrap gap-4 text-sm">
|
||||
<Link href="/">Home</Link><Link href="/visualisierung">Anlagenübersicht</Link>
|
||||
<Link href="/procon/positionen">Positionstabelle</Link><Link href="/procon/zuordnung">Zuordnung</Link>
|
||||
<Link href="/rk/anlagen">Anlage auswählen</Link>
|
||||
<Link href="/alt/rk/anlagen">Anlage auswählen</Link>
|
||||
</nav>
|
||||
</header>
|
||||
<main className="p-4">{children}</main>
|
||||
|
||||
Reference in new issue
Block a user