sensorDigital, grafik Fest, drawPunkt eingefügt
This commit is contained in:
1 parent
0de185c014
commit
30ad6d0e47
106 files changed
+1371
-317
No files matched your search
@@ -1,12 +1,8 @@
|
||||
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>
|
||||
<header className="border-b bg-gray-100 px-6 py-3 text-sm font-semibold">Alt – bisherige Seiten</header>
|
||||
{children}
|
||||
</div>;
|
||||
}
|
||||
@@ -1,11 +1,13 @@
|
||||
import { Sites } from "@/_config/sites";
|
||||
import { api_GroupAll } from "@/actions/rk/api-groups";
|
||||
import { api_anlage_getSelected } from "@/actions/rk/api-anlage";
|
||||
import GroupView from "@/components/rk/groups/groupView";
|
||||
|
||||
|
||||
import Link from "next/link";
|
||||
|
||||
export default async function PageGroups() {
|
||||
const anlage = await api_anlage_getSelected();
|
||||
const groups = await api_GroupAll();
|
||||
|
||||
return (
|
||||
@@ -19,7 +21,7 @@ export default async function PageGroups() {
|
||||
<Link href={Sites.groups.new.url}>{Sites.groups.new.name}</Link>
|
||||
</div>
|
||||
</div>
|
||||
<GroupView groups={groups}></GroupView>
|
||||
<GroupView anlage={anlage} groups={groups}></GroupView>
|
||||
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -11,6 +11,6 @@ export default async function PageAggregate() {
|
||||
} catch (error) {
|
||||
return <div><h2 className="mb-3 text-lg font-semibold">Aggregate</h2>
|
||||
<p role="alert" className="mb-3 text-red-600">{error instanceof Error ? error.message : 'Aggregate konnten nicht geladen werden.'}</p>
|
||||
<Link href="/rk2/verbindungen" className="underline">ProCon-Verbindung prüfen</Link></div>;
|
||||
<Link href="/verbindungen" className="underline">ProCon-Verbindung prüfen</Link></div>;
|
||||
}
|
||||
}
|
||||
@@ -1,29 +1,5 @@
|
||||
import { ReactNode } from 'react';
|
||||
import Link from 'next/link';
|
||||
import { api_anlage_getSelected } from '@/actions/rk/api-anlage';
|
||||
import { api_connections } from '@/actions/rk/api-procon-verbindungen';
|
||||
import type { ReactNode } from 'react';
|
||||
|
||||
export default async function ProConLayout({ children }: { children: ReactNode }) {
|
||||
let source = 'Keine aktive Verbindung';
|
||||
let location = '';
|
||||
try {
|
||||
const anlage = await api_anlage_getSelected();
|
||||
const data = await api_connections(anlage.id);
|
||||
const active = data.verbindungen.find(item => item.id === data.aktiveVerbindungId);
|
||||
location = data.anlageNr + ' · ' + data.name;
|
||||
if (active) source = active.name + ' (' + active.umgebung + ') · ' + active.server + ' / ' + active.datenbank;
|
||||
} catch { source = 'Anlage oder Verbindung konnte nicht geladen werden'; }
|
||||
return <div className="flex min-h-screen flex-col">
|
||||
<header className="border-b bg-slate-800 px-5 py-3 text-white"><h1 className="text-xl font-semibold">ProCon</h1>
|
||||
<p className="text-sm">{location}</p><p className="text-xs text-slate-200">{source}</p></header>
|
||||
<div className="flex min-h-0 flex-1">
|
||||
<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="/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>
|
||||
</div>
|
||||
</div>;
|
||||
export default function Layout({ children }: { children: ReactNode }) {
|
||||
return <>{children}</>;
|
||||
}
|
||||
@@ -1,7 +1,14 @@
|
||||
import Link from 'next/link';
|
||||
import { proconNavigation } from '@/_config/procon-navigation';
|
||||
|
||||
export default function ProConPage() {
|
||||
return <div><h2 className="mb-3 text-lg font-semibold">ProCon-Datenbank</h2>
|
||||
<p className="mb-4 text-sm text-gray-600">Daten aus der aktiven Verbindung der ausgewählten Anlage.</p>
|
||||
<Link className="inline-block rounded border bg-white p-4 underline" href="/procon/aggregate">Aggregate-Tabelle anzeigen</Link>
|
||||
<nav aria-label="ProCon-Unterseiten"><ul className="grid gap-3 sm:grid-cols-2 xl:grid-cols-3">
|
||||
{proconNavigation.map(item => <li key={item.label}>{item.href
|
||||
? <Link className="block rounded border bg-white p-4 font-medium text-blue-800 hover:border-blue-400 hover:bg-blue-50 focus-visible:outline-2 focus-visible:outline-blue-600" href={item.href}>{item.label}</Link>
|
||||
: <span aria-disabled="true" className="flex items-center justify-between gap-2 rounded border bg-gray-50 p-4 text-gray-400">{item.label}<span className="text-xs">Geplant</span></span>
|
||||
}</li>)}
|
||||
</ul></nav>
|
||||
</div>;
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
import Link from 'next/link';
|
||||
import { api_positionTable } from '@/actions/procon/api-position-table';
|
||||
import PositionTable from '@/components/procon/positionTable';
|
||||
import { api_positionOverview } from '@/actions/procon/api-position-table';
|
||||
import PositionOverview from '@/components/procon/positionOverview';
|
||||
|
||||
export default async function Page() {
|
||||
try { return <PositionTable initial={await api_positionTable()} />; }
|
||||
try { return <PositionOverview initial={await api_positionOverview()} />; }
|
||||
catch (error) {
|
||||
return <div><p role="alert">{error instanceof Error ? error.message : 'Positionen konnten nicht geladen werden.'}</p>
|
||||
<Link className="underline" href="/procon/zuordnung">Zuordnung prüfen</Link></div>;
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
"use client"
|
||||
|
||||
import { Sites } from "@/_config/sites";
|
||||
import { api_anlage_getSelected } from "@/actions/rk/api-anlage";
|
||||
import { Anlage } from "@/types/rk";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
interface Props {
|
||||
children: React.ReactNode
|
||||
}
|
||||
|
||||
export default function AnlageLayout({ children }: Props) {
|
||||
const router = useRouter();
|
||||
const [anlage,setAnlage] = useState<Anlage>()
|
||||
|
||||
useEffect(()=>{
|
||||
const loadAnlage = async ()=>{
|
||||
const currentAnlage = await api_anlage_getSelected();
|
||||
setAnlage(()=>currentAnlage);
|
||||
}
|
||||
loadAnlage();
|
||||
},[])
|
||||
|
||||
return (
|
||||
<div className="flex h-screen flex-col overflow-hidden">
|
||||
|
||||
<header className="flex h-16 items-center border-b bg-blue-600 text-white px-6 ">
|
||||
<h1 className="text-xl font-semibold ">
|
||||
{`RK -${anlage?.anlageNr} ${anlage?.name}`}
|
||||
</h1>
|
||||
</header>
|
||||
<div className="flex min-h-0 flex-1">
|
||||
<aside className="w-64 border-r bg-gray-50 p-4">
|
||||
<nav className="flex flex-col gap-2">
|
||||
<h2 className="mb-4 font-semibold">Anlage</h2>
|
||||
|
||||
<ul className="space-y-2">
|
||||
<li><a href="/rk2/visu-aggregate">VisuAggregate</a></li>
|
||||
<li><a href="/rk2/verbindungen">ProCon-Verbindungen</a></li>
|
||||
<li><a href="/procon">ProCon</a></li>
|
||||
<li><a href="/rk2/visu-aggregate/grafiken">Grafikübersicht</a></li>
|
||||
<li>
|
||||
<a href="/rk2/groups">Groups</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/rk2/units">Units</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href={Sites.rk2.signals.url}>{Sites.rk2.signals.name}</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href={Sites.rk2.ios.url}>IOs</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</aside>
|
||||
|
||||
{/* Content */}
|
||||
<main className="min-w-0 flex-1 overflow-y-auto p-6">
|
||||
{children}
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
import { formatComponentName } from "@/lib/componentName";
|
||||
import { Sites } from "@/_config/sites";
|
||||
import { api_units } from "@/actions/rk2/api-units";
|
||||
|
||||
import { api_anlage_getSelected } from "@/actions/rk/api-anlage";
|
||||
|
||||
|
||||
import Link from "next/link";
|
||||
import { List, ListItem, ListItemAction } from "@/components/ui/list";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import Breadcrumbs from "@/components/ui/navigation/breadcrumbs";
|
||||
|
||||
|
||||
|
||||
export default async function PageUnits() {
|
||||
|
||||
const currentAnlage = await api_anlage_getSelected();
|
||||
const units = await api_units();
|
||||
const breadcrumb = [{ label: "RK", href: "/" },{ label: "Anlage" }]
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* Main-Nav */}
|
||||
<Breadcrumbs items={breadcrumb}/>
|
||||
|
||||
<div className="flex flex-col m-4 w-170 ">
|
||||
|
||||
<List variant={"transparent"} >
|
||||
{units.map((unit) => (
|
||||
<ListItem hover={true} key={unit.id}>
|
||||
<div className="w-50">
|
||||
{unit.name}
|
||||
</div>
|
||||
<div className="w-20">
|
||||
{unit.type}
|
||||
</div>
|
||||
<div className="w-40">
|
||||
{unit.components?.map((comp) => <div key={comp.id}><div>{formatComponentName(comp)}</div></div>)}
|
||||
</div>
|
||||
<ListItemAction>
|
||||
<Button variant={"secondary"} size={"xs"} >
|
||||
<Link href={`/rk2/units/edit/${unit.id}`}>Auswahl</Link>
|
||||
</Button>
|
||||
</ListItemAction>
|
||||
</ListItem>
|
||||
|
||||
))}
|
||||
</List>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import { api_graphicLibrary } from '@/actions/visualisierung/api-library';
|
||||
import GraphicLibrary from '@/components/visualisierung/graphicLibrary';
|
||||
export default async function Page() {
|
||||
try { return <GraphicLibrary initial={await api_graphicLibrary()} />; }
|
||||
catch (error) { return <p role="alert">{error instanceof Error ? error.message : 'Grafikbibliothek konnte nicht geladen werden'}</p>; }
|
||||
}
|
||||
@@ -1,16 +1,5 @@
|
||||
import Link from 'next/link';
|
||||
import type { ReactNode } from 'react';
|
||||
|
||||
export default function Layout({ children }: { children: ReactNode }) {
|
||||
return <div className="min-h-screen bg-slate-50">
|
||||
<header className="border-b bg-slate-800 px-5 py-3 text-white">
|
||||
<h1 className="text-xl font-semibold">Visualisierung</h1>
|
||||
<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="/alt/rk/anlagen">Anlage auswählen</Link>
|
||||
</nav>
|
||||
</header>
|
||||
<main className="p-4">{children}</main>
|
||||
</div>;
|
||||
return <>{children}</>;
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,16 @@
|
||||
import Link from 'next/link';
|
||||
import { api_ProconAnzeigen } from '@/actions/procon/api-procon-anzeigen';
|
||||
import DisplayOverview from '@/components/procon/displayOverview';
|
||||
export default async function Page() {
|
||||
try {
|
||||
const rows = await api_ProconAnzeigen();
|
||||
return <div><h2 className="mb-3 text-lg font-semibold">Anzeigen</h2>
|
||||
<Link className="mb-3 inline-block text-sm underline" href="/anzeigewerte/bearbeiten">Anzeigen und Grafiken bearbeiten</Link>
|
||||
<DisplayOverview rows={rows} /></div>;
|
||||
} catch (error) {
|
||||
return <div><h2 className="mb-3 text-lg font-semibold">Anzeigen</h2>
|
||||
<p role="alert" className="mb-3 text-red-600">{error instanceof Error ? error.message : 'Anzeigen konnten nicht geladen werden'}</p>
|
||||
<div className="flex flex-wrap gap-3"><Link className="underline" href="/verbindungen">ProCon-Verbindung prüfen</Link>
|
||||
<Link className="underline" href="/anzeigewerte/bearbeiten">Anzeigen und Grafiken bearbeiten</Link></div></div>;
|
||||
}
|
||||
}
|
||||
@@ -30,7 +30,7 @@ export default async function PageGroupEdit({ params }: Props) {
|
||||
const group = resultFindGroupById.data;
|
||||
const groups = await api_groups();
|
||||
|
||||
const breadcrumb = [{ label: "RK", href: "/" },{ label: "Anlage", href: "/rk2" },{ label: "Groups", href: "/rk2/groups" }, { label: "Edit" }, { label: group.name }]
|
||||
const breadcrumb = [{ label: "RK", href: "/" },{ label: "Anlage", href: "/" },{ label: "Groups", href: "/groups" }, { label: "Edit" }, { label: group.name }]
|
||||
|
||||
if (!resultFindGroupById.success) return <div>Grouppe nicht gefunden {resultFindGroupById.errors} {id}</div>
|
||||
|
||||
@@ -14,7 +14,7 @@ export default async function PageGroups() {
|
||||
const currentAnlage= await api_anlage_getSelected();
|
||||
const groups = await api_groups();
|
||||
|
||||
const breadcrumb = [{ label: "RK", href: "/" },{ label: "Anlage", href: "/rk2" },{ label: "Groups", href: "/rk2/groups" }, { label: "New" }]
|
||||
const breadcrumb = [{ label: "RK", href: "/" },{ label: "Anlage", href: "/" },{ label: "Groups", href: "/groups" }, { label: "New" }]
|
||||
|
||||
|
||||
return (
|
||||
@@ -13,7 +13,7 @@ export default async function PageGroups() {
|
||||
const currentAnlage= await api_anlage_getSelected();
|
||||
const groups = await api_groups();
|
||||
|
||||
const breadcrumb = [{ label: "RK", href: "/" },{ label: "Anlage", href: "/rk2" },{ label: "Groups" }]
|
||||
const breadcrumb = [{ label: "RK", href: "/" },{ label: "Anlage", href: "/" },{ label: "Groups" }]
|
||||
|
||||
|
||||
return (
|
||||
@@ -13,7 +13,7 @@ export default async function IosPage() {
|
||||
return <div className="m-4">
|
||||
<Breadcrumbs items={[{ label: 'IOs' }, { label: `${anlage.anlageNr} ${anlage.name}` }]} />
|
||||
<h1 className="my-4 text-xl font-semibold">IO-Übersicht</h1>
|
||||
<Link className="mb-4 inline-block underline" href="/rk2/signals/assignment">IOs zu Signalen zuordnen</Link>
|
||||
<Link className="mb-4 inline-block underline" href="/signals/assignment">IOs zu Signalen zuordnen</Link>
|
||||
<IoOverview ios={ios.filter((io) => io.anlageId === anlage.id)}
|
||||
signals={signals.filter((signal) => signal.anlageId === anlage.id)}
|
||||
units={units.filter((unit) => unit.anlageId === anlage.id)} />
|
||||
+4
-3
@@ -1,6 +1,7 @@
|
||||
import type { Metadata } from "next";
|
||||
import { Geist, Geist_Mono } from "next/font/google";
|
||||
import "./globals.css";
|
||||
import AppLayout from "@/components/navigation/appLayout";
|
||||
|
||||
const geistSans = Geist({
|
||||
variable: "--font-geist-sans",
|
||||
@@ -13,8 +14,8 @@ const geistMono = Geist_Mono({
|
||||
});
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Create Next App",
|
||||
description: "Generated by create next app",
|
||||
title: "RK App",
|
||||
description: "Anlagenverwaltung und Visualisierung",
|
||||
};
|
||||
|
||||
export default function RootLayout({
|
||||
@@ -26,7 +27,7 @@ export default function RootLayout({
|
||||
<html lang="de">
|
||||
<body className={`${geistSans.variable} ${geistMono.variable} antialiased`} >
|
||||
|
||||
{children}
|
||||
<AppLayout>{children}</AppLayout>
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
|
||||
+50
-12
@@ -1,14 +1,52 @@
|
||||
import { Sites } from '@/_config/sites';
|
||||
import Link from 'next/link';
|
||||
import { formatComponentName } from "@/lib/componentName";
|
||||
import { Sites } from "@/_config/sites";
|
||||
import { api_units } from "@/actions/rk2/api-units";
|
||||
|
||||
export default function Home() {
|
||||
return <main className="min-h-screen space-y-4 bg-zinc-50 p-6">
|
||||
<h1 className="text-xl font-semibold">RK App</h1>
|
||||
<nav aria-label="Hauptnavigation" className="flex flex-col items-start gap-3">
|
||||
<Link className="underline" href={Sites.rk2.url}>{Sites.rk2.name}</Link>
|
||||
<Link className="underline" href="/procon">ProCon</Link>
|
||||
<Link className="underline" href="/visualisierung">Visualisierung</Link>
|
||||
<Link className="underline" href={Sites.alt.url}>{Sites.alt.name}</Link>
|
||||
</nav>
|
||||
</main>;
|
||||
import { api_anlage_getSelected } from "@/actions/rk/api-anlage";
|
||||
|
||||
|
||||
import Link from "next/link";
|
||||
import { List, ListItem, ListItemAction } from "@/components/ui/list";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import Breadcrumbs from "@/components/ui/navigation/breadcrumbs";
|
||||
|
||||
|
||||
|
||||
export default async function PageUnits() {
|
||||
|
||||
const currentAnlage = await api_anlage_getSelected();
|
||||
const units = await api_units();
|
||||
const breadcrumb = [{ label: "RK", href: "/" },{ label: "Anlage" }]
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* Main-Nav */}
|
||||
<Breadcrumbs items={breadcrumb}/>
|
||||
|
||||
<div className="flex flex-col m-4 w-170 ">
|
||||
|
||||
<List variant={"transparent"} >
|
||||
{units.map((unit) => (
|
||||
<ListItem hover={true} key={unit.id}>
|
||||
<div className="w-50">
|
||||
{unit.name}
|
||||
</div>
|
||||
<div className="w-20">
|
||||
{unit.type}
|
||||
</div>
|
||||
<div className="w-40">
|
||||
{unit.components?.map((comp) => <div key={comp.id}><div>{formatComponentName(comp)}</div></div>)}
|
||||
</div>
|
||||
<ListItemAction>
|
||||
<Button variant={"secondary"} size={"xs"} >
|
||||
<Link href={`/units/edit/${unit.id}`}>Auswahl</Link>
|
||||
</Button>
|
||||
</ListItemAction>
|
||||
</ListItem>
|
||||
|
||||
))}
|
||||
</List>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,16 @@
|
||||
import Link from 'next/link';
|
||||
import { api_ProconSensoren_analog } from '@/actions/procon/api-procon-sensoren';
|
||||
import AnalogSensorOverview from '@/components/procon/analogSensorOverview';
|
||||
export default async function Page() {
|
||||
try {
|
||||
const rows = await api_ProconSensoren_analog();
|
||||
return <div><h2 className="mb-3 text-lg font-semibold">Sensoren Analog</h2>
|
||||
<Link className="mb-3 inline-block text-sm underline" href="/sensoren-analog/bearbeiten">Sensoren und Grafiken bearbeiten</Link>
|
||||
<AnalogSensorOverview rows={rows} /></div>;
|
||||
} catch (error) {
|
||||
return <div><h2 className="mb-3 text-lg font-semibold">Sensoren Analog</h2>
|
||||
<p role="alert" className="mb-3 text-red-600">{error instanceof Error ? error.message : 'Sensoren konnten nicht geladen werden'}</p>
|
||||
<div className="flex flex-wrap gap-3"><Link href="/verbindungen" className="underline">ProCon-Verbindung prüfen</Link>
|
||||
<Link href="/sensoren-analog/bearbeiten" className="underline">Sensoren und Grafiken bearbeiten</Link></div></div>;
|
||||
}
|
||||
}
|
||||
File renamed without changes.
@@ -0,0 +1,9 @@
|
||||
import { api_digital, api_digitalSources } from '@/actions/sensoren/api-digital';
|
||||
import DigitalTable from '@/components/sensoren/digitalTable';
|
||||
export default async function Page() {
|
||||
try {
|
||||
const [table, sources] = await Promise.all([api_digital(), api_digitalSources()]);
|
||||
if (table.anlageId !== sources.anlageId) throw new Error('Anlage geändert. Neu laden.');
|
||||
return <DigitalTable 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,8 @@
|
||||
export async function GET() {
|
||||
try {
|
||||
const response = await fetch('http://localhost:3000/rk2/sensoren-digital/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_Digital.xlsx"', 'Cache-Control': 'no-store' } });
|
||||
} catch { return new Response('Keine Verbindung zum Backend', { status: 502 }); }
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import Link from 'next/link';
|
||||
import { api_ProconSensoren_digital } from '@/actions/procon/api-procon-sensoren';
|
||||
import SensorOverview from '@/components/procon/analogSensorOverview';
|
||||
|
||||
export default async function Page() {
|
||||
try {
|
||||
const rows = await api_ProconSensoren_digital();
|
||||
return <div><h2 className="mb-3 text-lg font-semibold">Sensoren Digital</h2>
|
||||
<Link className="mb-3 inline-block text-sm underline" href="/sensoren-digital/bearbeiten">Digitalsensoren und Grafiken bearbeiten</Link>
|
||||
<SensorOverview rows={rows} title="Sensoren Digital" /></div>;
|
||||
} catch (error) {
|
||||
return <div><h2 className="mb-3 text-lg font-semibold">Sensoren Digital</h2>
|
||||
<p role="alert" className="mb-3 text-red-600">{error instanceof Error ? error.message : 'Digitalsensoren konnten nicht geladen werden'}</p>
|
||||
<div className="flex gap-3"><Link className="underline" href="/verbindungen">ProCon-Verbindung prüfen</Link>
|
||||
<Link className="underline" href="/sensoren-digital/bearbeiten">Digitalsensoren und Grafiken bearbeiten</Link></div></div>;
|
||||
}
|
||||
}
|
||||
+5
-5
@@ -13,7 +13,7 @@ import Breadcrumbs from "@/components/ui/navigation/breadcrumbs";
|
||||
export default async function PageSignalsEdit({ params }: { params: Promise<{ componentId: string }> }) {
|
||||
const { componentId } = await params;
|
||||
const result = await api_component_byId(componentId);
|
||||
if (!result.success) return <div className="m-4"><p role="alert">Komponente konnte nicht geladen werden.</p><Link href="/rk2/signals">Zur Signalübersicht</Link></div>;
|
||||
if (!result.success) return <div className="m-4"><p role="alert">Komponente konnte nicht geladen werden.</p><Link href="/signals">Zur Signalübersicht</Link></div>;
|
||||
const { component, unitId } = result.data;
|
||||
const [anlage, unitResult, groups, signals, ios] = await Promise.all([
|
||||
api_anlage_getSelected(), api_units_byId(unitId), api_groups(), api_signalsByComp(componentId), api_ios(),
|
||||
@@ -31,15 +31,15 @@ export default async function PageSignalsEdit({ params }: { params: Promise<{ co
|
||||
}
|
||||
return <div className="m-4">
|
||||
<Breadcrumbs items={[
|
||||
{ label: 'Signale', href: '/rk2/signals' },
|
||||
{ label: 'Signale', href: '/signals' },
|
||||
{ label: `${anlage.anlageNr} ${anlage.name}` },
|
||||
{ label: groupNames.join(' / ') || 'Ohne Gruppe' },
|
||||
{ label: unit.name, href: `/rk2/units/edit/${encodeURIComponent(unit.id)}` },
|
||||
{ label: unit.name, href: `/units/edit/${encodeURIComponent(unit.id)}` },
|
||||
{ label: formatComponentName(component) },
|
||||
]} />
|
||||
<h1 className="my-4 text-xl font-semibold">Signale: {unit.name} / {formatComponentName(component)}</h1>
|
||||
<Link className="mb-4 mr-4 inline-block underline" href={`/rk2/units/edit/${encodeURIComponent(unitId)}?componentId=${encodeURIComponent(componentId)}`}>Zurück zur Komponente {formatComponentName(component)}</Link>
|
||||
<Link className="mb-4 inline-block underline" href={`/rk2/signals/assignment?unitId=${encodeURIComponent(unitId)}`}>IOs zuordnen</Link>
|
||||
<Link className="mb-4 mr-4 inline-block underline" href={`/units/edit/${encodeURIComponent(unitId)}?componentId=${encodeURIComponent(componentId)}`}>Zurück zur Komponente {formatComponentName(component)}</Link>
|
||||
<Link className="mb-4 inline-block underline" href={`/signals/assignment?unitId=${encodeURIComponent(unitId)}`}>IOs zuordnen</Link>
|
||||
<ComponentSignals component={component} signals={signals} ios={ios} anlageId={anlage.id} />
|
||||
<h2 className="mb-2 font-semibold">Neues Signal</h2>
|
||||
<SignalForm componente={component} />
|
||||
+1
-1
@@ -11,7 +11,7 @@ export default async function AssignmentPage({ searchParams }: { searchParams: P
|
||||
const anlage = await api_anlage_getSelected();
|
||||
const [groups, units, signals, ios] = await Promise.all([api_groups(), api_units(), api_signals(), api_ios()]);
|
||||
return <div className="m-4">
|
||||
<Breadcrumbs items={[{ label: 'Signale', href: '/rk2/signals' }, { label: 'IO-Zuordnung' }, { label: `${anlage.anlageNr} ${anlage.name}` }]} />
|
||||
<Breadcrumbs items={[{ label: 'Signale', href: '/signals' }, { label: 'IO-Zuordnung' }, { label: `${anlage.anlageNr} ${anlage.name}` }]} />
|
||||
<SignalIoAssignment key={`${anlage.id}:${unitId ?? ''}`} groups={groups} units={units.filter((unit) => unit.anlageId === anlage.id)}
|
||||
signals={signals} ios={ios.filter((io) => io.anlageId === anlage.id)} anlageId={anlage.id} initialUnitId={unitId} />
|
||||
</div>;
|
||||
+2
-2
@@ -52,9 +52,9 @@ export default async function AssignmentsPage() {
|
||||
});
|
||||
|
||||
return <div className="m-4">
|
||||
<Breadcrumbs items={[{ label: 'Signale', href: '/rk2/signals' }, { label: 'Alle Zuordnungen' }, { label: `${anlage.anlageNr} ${anlage.name}` }]} />
|
||||
<Breadcrumbs items={[{ label: 'Signale', href: '/signals' }, { label: 'Alle Zuordnungen' }, { label: `${anlage.anlageNr} ${anlage.name}` }]} />
|
||||
<h1 className="my-4 text-xl font-semibold">IO-Zuordnungen ({rows.length})</h1>
|
||||
<Link className="mb-4 inline-block underline" href="/rk2/signals/assignment">Zuordnungen bearbeiten</Link>
|
||||
<Link className="mb-4 inline-block underline" href="/signals/assignment">Zuordnungen bearbeiten</Link>
|
||||
<AssignmentsTable rows={rows} />
|
||||
</div>;
|
||||
}
|
||||
File renamed without changes.
@@ -25,10 +25,10 @@ export default async function PageSignale() {
|
||||
<div className="flex flex-col m-4 w-170 ">
|
||||
<List variant={"default"} size={"lg"} >
|
||||
<ListItem hover={true}>
|
||||
<Link href="/rk2/signals/assignments">Alle IO-Zuordnungen</Link>
|
||||
<Link href="/signals/assignments">Alle IO-Zuordnungen</Link>
|
||||
</ListItem>
|
||||
<ListItem hover={true}>
|
||||
<Link href="/rk2/signals/assignment">IO-Zuordnung</Link>
|
||||
<Link href="/signals/assignment">IO-Zuordnung</Link>
|
||||
</ListItem>
|
||||
<ListItem hover={true} >
|
||||
<a href={Sites.rk2.signals.import.url}>{Sites.rk2.signals.import.name}</a>
|
||||
@@ -30,11 +30,11 @@ export default async function PageUnitsEdit({ params, searchParams }: Props) {
|
||||
const cd = componentDefaults;
|
||||
if(!resultFindUnitById.success) return <div>Unit nicht gefunden {resultFindUnitById.errors}</div>
|
||||
|
||||
const breadcrumb = [{ label: "RK", href: "/" },{ label: "Anlage", href: "/rk2" },{ label: "Units",href: "/rk2/units" },{ label: "Ändern" },{ label: resultFindUnitById.data.name }]
|
||||
const breadcrumb = [{ label: "RK", href: "/" },{ label: "Anlage", href: "/" },{ label: "Units",href: "/units" },{ label: "Ändern" },{ label: resultFindUnitById.data.name }]
|
||||
|
||||
return (
|
||||
<div className="">
|
||||
{from === 'io-assignment' && <Link className="m-4 inline-block underline" href="/rk2/signals/assignment">Zurück zur IO-Zuordnung</Link>}
|
||||
{from === 'io-assignment' && <Link className="m-4 inline-block underline" href="/signals/assignment">Zurück zur IO-Zuordnung</Link>}
|
||||
<div>
|
||||
<Breadcrumbs items={breadcrumb}/>
|
||||
</div>
|
||||
@@ -15,7 +15,7 @@ export default async function PageUnitsEditNew() {
|
||||
const componentTypes = componentTypeDefinitions;
|
||||
const cd = componentDefaults;
|
||||
|
||||
const breadcrumb = [{ label: "RK", href: "/" },{ label: "Anlage", href: "/rk2" },{ label: "Units" },{ label: "Neu" }]
|
||||
const breadcrumb = [{ label: "RK", href: "/" },{ label: "Anlage", href: "/" },{ label: "Units" },{ label: "Neu" }]
|
||||
|
||||
return (
|
||||
<div className="">
|
||||
@@ -17,7 +17,7 @@ export default async function PageUnits() {
|
||||
|
||||
const units = await api_units();
|
||||
const groups = await api_groups();
|
||||
const breadcrumb = [{ label: "RK", href: "/" }, { label: "Anlage", href: "/rk2" }, { label: "Units" }]
|
||||
const breadcrumb = [{ label: "RK", href: "/" }, { label: "Anlage", href: "/" }, { label: "Units" }]
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -28,7 +28,7 @@ export default async function PageUnits() {
|
||||
|
||||
<Card className="flex flex-col m-4 w-170 ">
|
||||
<CardHeader>Units</CardHeader>
|
||||
<Link className="m-2 underline" href="/rk2/units/templates">Unit-Vorlagen / Aus Vorlage hinzufügen</Link>
|
||||
<Link className="m-2 underline" href="/units/templates">Unit-Vorlagen / Aus Vorlage hinzufügen</Link>
|
||||
|
||||
<Button size={"xs"} className="w-30 mt-2 ms-2 mb-2">
|
||||
<Link href={Sites.rk2.units.new.url}>{Sites.rk2.units.new.name}</Link>
|
||||
@@ -66,7 +66,7 @@ export default async function PageUnits() {
|
||||
</ListItemContent>
|
||||
<ListItemAction>
|
||||
<Button variant={"secondary"} size={"xs"} >
|
||||
<Link href={`/rk2/units/edit/${unit.id}`}>Auswahl</Link>
|
||||
<Link href={`/units/edit/${unit.id}`}>Auswahl</Link>
|
||||
</Button>
|
||||
</ListItemAction>
|
||||
</ListItem>
|
||||
@@ -8,7 +8,7 @@ import { UnitTemplates } from '@/components/rk2/units/unitTemplates';
|
||||
export default async function PageUnitTemplates() {
|
||||
const [result, groups, anlage] = await Promise.all([api_templates_list(), api_groups(), api_anlage_getSelected()]);
|
||||
return <div className="m-4">
|
||||
<Link href="/rk2/units" className="underline">Zurück zu Units</Link>
|
||||
<Link href="/units" className="underline">Zurück zu Units</Link>
|
||||
<h1 className="my-4 text-xl font-semibold">Unit-Vorlagen</h1>
|
||||
<p className="mb-4">Vorlagen gelten für alle Anlagen. Eingefügt wird in: {anlage.name}</p>
|
||||
{result.success ? <UnitTemplates initial={result.data} groups={groups} componentTypes={componentTypeDefinitions} componentDefaults={componentDefaults} /> : <p role="alert">{result.errors.join(', ')}</p>}
|
||||
File renamed without changes.
+2
-2
@@ -6,12 +6,12 @@ export default async function Page({ params }: { params: Promise<{ componentId:
|
||||
const { componentId } = await params;
|
||||
try {
|
||||
const data = await api_viewAggregate(componentId);
|
||||
return <div><Link href="/rk2/visu-aggregate" className="underline">Zurück zu VisuAggregate</Link>
|
||||
return <div><Link href="/visu-aggregate" className="underline">Zurück zu VisuAggregate</Link>
|
||||
<h1 className="my-4 text-xl font-semibold">Grafiken – {data.name}</h1>
|
||||
<ViewAggregateForm componentId={componentId} initial={data} />
|
||||
</div>;
|
||||
} catch (error) {
|
||||
return <div><Link href="/rk2/visu-aggregate" className="underline">Zurück zur Tabelle</Link>
|
||||
return <div><Link href="/visu-aggregate" className="underline">Zurück zur Tabelle</Link>
|
||||
<p role="alert" className="mt-4 text-red-600">{error instanceof Error ? error.message : 'Laden fehlgeschlagen'}</p></div>;
|
||||
}
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
@@ -17,7 +17,7 @@ export default async function VisuAggregatePage() {
|
||||
<p role="alert">Die Tabelle konnte nicht geladen werden. Bitte die Backend-Verbindung und die ausgewählte Anlage prüfen und die Seite neu laden.</p></div>;
|
||||
}
|
||||
return <div>
|
||||
<Breadcrumbs items={[{ label: 'Anlage', href: '/rk2' }, { label: 'VisuAggregate' }]} />
|
||||
<Breadcrumbs items={[{ label: 'Anlage', href: '/' }, { label: 'VisuAggregate' }]} />
|
||||
<h1 className="my-4 text-xl font-semibold">VisuAggregate</h1>
|
||||
<p className="mb-4">Aggregat in der Übersicht auswählen und die Werte im Detailbereich bearbeiten.</p>
|
||||
<VisuAggregateTable rows={rows} />
|
||||
Reference in new issue
Block a user