opc meldunge parameter fehler io
This commit is contained in:
1 parent
58338ee07c
commit
0e7b53e558
87 files changed
+1500
-8
No files matched your search
@@ -0,0 +1,3 @@
|
||||
import {api_aggregatMeldungen} from '@/actions/fehlerliste/api-aggregat-meldungen';
|
||||
import AggregatMeldungenTable from '@/components/fehlerliste/aggregatMeldungenTable';
|
||||
export default async function Page(){try{return <AggregatMeldungenTable initial={await api_aggregatMeldungen()}/>;}catch(cause){return <p role="alert">{cause instanceof Error?cause.message:'Aggregatmeldungen konnten nicht geladen werden.'}</p>;}}
|
||||
@@ -0,0 +1,8 @@
|
||||
export async function GET(request:Request,{params}:{params:Promise<{id:string}>}){
|
||||
const {id}=await params,file=new URL(request.url).searchParams.get('file')??'manifest.json';
|
||||
try{const response=await fetch('http://localhost:3000/rk2/backups/'+encodeURIComponent(id)+'/file?file='+encodeURIComponent(file),{cache:'no-store'});
|
||||
if(!response.ok)return new Response('Sicherungsdatei nicht verfügbar',{status:response.status});
|
||||
const filename=file.split('/').pop()?.replace(/[^A-Za-z0-9_.-]/g,'_')??'backup.json';
|
||||
return new Response(response.body,{headers:{'Content-Type':response.headers.get('Content-Type')??'application/json','Content-Disposition':'attachment; filename="'+filename+'"','Cache-Control':'no-store'}});
|
||||
}catch{return new Response('Keine Verbindung zum Backend',{status:502});}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
import {api_backups} from '@/actions/backup/api-backup';
|
||||
import BackupPanel from '@/components/backup/backupPanel';
|
||||
export default async function Page(){try{return <BackupPanel initial={await api_backups()}/>;}catch(cause){return <p role="alert">{cause instanceof Error?cause.message:'Datensicherungen konnten nicht geladen werden.'}</p>;}}
|
||||
@@ -0,0 +1,6 @@
|
||||
import { api_fehlerliste } from '@/actions/fehlerliste/api-fehlerliste';
|
||||
import FehlerTable from '@/components/fehlerliste/fehlerTable';
|
||||
export default async function Page() {
|
||||
try { return <FehlerTable initial={await api_fehlerliste()} editable />; }
|
||||
catch (cause) { return <p role="alert">{cause instanceof Error ? cause.message : 'Fehlerliste konnte nicht geladen werden.'}</p>; }
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
export async function GET() {
|
||||
try {
|
||||
const response = await fetch('http://localhost:3000/rk2/fehlerliste/export', { cache: 'no-store' });
|
||||
if (!response.ok) return new Response('Fehlerlisten-Export fehlgeschlagen', { status: 502 });
|
||||
return new Response(response.body, { headers: { 'Content-Type': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||
'Content-Disposition': 'attachment; filename="Fehlerliste.xlsx"', 'Cache-Control': 'no-store' } });
|
||||
} catch { return new Response('Keine Verbindung zum Backend', { status: 502 }); }
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import { api_fehlerliste } from '@/actions/fehlerliste/api-fehlerliste';
|
||||
import FehlerTable from '@/components/fehlerliste/fehlerTable';
|
||||
export default async function Page() {
|
||||
try { return <FehlerTable initial={await api_fehlerliste()} />; }
|
||||
catch (cause) { return <p role="alert">{cause instanceof Error ? cause.message : 'Fehlerliste konnte nicht geladen werden.'}</p>; }
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
export const dynamic = 'force-dynamic';
|
||||
export const runtime = 'nodejs';
|
||||
export async function GET(request: Request) {
|
||||
const params = new URL(request.url).searchParams, anlageId = params.get('anlageId'), token = params.get('token');
|
||||
if (!anlageId || !token || !/^[a-f0-9]{64}$/.test(token)) return new Response('Anlagenbild fehlt', { status: 400 });
|
||||
try {
|
||||
const response = await fetch('http://localhost:3000/rk2/digital-opc/scene/events?anlageId=' + encodeURIComponent(anlageId) + '&token=' + encodeURIComponent(token), { cache: 'no-store', signal: request.signal });
|
||||
if (!response.ok) return new Response('Live-Verbindung nicht erreichbar', { status: response.status });
|
||||
return new Response(response.body, { headers: { 'Content-Type': 'text/event-stream', 'Cache-Control': 'no-cache, no-transform', 'X-Accel-Buffering': 'no' } });
|
||||
} catch { return new Response('Backend nicht erreichbar', { status: 502 }); }
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import { api_digitalLiveScene } from '@/actions/sensoren/api-digital-opc';
|
||||
import LiveAnlage from '@/components/live-anlage/liveAnlage';
|
||||
export default async function Page() {
|
||||
try { return <LiveAnlage initial={await api_digitalLiveScene()} />; }
|
||||
catch (cause) { return <p role="alert">{cause instanceof Error ? cause.message : 'Anlagenbild nicht erreichbar'}</p>; }
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
import {api_motorOpc} from '@/actions/sensoren/api-motor-opc';
|
||||
import MotorOpcConfig from '@/components/opcua/motorOpcConfig';
|
||||
export default async function Page({searchParams}:{searchParams:Promise<{componentId?:string}>}){try{const [data,params]=await Promise.all([api_motorOpc(),searchParams]);return <MotorOpcConfig initial={data} initialId={params.componentId??''}/>;}catch(cause){return <p role="alert">{cause instanceof Error?cause.message:'Motorzuordnung nicht erreichbar'}</p>;}}
|
||||
@@ -0,0 +1,3 @@
|
||||
import {api_elementParameters} from '@/actions/parameter/api-element-parameter';
|
||||
import ElementParameterTable from '@/components/parameter/elementParameterTable';
|
||||
export default async function Page(){try{return <ElementParameterTable initial={await api_elementParameters('beschriftungen')}/>;}catch(cause){return <p role="alert">{cause instanceof Error?cause.message:'Beschriftungen konnten nicht geladen werden.'}</p>;}}
|
||||
@@ -0,0 +1,4 @@
|
||||
import {notFound} from 'next/navigation';
|
||||
import {api_elementParameters} from '@/actions/parameter/api-element-parameter';
|
||||
import ElementParameterTable from '@/components/parameter/elementParameterTable';
|
||||
export default async function Page({params}:{params:Promise<{kind:string}>}){const {kind}=await params;if(kind!=='aggregate'&&kind!=='analog'&&kind!=='digital')notFound();try{return <ElementParameterTable key={kind} initial={await api_elementParameters(kind)}/>;}catch(cause){return <p role="alert">{cause instanceof Error?cause.message:'Parameter konnten nicht geladen werden.'}</p>;}}
|
||||
@@ -0,0 +1,6 @@
|
||||
import { api_digitalOpc } from '@/actions/sensoren/api-digital-opc';
|
||||
import DigitalLiveStatus from '@/components/sensoren/digitalLiveStatus';
|
||||
export default async function Page({ searchParams }: { searchParams: Promise<{ sensorId?: string }> }) {
|
||||
try { const [initial, params] = await Promise.all([api_digitalOpc(), searchParams]); return <DigitalLiveStatus initial={initial} initialSensorId={typeof params.sensorId === 'string' ? params.sensorId : ''} />; }
|
||||
catch (cause) { return <p role="alert">{cause instanceof Error ? cause.message : 'Live-Status konnte nicht geladen werden'}</p>; }
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
export const dynamic='force-dynamic';
|
||||
export const runtime='nodejs';
|
||||
export async function GET(request:Request){
|
||||
const params=new URL(request.url).searchParams;
|
||||
if(!['anlageId','connectionId','unitId','token'].every(k=>params.get(k))||!/^[a-f0-9]{64}$/.test(params.get('token')??''))return new Response('Prüfung und Unit fehlen',{status:400});
|
||||
const query=new URLSearchParams();for(const key of ['anlageId','connectionId','unitId','token'])query.set(key,params.get(key)!);
|
||||
try{const r=await fetch('http://localhost:3000/rk2/io-diagnostics/events?'+query,{cache:'no-store',signal:request.signal});if(!r.ok)return new Response('Live-Verbindung nicht verfügbar',{status:r.status});return new Response(r.body,{headers:{'Content-Type':'text/event-stream','Cache-Control':'no-cache, no-transform','X-Accel-Buffering':'no'}});}catch{return new Response('Backend nicht erreichbar',{status:502});}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
import {api_ioDiagnosticConfig} from '@/actions/opcua/api-io-diagnostics';
|
||||
import IoDiagnostics from '@/components/opcua/ioDiagnostics';
|
||||
export default async function Page(){try{return <IoDiagnostics initial={await api_ioDiagnosticConfig()}/>;}catch(cause){return <p role="alert">{cause instanceof Error?cause.message:'E/A-Diagnose konnte nicht geladen werden.'}</p>;}}
|
||||
@@ -0,0 +1,15 @@
|
||||
export const dynamic = 'force-dynamic';
|
||||
export const runtime = 'nodejs';
|
||||
export async function GET(request: Request) {
|
||||
const params = new URL(request.url).searchParams;
|
||||
const name = params.get('name'), anlageId = params.get('anlageId');
|
||||
if (!name || !anlageId || !/^[A-Za-z_][A-Za-z0-9_]{0,79}$/.test(name)) return new Response('Struktur fehlt', { status: 400 });
|
||||
const sensorId = params.get('sensorId'), expectedId = params.get('expectedId');
|
||||
if (sensorId && !/^[\w-]{1,80}$/.test(sensorId)) return new Response('Ungültiger Sensor', { status: 400 });
|
||||
try {
|
||||
const target = sensorId ? 'http://localhost:3000/rk2/digital-opc/' + encodeURIComponent(sensorId) + '/events?anlageId=' + encodeURIComponent(anlageId) + '&expectedId=' + encodeURIComponent(expectedId ?? '') : 'http://localhost:3000/rk2/opcua-structures/' + encodeURIComponent(name) + '/live?anlageId=' + encodeURIComponent(anlageId) + '&expectedId=' + encodeURIComponent(expectedId ?? '');
|
||||
const response = await fetch(target, { cache: 'no-store', signal: request.signal });
|
||||
if (!response.ok) return new Response('Live-Verbindung fehlgeschlagen', { status: response.status });
|
||||
return new Response(response.body, { headers: { 'Content-Type': 'text/event-stream', 'Cache-Control': 'no-cache, no-transform', 'X-Accel-Buffering': 'no' } });
|
||||
} catch { return new Response('Backend nicht erreichbar', { status: 502 }); }
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import { api_opcConfiguration } from '@/actions/opcua/api-opcua';
|
||||
import { api_structures } from '@/actions/opcua/api-structures';
|
||||
import StructuresPanel from '@/components/opcua/structuresPanel';
|
||||
export default async function Page() {
|
||||
try {
|
||||
const [initial, connections] = await Promise.all([api_structures(), api_opcConfiguration()]);
|
||||
if (initial.anlageId !== connections.anlageId) return <p role="alert">Anlage gewechselt. Bitte neu laden.</p>;
|
||||
return <StructuresPanel initial={initial} connections={connections} />;
|
||||
} catch (cause) { return <p role="alert">{cause instanceof Error ? cause.message : 'Strukturen nicht erreichbar'}</p>; }
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
export async function GET(request: Request) {
|
||||
const params = new URL(request.url).searchParams;
|
||||
const id = params.get('id'), anlageId = params.get('anlageId');
|
||||
if (!id || !anlageId) return new Response('Verbindung fehlt', { status: 400 });
|
||||
try {
|
||||
const response = await fetch('http://localhost:3000/rk2/opcua/' + encodeURIComponent(id) + '/certificate?anlageId=' + encodeURIComponent(anlageId), { cache: 'no-store' });
|
||||
if (!response.ok) return new Response('Zertifikat konnte nicht geladen werden. Anlage und Verbindung pruefen.', { status: response.status });
|
||||
return new Response(response.body, { headers: { 'Content-Type': 'application/x-pem-file', 'Content-Disposition': 'attachment; filename="RK-OpcUaClient.pem"', 'Cache-Control': 'no-store' } });
|
||||
} catch { return new Response('Backend nicht erreichbar', { status: 502 }); }
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import { api_opcConfiguration } from '@/actions/opcua/api-opcua';
|
||||
import OpcPanel from '@/components/opcua/opcPanel';
|
||||
export default async function Page() {
|
||||
try { return <OpcPanel initial={await api_opcConfiguration()} />; }
|
||||
catch (cause) { return <p role="alert">{cause instanceof Error ? cause.message : 'OPC-Konfiguration nicht erreichbar'}</p>; }
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import Link from 'next/link';
|
||||
export default function Page() {
|
||||
return <div className="space-y-3"><h1 className="text-xl font-semibold">SPS-Exporte</h1><p>Tabgetrennte Listen aus den gespeicherten Excel-Zuordnungen zum Kopieren.</p>
|
||||
<ul className="space-y-2">{[['aggregate', 'Aggregate'], ['sensoren-digital', 'Sensoren Digital'], ['sensoren-analog', 'Sensoren Analog']].map(([path, label]) => <li key={path}><Link className="underline" href={'/sps/' + path}>{label}</Link></li>)}</ul>
|
||||
<ul className="space-y-2">{[['opcua', 'OPC-UA-Verbindungen'], ['aggregate', 'Aggregate'], ['sensoren-digital', 'Sensoren Digital'], ['sensoren-analog', 'Sensoren Analog']].map(([path, label]) => <li key={path}><Link className="underline" href={'/sps/' + path}>{label}</Link></li>)}</ul>
|
||||
</div>;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
import {api_simulation} from '@/actions/opcua/api-io-simulation';
|
||||
import IoSimulation from '@/components/opcua/ioSimulation';
|
||||
export default async function Page(){try{return <IoSimulation initial={await api_simulation()}/>;}catch(cause){return <p role="alert">{cause instanceof Error?cause.message:'Simulation konnte nicht geladen werden.'}</p>;}}
|
||||
Reference in new issue
Block a user