Njap-png commited on
Commit ·
c006d88
1
Parent(s): 68515ba
Embed AGRON dashboard in Gradio app
Browse files
app.py
CHANGED
|
@@ -987,6 +987,16 @@ with gr.Blocks(title="Agron Neural Interface") as demo:
|
|
| 987 |
stop_evolve_btn = gr.Button("Stop")
|
| 988 |
update_btn = gr.Button("Self-update")
|
| 989 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 990 |
def respond(message, history):
|
| 991 |
if not message.strip():
|
| 992 |
return history, ""
|
|
|
|
| 987 |
stop_evolve_btn = gr.Button("Stop")
|
| 988 |
update_btn = gr.Button("Self-update")
|
| 989 |
|
| 990 |
+
# Embedded sci-fi dashboard (served via data URL)
|
| 991 |
+
try:
|
| 992 |
+
import base64 as _b64
|
| 993 |
+
_dash_html = open(os.path.join(ROOT, "agron_dashboard.html")).read()
|
| 994 |
+
_dash_b64 = _b64.b64encode(_dash_html.encode()).decode()
|
| 995 |
+
with gr.Accordion("AGRØN Dashboard HUD", open=True):
|
| 996 |
+
gr.HTML(f'<iframe src="data:text/html;base64,{_dash_b64}" style="width:100%;height:80vh;border:0;border-radius:12px;" sandbox="allow-scripts allow-same-origin allow-forms"></iframe>')
|
| 997 |
+
except Exception as e:
|
| 998 |
+
gr.Markdown(f"Dashboard not available: {e}")
|
| 999 |
+
|
| 1000 |
def respond(message, history):
|
| 1001 |
if not message.strip():
|
| 1002 |
return history, ""
|