Update app.py
Browse files1 unmodified line234567891011121 unmodified lineimport streamlit as stimport streamlit.components.v1 as components# 从环境变量中读取 backend 的值backend_url = os.getenv("backend", "https://default-url.com") # 如果环境变量不存在,则使用默认 URL# 构造 iframe 的 HTML 代码iframe_html = f'<iframe src="{backend_url}" width="100%" height="800"></iframe>'# 使用 Streamlit 的 HTML 组件来展示 iframecomponents.html(iframe_html, height=800)1 unmodified line2345678910111 unmodified lineimport streamlit as stimport streamlit.components.v1 as componentsst.set_page_config(layout="wide")backend_url = os.getenv("backend", "https://shlab.org.cn") # 如果环境变量不存在,则使用默认 URLiframe_html = f'<iframe src="{backend_url}" width="100%" height="800"></iframe>'components.html(iframe_html, height=800)
app.py+3-4