Updated URL's - BAD BOY - USE ENV VARS!!

Moved MV creation to celery(Not tested yet)
This commit is contained in:
2025-07-11 15:21:19 +09:30
parent 138dc90c4e
commit 416b52f82b
18 changed files with 374 additions and 1608 deletions
+15 -6
View File
@@ -1,9 +1,11 @@
import streamlit as st
import requests
import socketio
import os
# API endpoint
API_URL = "http://localhost:6001/api/connected_clients"
# Base URL pulled from environment variable
BASE_URL = os.getenv("SOCKET_SERVER_URL", "http://172.17.0.1:6101")
API_URL = f"{BASE_URL}/api/connected_clients"
def load_clients():
response = requests.get(API_URL)
@@ -14,7 +16,8 @@ def load_clients():
def render():
# Initialize SocketIO client
sio = socketio.Client()
sio.connect("http://localhost:6001")
sio.connect(BASE_URL)
st.title("Connected Clients")
clients = load_clients()
@@ -22,8 +25,14 @@ def render():
if clients:
selected_client = st.selectbox("Select a Worker ID", [client["worker_id"] for client in clients])
st.write("## Connected Clients")
st.table([{ "Worker ID": c["worker_id"], "Socket ID": c["socket_id"], "IP Address": c["ip"] } for c in clients])
st.table([
{
"Worker ID": c["worker_id"],
"Socket ID": c["socket_id"],
"IP Address": c["ip"]
} for c in clients
])
if selected_client:
st.write("## Send Message")
message = st.text_area("Enter your message:")
@@ -36,4 +45,4 @@ def render():
else:
st.warning("No connected clients found.")
render()
render()