refactor(developer-portal): split iace, docs, byoeh pages
Extract each page into colocated _components/ sections to bring page.tsx files from 1008/891/769 LOC down to 57/23/21 LOC, well within the 500-line hard cap. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
95
developer-portal/app/api/iace/_components/HazardsSection.tsx
Normal file
95
developer-portal/app/api/iace/_components/HazardsSection.tsx
Normal file
@@ -0,0 +1,95 @@
|
||||
'use client'
|
||||
|
||||
import { ApiEndpoint, CodeBlock, InfoBox } from '@/components/DevPortalLayout'
|
||||
|
||||
export function HazardsSection() {
|
||||
return (
|
||||
<>
|
||||
<h2>Hazards & Pattern Matching</h2>
|
||||
<p>
|
||||
Gefahrenanalyse nach ISO 12100 mit 102 Hazard-Patterns. Die Pattern-Matching-Engine
|
||||
erkennt automatisch Gefahren basierend auf Maschinentyp, Komponenten und Energiequellen.
|
||||
</p>
|
||||
|
||||
<InfoBox type="info" title="102 Hazard-Patterns">
|
||||
Die Engine enthaelt 102 vordefinierte Gefahrenmuster (HP001-HP102), die nach
|
||||
ISO 12100 Anhang A kategorisiert sind: mechanisch, elektrisch, thermisch, Laerm,
|
||||
Vibration, Strahlung, Materialien/Substanzen und ergonomisch.
|
||||
</InfoBox>
|
||||
|
||||
<ApiEndpoint method="POST" path="/sdk/v1/iace/projects/:id/hazards" description="Neue Gefahr erstellen" />
|
||||
<ApiEndpoint method="GET" path="/sdk/v1/iace/projects/:id/hazards" description="Alle Gefahren des Projekts auflisten" />
|
||||
<ApiEndpoint method="PUT" path="/sdk/v1/iace/projects/:id/hazards/:hid" description="Gefahr aktualisieren" />
|
||||
|
||||
<ApiEndpoint method="POST" path="/sdk/v1/iace/projects/:id/hazards/suggest" description="KI-gestuetzte Gefahrenvorschlaege generieren" />
|
||||
|
||||
<CodeBlock language="bash" filename="cURL">
|
||||
{`curl -X POST "https://api.breakpilot.io/sdk/v1/iace/projects/proj_a1b2c3d4/hazards/suggest" \\
|
||||
-H "Authorization: Bearer YOUR_API_KEY"`}
|
||||
</CodeBlock>
|
||||
|
||||
<h3>Response (200 OK)</h3>
|
||||
<CodeBlock language="json" filename="Response">
|
||||
{`{
|
||||
"success": true,
|
||||
"data": {
|
||||
"suggestions": [
|
||||
{
|
||||
"hazard_type": "mechanical",
|
||||
"title": "Quetschgefahr durch bewegliche Roboterarme",
|
||||
"description": "Unkontrollierte Bewegung der Achsen kann zu Quetschungen fuehren",
|
||||
"iso_reference": "ISO 12100 Anhang A.1",
|
||||
"severity": "high",
|
||||
"confidence": 0.91
|
||||
},
|
||||
{
|
||||
"hazard_type": "electrical",
|
||||
"title": "Stromschlaggefahr bei Wartungsarbeiten",
|
||||
"description": "Zugang zu spannungsfuehrenden Teilen bei geoeffnetem Schaltschrank",
|
||||
"iso_reference": "ISO 12100 Anhang A.2",
|
||||
"severity": "critical",
|
||||
"confidence": 0.87
|
||||
}
|
||||
]
|
||||
}
|
||||
}`}
|
||||
</CodeBlock>
|
||||
|
||||
<ApiEndpoint method="POST" path="/sdk/v1/iace/projects/:id/match-patterns" description="Pattern-Matching-Engine ausfuehren (102 Patterns)" />
|
||||
|
||||
<CodeBlock language="bash" filename="cURL">
|
||||
{`curl -X POST "https://api.breakpilot.io/sdk/v1/iace/projects/proj_a1b2c3d4/match-patterns" \\
|
||||
-H "Authorization: Bearer YOUR_API_KEY"`}
|
||||
</CodeBlock>
|
||||
|
||||
<h3>Response (200 OK)</h3>
|
||||
<CodeBlock language="json" filename="Response">
|
||||
{`{
|
||||
"success": true,
|
||||
"data": {
|
||||
"total_patterns_checked": 102,
|
||||
"matches": 14,
|
||||
"results": [
|
||||
{
|
||||
"pattern_id": "HP003",
|
||||
"title": "Crushing hazard from linear actuator",
|
||||
"category": "mechanical",
|
||||
"match_score": 0.94,
|
||||
"matched_components": ["Servo-Antrieb Achse 1", "Linearfuehrung"],
|
||||
"matched_energy_sources": ["EN03"],
|
||||
"suggested_hazard": {
|
||||
"title": "Quetschgefahr durch Linearantrieb",
|
||||
"severity": "high"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}`}
|
||||
</CodeBlock>
|
||||
|
||||
<ApiEndpoint method="POST" path="/sdk/v1/iace/projects/:id/apply-patterns" description="Pattern-Matching-Ergebnisse als Gefahren uebernehmen" />
|
||||
<ApiEndpoint method="POST" path="/sdk/v1/iace/projects/:id/hazards/:hid/suggest-measures" description="Massnahmenvorschlaege fuer eine Gefahr generieren" />
|
||||
<ApiEndpoint method="POST" path="/sdk/v1/iace/projects/:id/mitigations/:mid/suggest-evidence" description="Evidenz-Vorschlaege fuer eine Massnahme generieren" />
|
||||
</>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user