jurmy24 commited on
Commit
41b4066
·
1 Parent(s): 6bc7874

fix: roll back URDF changes and fix only what is needed

Browse files
Dockerfile CHANGED
@@ -22,18 +22,9 @@ RUN npm install
22
  # Copy the entire viewer directory
23
  COPY --chown=user viewer/ .
24
 
25
- # # Debug: List all files in the src/components directory
26
- # RUN echo "=== Listing src/components directory ===" && \
27
- # ls -la src/components && \
28
- # echo "=== Listing UrdfViewer file specifically ===" && \
29
- # ls -la src/components/UrdfViewer* && \
30
- # echo "=== Current working directory ===" && \
31
- # pwd && \
32
- # echo "=== Directory structure ===" && \
33
- # find . -type f -name "*.tsx" | sort
34
-
35
- # Ensure proper file permissions
36
- RUN chmod -R 755 .
37
 
38
  # Build the application
39
  RUN npm run build
@@ -42,4 +33,4 @@ RUN npm run build
42
  EXPOSE 7860
43
 
44
  # Start the application
45
- CMD ["npm", "run", "preview", "--", "--port", "7860", "--host"]
 
22
  # Copy the entire viewer directory
23
  COPY --chown=user viewer/ .
24
 
25
+ # Ensure proper file permissions and ownership
26
+ RUN chmod -R 755 . && \
27
+ chown -R user:user .
 
 
 
 
 
 
 
 
 
28
 
29
  # Build the application
30
  RUN npm run build
 
33
  EXPOSE 7860
34
 
35
  # Start the application
36
+ CMD ["npm", "run", "preview", "--", "--port", "7860", "--host"]
viewer/nginx.conf DELETED
@@ -1,10 +0,0 @@
1
- server {
2
- listen 7860;
3
- server_name localhost;
4
-
5
- location / {
6
- root /usr/share/nginx/html;
7
- index index.html index.htm;
8
- try_files $uri $uri/ /index.html;
9
- }
10
- }
 
 
 
 
 
 
 
 
 
 
 
viewer/src/components/UrdfViewer.tsx CHANGED
@@ -18,12 +18,12 @@ if (typeof window !== "undefined" && !customElements.get("urdf-viewer")) {
18
  }
19
 
20
  // Extend the interface for the URDF viewer element to include background property
21
- interface URDFViewerElement extends HTMLElement {
22
  background?: string;
23
  setJointValue?: (jointName: string, value: number) => void;
24
  }
25
 
26
- const URDFViewer: React.FC = () => {
27
  const { theme } = useTheme();
28
  const isDarkMode = theme === "dark";
29
  const containerRef = useRef<HTMLDivElement>(null);
@@ -34,7 +34,7 @@ const URDFViewer: React.FC = () => {
34
  // Add state for animation control
35
  useState<boolean>(isDefaultModel);
36
  const cleanupAnimationRef = useRef<(() => void) | null>(null);
37
- const viewerRef = useRef<URDFViewerElement | null>(null);
38
  const hasInitializedRef = useRef<boolean>(false);
39
 
40
  // Add state for custom URDF path
@@ -171,4 +171,4 @@ const URDFViewer: React.FC = () => {
171
  );
172
  };
173
 
174
- export default URDFViewer;
 
18
  }
19
 
20
  // Extend the interface for the URDF viewer element to include background property
21
+ interface UrdfViewerElement extends HTMLElement {
22
  background?: string;
23
  setJointValue?: (jointName: string, value: number) => void;
24
  }
25
 
26
+ const UrdfViewer: React.FC = () => {
27
  const { theme } = useTheme();
28
  const isDarkMode = theme === "dark";
29
  const containerRef = useRef<HTMLDivElement>(null);
 
34
  // Add state for animation control
35
  useState<boolean>(isDefaultModel);
36
  const cleanupAnimationRef = useRef<(() => void) | null>(null);
37
+ const viewerRef = useRef<UrdfViewerElement | null>(null);
38
  const hasInitializedRef = useRef<boolean>(false);
39
 
40
  // Add state for custom URDF path
 
171
  );
172
  };
173
 
174
+ export default UrdfViewer;
viewer/src/components/layout/Layout.tsx CHANGED
@@ -1,7 +1,7 @@
1
  import React, { useState, useEffect } from "react";
2
  import UrdfViewer from "@/components/UrdfViewer";
3
  import { Sidebar, SidebarBody } from "@/components/ui/sidebar";
4
- import { LayoutDashboard, PanelLeft, RotateCcw } from "lucide-react";
5
  import { useUrdf } from "@/hooks/useUrdf";
6
  import { Button } from "../ui/button";
7
  import { useTheme } from "@/hooks/useTheme";
 
1
  import React, { useState, useEffect } from "react";
2
  import UrdfViewer from "@/components/UrdfViewer";
3
  import { Sidebar, SidebarBody } from "@/components/ui/sidebar";
4
+ import { PanelLeft, RotateCcw } from "lucide-react";
5
  import { useUrdf } from "@/hooks/useUrdf";
6
  import { Button } from "../ui/button";
7
  import { useTheme } from "@/hooks/useTheme";