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,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