diff --git a/frontend/Dockerfile b/frontend/Dockerfile index e86373d..e7f0433 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -1,14 +1,20 @@ -# Build stage -FROM node:22-alpine AS builder +FROM node:22-alpine AS build + WORKDIR /app + COPY package*.json ./ RUN npm ci + COPY . . + RUN npm run build -# Production stage FROM nginx:alpine -COPY --from=builder /app/dist /usr/share/nginx/html +RUN apk add --no-cache curl + +COPY --from=build /app/dist /usr/share/nginx/html COPY nginx.conf /etc/nginx/conf.d/default.conf + EXPOSE 80 -CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file + +CMD ["nginx", "-g", "daemon off;"] diff --git a/frontend/index.html b/frontend/index.html index 2d44bf5..f94d687 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -1,13 +1,13 @@ - +
-Keine Blöcke gefunden.
- )} - - {/* Create Block Dialog */} - {showCreateDialog && ( -Keine Blöcke in dieser Kategorie.
)} ); diff --git a/frontend/src/components/CADCanvas.jsx b/frontend/src/components/CADCanvas.jsx index 17620e8..905e435 100644 --- a/frontend/src/components/CADCanvas.jsx +++ b/frontend/src/components/CADCanvas.jsx @@ -43,37 +43,6 @@ const CADCanvas = forwardRef(({ activeTool, setActiveTool, onCanvasReady }, ref) if (shape) fabricRef.current.add(shape); }); fabricRef.current.renderAll(); - }, - // Get selected elements for block creation - getSelectedElements: () => { - if (!fabricRef.current) return []; - const activeObject = fabricRef.current.getActiveObject(); - if (!activeObject) return []; - - // If it's a group, return all objects in the group - if (activeObject.type === 'group') { - return activeObject.getObjects().map(obj => ({ - id: obj.id || Date.now() + Math.random(), - type: obj.type, - ...obj.toObject(['id', 'type', 'left', 'top', 'width', 'height', 'radius', 'x1', 'y1', 'x2', 'y2', 'points', 'fill', 'stroke', 'strokeWidth']) - })); - } - - // If it's a single object, return it - return [{ - id: activeObject.id || Date.now() + Math.random(), - type: activeObject.type, - ...activeObject.toObject(['id', 'type', 'left', 'top', 'width', 'height', 'radius', 'x1', 'y1', 'x2', 'y2', 'points', 'fill', 'stroke', 'strokeWidth']) - }]; - }, - // Generate SVG data for selected elements - generateSvgData: () => { - if (!fabricRef.current) return ''; - const activeObject = fabricRef.current.getActiveObject(); - if (!activeObject) return ''; - - // Clone the object to avoid modifying the original - return activeObject.toSVG(); } })); diff --git a/frontend/src/components/CanvasArea.tsx b/frontend/src/components/CanvasArea.tsx deleted file mode 100644 index e482b5e..0000000 --- a/frontend/src/components/CanvasArea.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import React, { forwardRef } from 'react'; -import './CanvasArea.css'; -import CADCanvas from './CADCanvas'; - -const CanvasArea = forwardRef((_, ref) => { - return ( -- Kein Element ausgewählt. Wähle ein Element auf dem Canvas, um seine Eigenschaften zu bearbeiten. -
-Keine Zeichnungen vorhanden.
+ ) : ( +| Name | Zuletzt geändert | Aktionen |
|---|---|---|
| {d.name} | +{new Date(d.updatedAt).toLocaleString()} | ++ + + | +
{error}
} + ++ Kein Konto? Registrieren +
+{error}
} + ++ Bereits registriert? Anmelden +
+