Dmitry Beresnev commited on
Commit
844d8b8
·
1 Parent(s): 91ca971

fix openclaw ui main page rendering issue

Browse files
Files changed (2) hide show
  1. Dockerfile +4 -3
  2. app.py +2 -12
Dockerfile CHANGED
@@ -7,6 +7,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
7
  bash \
8
  curl \
9
  ca-certificates \
 
10
  ffmpeg \
11
  git \
12
  && curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
@@ -31,8 +32,8 @@ ENV VAULT_PATH=/app/vault
31
  ENV OPENCLAW_HOME=/app/.openclaw
32
  ENV OPENCLAW_STATE_DIR=/app/.openclaw/state
33
  ENV AUTO_START_GATEWAY=0
34
- ENV EXTERNAL_GATEWAY_MANAGED=0
35
- ENV OPENCLAW_STANDARD_UI_PUBLIC_URL=
36
  ENV OPENCLAW_GATEWAY_LOG_PATH=/tmp/openclaw-gateway.log
37
  ENV OPENCLAW_GATEWAY_ERR_LOG_PATH=/tmp/openclaw-gateway.err.log
38
 
@@ -40,4 +41,4 @@ RUN mkdir -p /app/vault /app/.openclaw/state
40
 
41
  EXPOSE 7860
42
 
43
- CMD ["sh", "-c", "( ${OPENCLAW_BIN} gateway run --port ${OPENCLAW_PORT} --bind loopback --allow-unconfigured --dev --verbose || ${OPENCLAW_BIN} gateway --port ${OPENCLAW_PORT} --bind loopback --allow-unconfigured --dev --verbose ) > /tmp/openclaw-gateway.log 2> /tmp/openclaw-gateway.err.log & exec uv run streamlit run app.py --server.address=0.0.0.0 --server.port=7860"]
 
7
  bash \
8
  curl \
9
  ca-certificates \
10
+ caddy \
11
  ffmpeg \
12
  git \
13
  && curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
 
32
  ENV OPENCLAW_HOME=/app/.openclaw
33
  ENV OPENCLAW_STATE_DIR=/app/.openclaw/state
34
  ENV AUTO_START_GATEWAY=0
35
+ ENV EXTERNAL_GATEWAY_MANAGED=1
36
+ ENV OPENCLAW_STANDARD_UI_PUBLIC_URL=/openclaw/
37
  ENV OPENCLAW_GATEWAY_LOG_PATH=/tmp/openclaw-gateway.log
38
  ENV OPENCLAW_GATEWAY_ERR_LOG_PATH=/tmp/openclaw-gateway.err.log
39
 
 
41
 
42
  EXPOSE 7860
43
 
44
+ CMD ["sh", "-c", "( ${OPENCLAW_BIN} gateway run --port ${OPENCLAW_PORT} --bind loopback --allow-unconfigured --dev --verbose || ${OPENCLAW_BIN} gateway --port ${OPENCLAW_PORT} --bind loopback --allow-unconfigured --dev --verbose ) > /tmp/openclaw-gateway.log 2> /tmp/openclaw-gateway.err.log & uv run streamlit run app.py --server.address=0.0.0.0 --server.port=8501 > /tmp/streamlit.log 2>&1 & exec caddy run --config /app/Caddyfile --adapter caddyfile"]
app.py CHANGED
@@ -412,9 +412,7 @@ with std_ui_status_col:
412
  ui_status_text = "Available" if ui_ok else f"HTTP {ui_resp.status_code}"
413
  except Exception:
414
  ui_ok = False
415
- st.markdown(
416
- f"Status: {':green_circle:' if ui_ok else ':red_circle:'} {ui_status_text}"
417
- )
418
  st.caption(f"URL: {std_ui_url}")
419
  if OPENCLAW_STANDARD_UI_PUBLIC_URL:
420
  st.caption(f"Public URL: {OPENCLAW_STANDARD_UI_PUBLIC_URL}")
@@ -425,15 +423,7 @@ with std_ui_embed_col:
425
  components.iframe(public_ui_url, height=560, scrolling=True)
426
  st.link_button("Open Standard UI", public_ui_url, use_container_width=True)
427
  else:
428
- try:
429
- local_resp = requests.get(std_ui_url, timeout=3, allow_redirects=True)
430
- if local_resp.status_code < 500 and local_resp.text.strip():
431
- components.html(local_resp.text, height=560, scrolling=True)
432
- st.caption("Rendered from internal gateway response.")
433
- else:
434
- st.info("Standard UI is not reachable yet. Start gateway and refresh.")
435
- except Exception:
436
- st.info("Standard UI is not reachable yet. Start gateway and refresh.")
437
 
438
  st.divider()
439
 
 
412
  ui_status_text = "Available" if ui_ok else f"HTTP {ui_resp.status_code}"
413
  except Exception:
414
  ui_ok = False
415
+ st.markdown(f"Status: {'🟢' if ui_ok else '🔴'} {ui_status_text}")
 
 
416
  st.caption(f"URL: {std_ui_url}")
417
  if OPENCLAW_STANDARD_UI_PUBLIC_URL:
418
  st.caption(f"Public URL: {OPENCLAW_STANDARD_UI_PUBLIC_URL}")
 
423
  components.iframe(public_ui_url, height=560, scrolling=True)
424
  st.link_button("Open Standard UI", public_ui_url, use_container_width=True)
425
  else:
426
+ st.info("Standard UI is not reachable yet. Start gateway and refresh.")
 
 
 
 
 
 
 
 
427
 
428
  st.divider()
429