Spaces:
Build error
Build error
Raymond Weitekamp commited on
Commit ·
35ad182
1
Parent(s): bb32d19
Fix viewer URL to use localhost instead of 0.0.0.0
Browse files- cadviewer.py +3 -2
cadviewer.py
CHANGED
|
@@ -97,7 +97,8 @@ def check_viewer_ready():
|
|
| 97 |
"""Check if the viewer is ready by attempting a test connection"""
|
| 98 |
try:
|
| 99 |
import requests
|
| 100 |
-
|
|
|
|
| 101 |
return response.status_code == 200
|
| 102 |
except:
|
| 103 |
return False
|
|
@@ -189,7 +190,7 @@ with ui.splitter().classes(
|
|
| 189 |
ui.timer(3.0, lambda: None, once=True) # Wait for viewer to be ready
|
| 190 |
ocpcv = (
|
| 191 |
ui.element("iframe")
|
| 192 |
-
.props('src="http://
|
| 193 |
.classes("h-[calc(100vh-3rem)]")
|
| 194 |
)
|
| 195 |
|
|
|
|
| 97 |
"""Check if the viewer is ready by attempting a test connection"""
|
| 98 |
try:
|
| 99 |
import requests
|
| 100 |
+
# Use localhost for the check since we're checking from inside the container
|
| 101 |
+
response = requests.get('http://localhost:3939/viewer')
|
| 102 |
return response.status_code == 200
|
| 103 |
except:
|
| 104 |
return False
|
|
|
|
| 190 |
ui.timer(3.0, lambda: None, once=True) # Wait for viewer to be ready
|
| 191 |
ocpcv = (
|
| 192 |
ui.element("iframe")
|
| 193 |
+
.props('src="http://localhost:3939/viewer"') # Use localhost for the iframe
|
| 194 |
.classes("h-[calc(100vh-3rem)]")
|
| 195 |
)
|
| 196 |
|