stand2026_10_06
This commit is contained in:
1 parent
41f80ce947
commit
266f8c3b4f
199 files changed
+17061
-87
No files matched your search
@@ -0,0 +1,50 @@
|
||||
|
||||
import { Sites } from "@/_config/sites";
|
||||
import { api_units_byId } from "@/actions/rk2/api-units";
|
||||
|
||||
import { api_anlage_getSelected } from "@/actions/rk/api-anlage";
|
||||
import { UnitCreateForm } from "@/components/rk2/units/unit_createForm";
|
||||
|
||||
import Link from "next/link";
|
||||
import { UnitEdit } from "@/components/rk2/units/unitEdit";
|
||||
import { api_groups, api_groups_byId } from "@/actions/rk2/api-groups";
|
||||
import { componentDefaults, componentTypeDefinitions } from "@/actions/rk2/api-compTypes";
|
||||
|
||||
import Breadcrumbs from "@/components/ui/navigation/breadcrumbs";
|
||||
import { GroupForm } from "@/components/rk2/groups/groupForm";
|
||||
import { GroupEdit } from "@/components/rk2/groups/groupEdit";
|
||||
|
||||
type Props = {
|
||||
params: Promise<{
|
||||
id: string;
|
||||
}>;
|
||||
};
|
||||
|
||||
|
||||
|
||||
export default async function PageGroupEdit({ params }: Props) {
|
||||
|
||||
const { id } = await params;
|
||||
const resultFindGroupById = await api_groups_byId(id);
|
||||
const anlage = await api_anlage_getSelected();
|
||||
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 }]
|
||||
|
||||
if (!resultFindGroupById.success) return <div>Grouppe nicht gefunden {resultFindGroupById.errors} {id}</div>
|
||||
|
||||
return (
|
||||
<div className="">
|
||||
<div>
|
||||
<Breadcrumbs items={breadcrumb}/>
|
||||
</div>
|
||||
|
||||
<div className="flex flex-col m-4 w-300 ">
|
||||
|
||||
<GroupEdit anlage={anlage} selectedGroup={group} groups={groups} />
|
||||
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
import { Sites } from "@/_config/sites";
|
||||
import { api_groups } from "@/actions/rk2/api-groups";
|
||||
import { api_anlage_getSelected } from "@/actions/rk/api-anlage";
|
||||
import { GroupEdit } from "@/components/rk2/groups/groupEdit";
|
||||
|
||||
|
||||
|
||||
|
||||
import Link from "next/link";
|
||||
import Breadcrumbs from "@/components/ui/navigation/breadcrumbs";
|
||||
|
||||
|
||||
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" }]
|
||||
|
||||
|
||||
return (
|
||||
<div className="">
|
||||
<div>
|
||||
<Breadcrumbs items={breadcrumb}/>
|
||||
</div>
|
||||
<div className="flex flex-col m-4 w-300 ">
|
||||
<GroupEdit anlage={currentAnlage} groups={groups} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
import { Sites } from "@/_config/sites";
|
||||
import { api_groups } from "@/actions/rk2/api-groups";
|
||||
import { api_anlage_getSelected } from "@/actions/rk/api-anlage";
|
||||
import { GroupViewList } from "@/components/rk2/groups/groupViewList";
|
||||
|
||||
|
||||
|
||||
import Link from "next/link";
|
||||
import Breadcrumbs from "@/components/ui/navigation/breadcrumbs";
|
||||
|
||||
|
||||
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" }]
|
||||
|
||||
|
||||
return (
|
||||
<div className="">
|
||||
<div>
|
||||
<Breadcrumbs items={breadcrumb}/>
|
||||
</div>
|
||||
<div className="flex flex-col m-4 w-300 ">
|
||||
<GroupViewList anlage={currentAnlage} groups={groups} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
"use client"
|
||||
|
||||
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/groups">Groups</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/rk2/units">Units</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</aside>
|
||||
|
||||
{/* Content */}
|
||||
<main className="min-w-0 flex-1 overflow-y-auto p-6">
|
||||
{children}
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
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>{comp.name}</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,47 @@
|
||||
import { Sites } from "@/_config/sites";
|
||||
import { api_anlage_getSelected } from "@/actions/rk/api-anlage";
|
||||
import { api_component_byId } from "@/actions/rk2/api-component";
|
||||
import { componentTypeDefinitions } from "@/actions/rk2/api-compTypes";
|
||||
import { SignalForm } from "@/components/rk2/signals/signalForm";
|
||||
import { Card, CardContent, CardHeader } from "@/components/ui/card";
|
||||
import { Link } from "lucide-react";
|
||||
|
||||
type Props = {
|
||||
params: Promise<{
|
||||
componentId: string;
|
||||
}>;
|
||||
};
|
||||
|
||||
|
||||
|
||||
export default async function PageSignalsEdit({ params }: Props) {
|
||||
|
||||
const { componentId } = await params;
|
||||
const resultComponentOfId = await api_component_byId(componentId);
|
||||
const currentAnlage= await api_anlage_getSelected();
|
||||
const componentTypes = componentTypeDefinitions;
|
||||
|
||||
if(!resultComponentOfId) return <div>Keine Daten</div>
|
||||
return (
|
||||
<div className="">
|
||||
<Link href={Sites.main.url}>{Sites.main.name}</Link>
|
||||
<Link href={Sites.procon.url}>{Sites.procon.name}</Link>
|
||||
<div className="flex flex-col m-4 w-300 ">
|
||||
|
||||
<SignalForm componente={resultComponentOfId.data.component} ></SignalForm>
|
||||
|
||||
{true &&
|
||||
<Card positons={"start"}>
|
||||
<CardHeader variant={"danger"} >Debug</CardHeader>
|
||||
<CardContent className="ps-8">
|
||||
{componentId}
|
||||
<pre>{JSON.stringify(resultComponentOfId, null, 2)}</pre>
|
||||
|
||||
</CardContent>
|
||||
</Card>
|
||||
}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
import { Sites } from "@/_config/sites";
|
||||
import { api_units_byId } from "@/actions/rk2/api-units";
|
||||
|
||||
import { api_anlage_getSelected } from "@/actions/rk/api-anlage";
|
||||
import { UnitCreateForm } from "@/components/rk2/units/unit_createForm";
|
||||
|
||||
import Link from "next/link";
|
||||
import { UnitEdit } from "@/components/rk2/units/unitEdit";
|
||||
import { api_groups } from "@/actions/rk2/api-groups";
|
||||
import { componentDefaults, componentTypeDefinitions } from "@/actions/rk2/api-compTypes";
|
||||
import Breadcrumbs from "@/components/ui/navigation/breadcrumbs";
|
||||
|
||||
type Props = {
|
||||
params: Promise<{
|
||||
id: string;
|
||||
}>;
|
||||
};
|
||||
|
||||
|
||||
|
||||
export default async function PageUnitsEdit({ params }: Props) {
|
||||
|
||||
const { id } = await params;
|
||||
const resultFindUnitById = await api_units_byId(id);
|
||||
const currentAnlage= await api_anlage_getSelected();
|
||||
const groups = await api_groups();
|
||||
const componentTypes = componentTypeDefinitions;
|
||||
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 }]
|
||||
|
||||
return (
|
||||
<div className="">
|
||||
<div>
|
||||
<Breadcrumbs items={breadcrumb}/>
|
||||
</div>
|
||||
|
||||
<div className="flex flex-col m-4 w-300 ">
|
||||
|
||||
<UnitEdit anlage={currentAnlage} groups={groups} selectedUnit={resultFindUnitById.data} componentTypes={componentTypes} componentDefaults={cd}></UnitEdit>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
import { Sites } from "@/_config/sites";
|
||||
import { api_groups } from "@/actions/rk2/api-groups";
|
||||
import { api_anlage_getSelected } from "@/actions/rk/api-anlage";
|
||||
import { UnitEdit } from "@/components/rk2/units/unitEdit";
|
||||
|
||||
import Link from "next/link";
|
||||
import { componentDefaults, componentTypeDefinitions } from "@/actions/rk2/api-compTypes";
|
||||
import Breadcrumbs from "@/components/ui/navigation/breadcrumbs";
|
||||
|
||||
|
||||
|
||||
export default async function PageUnitsEditNew() {
|
||||
const currentAnlage = await api_anlage_getSelected();
|
||||
const groups = await api_groups();
|
||||
const componentTypes = componentTypeDefinitions;
|
||||
const cd = componentDefaults;
|
||||
|
||||
const breadcrumb = [{ label: "RK", href: "/" },{ label: "Anlage", href: "/rk2" },{ label: "Units" },{ label: "Neu" }]
|
||||
|
||||
return (
|
||||
<div className="">
|
||||
<div>
|
||||
<Breadcrumbs items={breadcrumb}/>
|
||||
</div>
|
||||
|
||||
<div className="flex flex-col m-4 w-300 ">
|
||||
<UnitEdit anlage={currentAnlage} groups={groups} componentTypes={componentTypes} componentDefaults={cd}></UnitEdit>
|
||||
{/*
|
||||
<UnitCreateForm anlage={currentAnlage}></UnitCreateForm>
|
||||
*/}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
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, ListHeader, ListHeaderItem, ListItem, ListItemAction, ListItemContent, ListItemDescription, ListItemTitle } from "@/components/ui/list";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import Breadcrumbs from "@/components/ui/navigation/breadcrumbs";
|
||||
import { Card, CardContent, CardHeader } from "@/components/ui/card";
|
||||
import { GroupPath } from "@/components/rk2/groups/groupPath";
|
||||
import { api_groups } from "@/actions/rk2/api-groups";
|
||||
import { AusgabeUnitInfo } from "@/components/rk2/ausgabe/ausgabeUnitInfo";
|
||||
|
||||
|
||||
|
||||
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" }]
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* Main-Nav */}
|
||||
<div>
|
||||
<Breadcrumbs items={breadcrumb} />
|
||||
</div>
|
||||
|
||||
<Card className="flex flex-col m-4 w-170 ">
|
||||
<CardHeader>Units</CardHeader>
|
||||
|
||||
<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>
|
||||
</Button>
|
||||
|
||||
|
||||
<List variant={"transparent"} >
|
||||
<ListHeader>
|
||||
<ListHeaderItem className="w-50">Gruppe</ListHeaderItem>
|
||||
<ListHeaderItem className="w-50">Unit</ListHeaderItem>
|
||||
<ListHeaderItem>Typ</ListHeaderItem>
|
||||
</ListHeader>
|
||||
{units.map((unit) => (
|
||||
<ListItem hover={true} key={unit.id}>
|
||||
<ListItemContent >
|
||||
<ListItemTitle className="flex">
|
||||
<div className="w-50">
|
||||
<GroupPath groups={groups} groupId={unit.groupId} />
|
||||
</div>
|
||||
<div className="w-50">
|
||||
{unit.prefix}_{unit.bmk}_{unit.name}{unit.postfix ? "_"+unit.postfix:""}
|
||||
</div>
|
||||
<div className="w-20">
|
||||
{unit.type}
|
||||
</div>
|
||||
</ListItemTitle>
|
||||
<ListItemDescription className="ps-50 pt-1 flex gap-2">
|
||||
{unit.components?.map((comp) => <div key={comp.id}>
|
||||
{comp.prefix && comp.prefix}
|
||||
{comp.name}
|
||||
{comp.postfix && comp.postfix}
|
||||
{comp.index && comp.index>0 ? comp.index:""}
|
||||
</div>)}
|
||||
</ListItemDescription>
|
||||
</ListItemContent>
|
||||
<ListItemAction>
|
||||
<Button variant={"secondary"} size={"xs"} >
|
||||
<Link href={`/rk2/units/edit/${unit.id}`}>Auswahl</Link>
|
||||
</Button>
|
||||
</ListItemAction>
|
||||
</ListItem>
|
||||
|
||||
))}
|
||||
</List>
|
||||
</Card >
|
||||
<Card>
|
||||
<CardHeader>Ausgabe</CardHeader>
|
||||
<CardContent>
|
||||
<AusgabeUnitInfo units={units} groups={groups} />
|
||||
</CardContent>
|
||||
</Card>
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user