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,105 @@
|
||||
|
||||
|
||||
|
||||
export default async function PageElements() {
|
||||
|
||||
return (
|
||||
<div className="p-4">
|
||||
<section>
|
||||
<div className="font-bold">Gruppe</div>
|
||||
<ul>
|
||||
<li>G35</li>
|
||||
<li>Name:Gurtförderr</li>
|
||||
<li>Typ:Band</li>
|
||||
<section className="ps-8">
|
||||
<div className="font-bold">Elemente</div>
|
||||
<ul className="ps-8">
|
||||
<li className="flex gap-4">
|
||||
<div className="w-15 font-bold">Name:</div>
|
||||
<div className="">Motor</div>
|
||||
</li>
|
||||
<li>Seilzug</li>
|
||||
<li>Repschalter</li>
|
||||
<li>Schieflauf</li>
|
||||
<li>Vorortbedienung</li>
|
||||
<li>Endschalter</li>
|
||||
<li>FU</li>
|
||||
<li>Drehzahl</li>
|
||||
</ul>
|
||||
</section>
|
||||
</ul>
|
||||
</section>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
/*
|
||||
(Group)BA3
|
||||
(Group)H-Förderer
|
||||
(Group)G35 Band
|
||||
(Element) Motor 1
|
||||
(Element) Motor 2
|
||||
(Element) Drehzahl vorne
|
||||
(Element) Reperaturschalter
|
||||
(Element) Reissleine
|
||||
(Element) Endschalter
|
||||
(Element) Visu
|
||||
|
||||
*/
|
||||
|
||||
interface Group {
|
||||
id: number,
|
||||
name: string,
|
||||
nr: string,
|
||||
container: boolean
|
||||
groups?: Group[]
|
||||
}
|
||||
|
||||
interface Unit {
|
||||
group: Group
|
||||
typ: string,
|
||||
name: string,
|
||||
componentes: Componente[]
|
||||
}
|
||||
|
||||
type Componente = ComponenteMotor | ComponenteSchieflauf;
|
||||
|
||||
interface ComponenteBase {
|
||||
name: string,
|
||||
typ: string,
|
||||
|
||||
|
||||
}
|
||||
|
||||
interface ComponenteMotor extends ComponenteBase {
|
||||
motorEigenschaften: string //nur Platzhalter momentan
|
||||
|
||||
}
|
||||
|
||||
interface ComponenteSchieflauf {
|
||||
name: string,
|
||||
trueOK:boolean
|
||||
|
||||
}
|
||||
|
||||
const beispielBand: Unit = {
|
||||
group: {
|
||||
id: 1,
|
||||
name: "BA4",
|
||||
nr: '100',
|
||||
container: true
|
||||
},
|
||||
typ: "Band",
|
||||
name: "Förderband zu 1234",
|
||||
componentes: [{
|
||||
name: "Antrieb",
|
||||
typ: "Motor",
|
||||
motorEigenschaften: "platzhalter Beispiel"
|
||||
},
|
||||
{
|
||||
name: "Schieflauf",
|
||||
typ: "Schieflauf",
|
||||
trueOK: true
|
||||
},
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
"use client";
|
||||
|
||||
import Modal from "@/components/ui/Modal";
|
||||
import { useRouter } from "next/navigation";
|
||||
|
||||
interface Props{
|
||||
test:string
|
||||
}
|
||||
|
||||
export default function AggregateDetails({test}:Props) {
|
||||
const router = useRouter();
|
||||
|
||||
return (
|
||||
<Modal goBack={true}>
|
||||
|
||||
|
||||
<h2>Produktdetails</h2>
|
||||
|
||||
<p>Hier stehen die detaillierten Informationen.</p>
|
||||
|
||||
<button onClick={() => router.back()}>
|
||||
Schließen
|
||||
</button>
|
||||
|
||||
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
|
||||
export default function Default() {
|
||||
return null
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
export default async function DetailsPage({
|
||||
params,
|
||||
}: {
|
||||
params: Promise<{ id: string }>;
|
||||
}) {
|
||||
const { id } = await params;
|
||||
|
||||
return (
|
||||
<main>
|
||||
<h1>Details für Produkt {id}</h1>
|
||||
|
||||
<p>
|
||||
Diese Seite wird angezeigt, wenn man direkt
|
||||
/produkte/{id}/details aufruft.
|
||||
</p>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
export default function Layout({
|
||||
children,
|
||||
modal,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
modal: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
{children}
|
||||
{modal}
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
import { Sites } from "@/_config/sites";
|
||||
import { api_ProconAggregate_GetById } from "@/actions/procon/api-procon-aggregate";
|
||||
import Visualisierungen from "@/components/procon/Visualsierungen";
|
||||
|
||||
|
||||
import Link from "next/link";
|
||||
|
||||
type Props = {
|
||||
params: Promise<{
|
||||
id: string;
|
||||
}>;
|
||||
};
|
||||
|
||||
export default async function PageAggregateDetail({ params }: Props) {
|
||||
const { id } = await params;
|
||||
const data = await api_ProconAggregate_GetById(Number(id));
|
||||
|
||||
|
||||
return (
|
||||
<div className=" ">
|
||||
|
||||
{/* Überschrift Leiste */}
|
||||
<div className="p-4 border-1 m-1 flex gap-4 mb-6">
|
||||
<Link href={Sites.main.url}>{Sites.main.name}</Link>
|
||||
<Link href={Sites.procon.aggregate.url}>{Sites.procon.aggregate.name}</Link>
|
||||
</div>
|
||||
|
||||
{/* Aggregat Base Data */}
|
||||
<div>
|
||||
<div className="ps-4 flex gap-4">
|
||||
<div className="font-bold">Anlage :</div>
|
||||
<div>{data.anlage}</div>
|
||||
</div>
|
||||
|
||||
<div className="ps-8 flex gap-4">
|
||||
<div className="font-bold w-30">Agg Nr :</div>
|
||||
<div>{data.aggNr}</div>
|
||||
</div>
|
||||
|
||||
<div className="ps-8 flex gap-4">
|
||||
<div className="font-bold w-30">Bezeichnung :</div>
|
||||
<div>{data.bezeichnung}</div>
|
||||
</div>
|
||||
|
||||
<div className="ps-8 flex gap-4">
|
||||
<div className="font-bold w-30">SPS Name :</div>
|
||||
<div>{data.viewName}</div>
|
||||
</div>
|
||||
|
||||
<div className="ps-8 flex gap-4">
|
||||
<div className="font-bold w-30">BMK :</div>
|
||||
<div>{data.bmk}</div>
|
||||
</div>
|
||||
<div>ss <Link href={`/procon/aggregate/${id}/details`}>Modal</Link></div>
|
||||
|
||||
</div>
|
||||
|
||||
{/* Visualisrung Elemente Anzeigen */}
|
||||
<div className="p-4 m-4 border-1 gap-8 w-400 rounded-lg border-gray-200">
|
||||
{data.visuElements ?
|
||||
<Visualisierungen visuElements={data.visuElements} />:
|
||||
<div>Keine Daten</div>
|
||||
|
||||
}
|
||||
</div>
|
||||
{false &&
|
||||
<div className="flex flex-col m-4 w-300 ">
|
||||
{JSON.stringify(data, null, 2)}
|
||||
{id}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
import { Sites } from "@/_config/sites";
|
||||
import { api_ProconAggregate_GetAll } from "@/actions/procon/api-procon-aggregate";
|
||||
|
||||
import Link from "next/link";
|
||||
|
||||
|
||||
export default async function PageAggregate() {
|
||||
const aggregate = await api_ProconAggregate_GetAll();
|
||||
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 ">
|
||||
{aggregate.map((anlage) => (
|
||||
<div key={anlage.Id}
|
||||
className="grid grid-cols-[50px_100px_200px_200px_200px_200px] gap-4 p-2 border-b-1 border-l-1 border-r-1 first:border-t-1">
|
||||
<div>
|
||||
{anlage.Id}
|
||||
</div>
|
||||
<div>
|
||||
{anlage.SPSAntriebId}
|
||||
</div>
|
||||
<div>
|
||||
{anlage.Bezeichnung}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
{anlage.BMK}
|
||||
</div>
|
||||
<div>
|
||||
{anlage.ViewName}
|
||||
</div>
|
||||
<div>
|
||||
<Link href={Sites.procon.aggregate.url+"/"+anlage.SPSAntriebId}>Auswahl</Link>
|
||||
</div>
|
||||
</div>))}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
import { Sites } from "@/_config/sites";
|
||||
import { api_ProconAggregate_GetAll } from "@/actions/procon/api-procon-aggregate";
|
||||
|
||||
import Link from "next/link";
|
||||
|
||||
|
||||
export default async function PageAggregate() {
|
||||
|
||||
const topics = [
|
||||
{ name: Sites.procon.aggregate.name, url: Sites.procon.aggregate.url },
|
||||
{ name: Sites.procon.texteVisu.name, url: Sites.procon.texteVisu.url },
|
||||
{ name: "Visu Texte",url: Sites.procon.texteVisu.url },
|
||||
{ name: "SVG Test",url: Sites.procon.svgTest.url }
|
||||
]
|
||||
|
||||
|
||||
return (
|
||||
<div className="">
|
||||
<Link href={Sites.main.url}>{Sites.main.name}</Link>
|
||||
<div className="flex flex-col m-4 w-300 ">
|
||||
{topics.map((top) => (
|
||||
|
||||
<Link href={top.url} key={top.name+top.url}>
|
||||
{top.name}
|
||||
</Link>
|
||||
))}
|
||||
</div>
|
||||
</div >
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
"use client"
|
||||
import { Sites } from "@/_config/sites";
|
||||
import { api_ProconAggregate_GetAll } from "@/actions/procon/api-procon-aggregate";
|
||||
import SvgView from "@/components/procon/svg/SvgView";
|
||||
import { xamlToSvg } from "@/components/procon/svg/xaml_to_svg";
|
||||
|
||||
import Link from "next/link";
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
const x = `<?xml version="1.0" ?>
|
||||
<Viewbox xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||
<Canvas Width="24" Height="24">
|
||||
|
||||
<Canvas>
|
||||
<Ellipse Canvas.Left="0" Canvas.Top="0" Width="24" Height="24" StrokeThickness="1" Stroke="#000000" Fill="#808080" ></Ellipse>
|
||||
<TextBlock Canvas.Left="5"
|
||||
Canvas.Top="0"
|
||||
Foreground="#000000"
|
||||
Text="M"
|
||||
FontSize="16"
|
||||
FontWeight="Bold"/>
|
||||
</Canvas>
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
`
|
||||
export default function PageSVG() {
|
||||
|
||||
const [xaml, setXaml] = useState(x);
|
||||
|
||||
const getContent = () => {
|
||||
try {
|
||||
return <SvgView svg={xamlToSvg(xaml, { pretty: true })}></SvgView>;
|
||||
} catch (error) {
|
||||
|
||||
|
||||
console.log('Unbekannter fehler')
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="">
|
||||
<textarea className="w-300" name="svg" id="1" value={xaml} onChange={(e) => setXaml(() => e.target.value)} >
|
||||
|
||||
</textarea>
|
||||
{
|
||||
getContent()
|
||||
}
|
||||
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
|
||||
import { Sites } from "@/_config/sites";
|
||||
import { api_anlage_getSelected, api_anlage_setSelected, api_anlagen_getAll } from "@/actions/rk/api-anlage";
|
||||
import AnlageColumn from "@/components/rk/anlage/anlageColumn";
|
||||
import Link from "next/link";
|
||||
|
||||
|
||||
export default async function PageAnlagen() {
|
||||
const anlagen = await api_anlagen_getAll();
|
||||
const currentAnlage = await api_anlage_getSelected();
|
||||
|
||||
return (
|
||||
<div className="">
|
||||
<Link href={Sites.main.url}>{Sites.main.name}</Link>
|
||||
<div className="flex flex-col m-4">
|
||||
{anlagen.map((anlage) =>
|
||||
<AnlageColumn key={anlage.id} data={anlage} isSelected={anlage.id === currentAnlage.id} />
|
||||
)}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
import { Sites } from "@/_config/sites";
|
||||
import { api_anlage_getSelected } from "@/actions/rk/api-anlage";
|
||||
import { api_ElementsGet } from "@/actions/rk/api-element";
|
||||
import { api_GroupAll } from "@/actions/rk/api-groups";
|
||||
import ElementCreateView from "@/components/rk/elements/elementCreateView";
|
||||
|
||||
|
||||
import Link from "next/link";
|
||||
|
||||
export default async function PageElementNew() {
|
||||
const groups = await api_GroupAll();
|
||||
const currentAnlage = await api_anlage_getSelected()
|
||||
const elements = await api_ElementsGet();
|
||||
return (
|
||||
<div className="">
|
||||
<div className="border-1 flex gap-4 p-4">
|
||||
<div className="rounded-lg bg-gray-100 p-2">
|
||||
<Link href={Sites.elements.url}>{Sites.elements.name}</Link>
|
||||
</div>
|
||||
<div>
|
||||
<Link href={Sites.main.url}>{Sites.main.name}</Link>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ElementCreateView analge={currentAnlage} elements={elements} groups={groups} />
|
||||
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
import { Sites } from "@/_config/sites";
|
||||
import { api_ElementsGet } from "@/actions/rk/api-element";
|
||||
import { api_GroupAll } from "@/actions/rk/api-groups";
|
||||
import ElementView from "@/components/rk/elements/elementsView";
|
||||
|
||||
|
||||
import Link from "next/link";
|
||||
|
||||
export default async function PageElements() {
|
||||
const elements = await api_ElementsGet();
|
||||
const groups = await api_GroupAll();
|
||||
|
||||
return (
|
||||
<div className="">
|
||||
<div className="border-1 flex gap-4 p-4">
|
||||
<div className="rounded-lg bg-gray-100 p-2">
|
||||
<Link href={Sites.main.url}>{Sites.main.name}</Link>
|
||||
</div>
|
||||
<div className="rounded-lg bg-gray-100 p-2">
|
||||
<Link href={Sites.elements.new.url}>{Sites.elements.new.name}</Link>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<ElementView elements={elements} groups={groups}></ElementView>
|
||||
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
import { Sites } from "@/_config/sites";
|
||||
import { api_anlage_getSelected } from "@/actions/rk/api-anlage";
|
||||
import { api_GroupAll } from "@/actions/rk/api-groups";
|
||||
import { GroupEdit } from "@/components/rk/groups/group_Edit";
|
||||
import { GroupEditList } from "@/components/rk/groups/group_edit_list";
|
||||
import GroupView from "@/components/rk/groups/groupView";
|
||||
|
||||
|
||||
import Link from "next/link";
|
||||
|
||||
export default async function PageGroupNew() {
|
||||
const groups = await api_GroupAll();
|
||||
const anlage = await api_anlage_getSelected()
|
||||
|
||||
return (
|
||||
<div className="">
|
||||
<div className="border-1 flex gap-4 p-4">
|
||||
<div className="rounded-lg bg-gray-100 p-2">
|
||||
<Link href={Sites.groups.url}>{Sites.groups.name}</Link>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Link href={Sites.main.url}>{Sites.main.name}</Link>
|
||||
{/*<GroupEdit anlage={anlage} debug={true}></GroupEdit>*/}
|
||||
<GroupEditList data={groups} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
import { Sites } from "@/_config/sites";
|
||||
import { api_GroupAll } from "@/actions/rk/api-groups";
|
||||
import GroupView from "@/components/rk/groups/groupView";
|
||||
|
||||
|
||||
import Link from "next/link";
|
||||
|
||||
export default async function PageGroups() {
|
||||
const groups = await api_GroupAll();
|
||||
|
||||
return (
|
||||
<div className="">
|
||||
|
||||
<div className="border-1 flex gap-4 p-4">
|
||||
<div className="rounded-lg bg-gray-100 p-2">
|
||||
<Link href={Sites.main.url}>{Sites.main.name}</Link>
|
||||
</div>
|
||||
<div className="rounded-lg bg-gray-100 p-2">
|
||||
<Link href={Sites.groups.new.url}>{Sites.groups.new.name}</Link>
|
||||
</div>
|
||||
</div>
|
||||
<GroupView groups={groups}></GroupView>
|
||||
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
import { Sites } from "@/_config/sites";
|
||||
import { api_GroupAll } from "@/actions/rk/api-groups";
|
||||
import { api_LogNoteGet } from "@/actions/rk/api-logNote";
|
||||
import GroupView from "@/components/rk/groups/groupView";
|
||||
import LogNoteView from "@/components/rk/logNote/logNoteView";
|
||||
|
||||
|
||||
import Link from "next/link";
|
||||
|
||||
export default async function PageGroups() {
|
||||
const notes = await api_LogNoteGet();
|
||||
|
||||
return (
|
||||
<div className="">
|
||||
|
||||
<div className="border-1 flex gap-4 p-4">
|
||||
<div className="rounded-lg bg-gray-100 p-2">
|
||||
<Link href={Sites.main.url}>{Sites.main.name}</Link>
|
||||
</div>
|
||||
<div className="rounded-lg bg-gray-100 p-2">
|
||||
<Link href={Sites.logNote.new.url}>{Sites.logNote.new.name}</Link>
|
||||
</div>
|
||||
</div>
|
||||
<LogNoteView notes={notes}></LogNoteView>
|
||||
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
import { Sites } from "@/_config/sites";
|
||||
import { PeripherieFindApi, GetEA_Differences } from "@/actions/rk/api-peripherie";
|
||||
import Link from "next/link";
|
||||
|
||||
export default async function PagePeripherie() {
|
||||
const peripheries = await GetEA_Differences();
|
||||
|
||||
return (
|
||||
<div className="">
|
||||
<div className="flex justify-center font-bold ">
|
||||
<div className="text-[24px]">
|
||||
|
||||
E/A Unterschiede
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex gap-4 p-2 p-4 border-1">
|
||||
<div className="bg-sky-200 p-2 rounded-md">
|
||||
<Link href={Sites.main.url}>{Sites.main.name}</Link>
|
||||
|
||||
</div>
|
||||
<div className="bg-sky-200 p-2 rounded-md">
|
||||
<Link href={Sites.peripheries.url}>{Sites.peripheries.name}</Link>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
{peripheries.map((p) => (<div key={p.id} className="grid grid-cols-[100px_600px_600px] mt-4 ms-4">
|
||||
<div>
|
||||
{p.adrType}{p.adrByte}.{p.adrBit}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
{p.text}
|
||||
</div>
|
||||
<div>
|
||||
{p.excelData?.functionText}
|
||||
</div>
|
||||
|
||||
</div>))}
|
||||
|
||||
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
import { Sites } from "@/_config/sites";
|
||||
import { api_ElementsGet } from "@/actions/rk/api-element";
|
||||
import { api_GroupAll } from "@/actions/rk/api-groups";
|
||||
import { PeripherieFindApi } from "@/actions/rk/api-peripherie";
|
||||
import PeripherieListView from "@/components/rk/peripherie/peripherieListView";
|
||||
|
||||
import Link from "next/link";
|
||||
|
||||
|
||||
export default async function PagePeripherie() {
|
||||
const peripheries = await PeripherieFindApi(); //{ groupId: "exists" }
|
||||
const groups = await api_GroupAll();
|
||||
const elmente = await api_ElementsGet();
|
||||
|
||||
|
||||
|
||||
return (
|
||||
<div className="">
|
||||
<div className="border-1 m-4 flex gap-4 p-4">
|
||||
<div className="bg-gray-100 p-2 rounded-lg">
|
||||
<Link href={Sites.main.url}>{Sites.main.name}</Link>
|
||||
|
||||
</div>
|
||||
<div className="bg-gray-100 p-2 rounded-lg">
|
||||
<Link href={Sites.peripheries.differences.url}>{Sites.peripheries.differences.name}</Link>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<PeripherieListView peripheries={peripheries} groups={groups} elemente={elmente} />
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -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>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,142 @@
|
||||
"use client";
|
||||
|
||||
import { DndContext, closestCenter, DragOverlay, useDroppable } from "@dnd-kit/core";
|
||||
import {
|
||||
arrayMove,
|
||||
SortableContext,
|
||||
useSortable,
|
||||
verticalListSortingStrategy,
|
||||
|
||||
} from "@dnd-kit/sortable";
|
||||
import { CSS } from "@dnd-kit/utilities";
|
||||
import { useState } from "react";
|
||||
import type { DragEndEvent, DragStartEvent } from "@dnd-kit/core";
|
||||
import { SortableItem } from "@/components/test_dnd";
|
||||
import { DroppableContainer } from "@/components/ui/droppableContainer";
|
||||
|
||||
interface TestItem {
|
||||
id: string,
|
||||
name: string
|
||||
}
|
||||
|
||||
export default function Page() {
|
||||
const [left, setLeft] = useState<TestItem[]>([{ id: "1", name: "Apfel" }, { id: "2", name: "Banane" }]);
|
||||
const [right, setRight] = useState<TestItem[]>([{ id: "3", name: "Traube" }]);
|
||||
|
||||
const [activeItem, setActiveItem] = useState<TestItem | null>(null);
|
||||
|
||||
function findContainer(id: string) {
|
||||
if (left.find((item) => item.id === id)) return "left";
|
||||
if (right.find((item) => item.id === id)) return "right";
|
||||
return null;
|
||||
}
|
||||
|
||||
function handleDragStart(event: DragStartEvent) {
|
||||
const { active } = event;
|
||||
|
||||
const item =
|
||||
left.find((i) => i.id === active.id) ||
|
||||
right.find((i) => i.id === active.id);
|
||||
|
||||
if (item) setActiveItem(item);
|
||||
}
|
||||
|
||||
function handleDragEnd(event: DragEndEvent) {
|
||||
|
||||
const { active, over } = event;
|
||||
setActiveItem(null);
|
||||
if (!over) return;
|
||||
|
||||
const overId = over.id;
|
||||
|
||||
const activeContainer = findContainer(active.id as string);
|
||||
|
||||
const overContainer =
|
||||
overId === "left" || overId === "right"
|
||||
? overId
|
||||
: findContainer(overId as string);
|
||||
|
||||
|
||||
|
||||
|
||||
if (!activeContainer || !overContainer) return;
|
||||
|
||||
// 🔁 Innerhalb gleicher Liste sortieren
|
||||
if (activeContainer === overContainer) {
|
||||
if (activeContainer === "left") {
|
||||
const oldIndex = left.findIndex((i) => i.id === active.id);
|
||||
const newIndex = left.findIndex((i) => i.id === over.id);
|
||||
|
||||
setLeft(arrayMove(left, oldIndex, newIndex));
|
||||
}
|
||||
|
||||
if (activeContainer === "right") {
|
||||
const oldIndex = right.findIndex((i) => i.id === active.id);
|
||||
const newIndex = right.findIndex((i) => i.id === over.id);
|
||||
|
||||
setRight(arrayMove(right, oldIndex, newIndex));
|
||||
}
|
||||
|
||||
} else {
|
||||
if (activeContainer === "left") {
|
||||
const item = left.find((i) => i.id === active.id);
|
||||
if (!item) return;
|
||||
|
||||
setLeft(left.filter((i) => i.id !== active.id));
|
||||
setRight([...right, item]);
|
||||
}
|
||||
|
||||
if (activeContainer === "right") {
|
||||
const item = right.find((i) => i.id === active.id);
|
||||
if (!item) return;
|
||||
|
||||
setRight(right.filter((i) => i.id !== active.id));
|
||||
setLeft([...left, item]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div style={{ padding: 40 }}>
|
||||
<DndContext collisionDetection={closestCenter} onDragStart={handleDragStart} onDragEnd={handleDragEnd}>
|
||||
<div className="flex gap-10 border-1">
|
||||
<DroppableContainer id="left">
|
||||
<SortableContext items={left.map(i => i.id)} strategy={verticalListSortingStrategy}>
|
||||
<div className="border-1 p-4">
|
||||
<h3>Links</h3>
|
||||
{left.map((item) => (
|
||||
<SortableItem key={item.id} item={item} ><div>Test</div></SortableItem>
|
||||
))}
|
||||
</div>
|
||||
</SortableContext>
|
||||
</DroppableContainer>
|
||||
|
||||
<DroppableContainer id="right">
|
||||
<SortableContext items={right.map(i => i.id)} strategy={verticalListSortingStrategy}>
|
||||
<div className="border-1 p-4">
|
||||
<h3>Rechts</h3>
|
||||
{right.map((item) => (
|
||||
<SortableItem key={item.id} item={item} ><div>Test</div></SortableItem>
|
||||
))}
|
||||
</div>
|
||||
</SortableContext>
|
||||
</DroppableContainer>
|
||||
</div>
|
||||
{/* DRAG OVERLAY */}
|
||||
<DragOverlay>
|
||||
{activeItem ? (
|
||||
<div
|
||||
style={{
|
||||
padding: 12,
|
||||
border: "1px solid black",
|
||||
background: "lightyellow",
|
||||
}}
|
||||
>
|
||||
{activeItem.id} {activeItem.name}
|
||||
</div>
|
||||
) : null}
|
||||
</DragOverlay>
|
||||
</DndContext>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import { uploadFile } from "@/actions/rk/api-file-uplaod";
|
||||
|
||||
export default function UploadPage() {
|
||||
return (
|
||||
<form action={uploadFile}>
|
||||
<input type="file" name="file" />
|
||||
<button type="submit">Upload</button>
|
||||
</form>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import { drawGetSvg } from "@/actions/rk/api-draw";
|
||||
import { api_VisuElementsAll } from "@/actions/rk/api-visuElements";
|
||||
import VisuCreatePlatform from "@/components/visu/create/visuCreatePlatform";
|
||||
import VisuContent from "@/components/visu/visuContent";
|
||||
|
||||
export default async function PageVisu() {
|
||||
|
||||
|
||||
|
||||
|
||||
return (
|
||||
<div className="">
|
||||
<VisuCreatePlatform />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
|
||||
import { api_ElementsGet } from "@/actions/rk/api-element";
|
||||
import { api_VisuElementsAll } from "@/actions/rk/api-visuElements";
|
||||
import VisuElementsList from "@/components/visu/visuElements/visuElementsList";
|
||||
|
||||
|
||||
export default async function PageVisuElemente() {
|
||||
|
||||
const visuElements = await api_VisuElementsAll();
|
||||
const elements = await api_ElementsGet();
|
||||
|
||||
if(!visuElements) {
|
||||
return <div>Loading...</div>
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="">
|
||||
<VisuElementsList visuElements={visuElements} elements={elements}></VisuElementsList>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
import { Sites } from "@/_config/sites";
|
||||
import { api_ElementsGet } from "@/actions/rk/api-element";
|
||||
import { api_GroupAll } from "@/actions/rk/api-groups";
|
||||
import { api_VisuElementsAll } from "@/actions/rk/api-visuElements";
|
||||
import VisuAddGroups from "@/components/visu/visuAddGroups";
|
||||
|
||||
|
||||
|
||||
import Link from "next/link";
|
||||
|
||||
|
||||
export default async function PageGroups() {
|
||||
const groups = await api_GroupAll();
|
||||
const elements = await api_ElementsGet();
|
||||
const visuElements = await api_VisuElementsAll();
|
||||
|
||||
if(!groups || !visuElements) return <div>Loading...</div>
|
||||
|
||||
return (
|
||||
<div className="">
|
||||
<Link href={Sites.main.url}>{Sites.main.name}</Link>
|
||||
<div>
|
||||
<VisuAddGroups groups={groups} elements={elements} visuElements={visuElements}></VisuAddGroups>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import { VisuElementsProvider } from "@/_context/visu/VisuElementsProvider";
|
||||
import { drawGetSvg } from "@/actions/rk/api-draw";
|
||||
import { api_VisuElementsAll } from "@/actions/rk/api-visuElements";
|
||||
import VisuContent from "@/components/visu/visuContent";
|
||||
|
||||
export default async function PageVisu() {
|
||||
|
||||
const visuElements = await api_VisuElementsAll();
|
||||
console.log('reander')
|
||||
|
||||
if(!visuElements) {
|
||||
console.log('reload!!!')
|
||||
return <div>Loading...</div>
|
||||
}
|
||||
return (
|
||||
<div className="">
|
||||
<VisuElementsProvider initialValues={visuElements}>
|
||||
<VisuContent />
|
||||
</VisuElementsProvider>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
import { VisuElementsProvider } from "@/_context/visu/VisuElementsProvider";
|
||||
import { api_drawData } from "@/actions/draw/api-draw";
|
||||
import { drawGetSvg } from "@/actions/rk/api-draw";
|
||||
import { api_VisuElementsAll } from "@/actions/rk/api-visuElements";
|
||||
import { Card, CardContent, CardHeader } from "@/components/ui/card";
|
||||
import { SvgShow } from "@/components/visu/draw/svgShow";
|
||||
import VisuContent from "@/components/visu/visuContent";
|
||||
|
||||
export default async function PageShowDraw() {
|
||||
|
||||
const data = await api_drawData();
|
||||
|
||||
|
||||
|
||||
return (
|
||||
<div className="bg-gray-200">
|
||||
<svg
|
||||
width="180%"
|
||||
height="180%"
|
||||
viewBox={`${0} ${0} ${1820} ${1120}`}
|
||||
>
|
||||
<rect x1={1} y1={0} width={1750} height={1500} fill="#fee0fe" stroke="#000" strokeWidth={1} />
|
||||
|
||||
<SvgShow svg={data.svg} />
|
||||
|
||||
</svg>
|
||||
|
||||
{true &&
|
||||
<Card positons={"start"}>
|
||||
<CardHeader variant={"danger"} >Debug</CardHeader>
|
||||
<CardContent className="ps-8">
|
||||
<pre>{JSON.stringify(data, null, 2)}</pre>
|
||||
|
||||
</CardContent>
|
||||
</Card>
|
||||
}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user