my-windows-app / app.py
FlashCode-Lab's picture
Update app.py
ec42609 verified
import streamlit as st
st.set_page_config(page_title="系统控制台", layout="wide")
# 强制深色主题和隐藏多余元素
st.markdown("""
<style>
.reportview-container { background: #1e1e1e; }
.stDeployButton {display:none;}
footer {visibility: hidden;}
</style>
""", unsafe_allow_html=True)
# 顶部状态栏
col_t1, col_t2 = st.columns([8, 1])
with col_t1:
st.caption("🌐 远程服务器连接成功 | 状态: 正常 | 延迟: 24ms")
with col_t2:
if st.button("🔴 注销"):
st.rerun()
st.divider()
# 主界面分区
left_nav, main_window = st.columns([2, 7])
with left_nav:
st.subheader("📁 系统菜单")
task = st.selectbox("功能选择", ["运行中心", "安全审计", "终端命令", "网络设置"])
st.progress(85, text="磁盘剩余空间")
st.button("🔄 刷新系统")
with main_window:
if task == "运行中心":
st.header("🚀 自动化任务")
col_a, col_b = st.columns(2)
col_a.metric("并发连接", "128", "+12%")
col_b.metric("内存占用", "1.2 GB", "-5%")
st.line_chart([10, 25, 15, 40, 30, 60]) # 模拟波动图
elif task == "终端命令":
st.header("💻 系统终端")
cmd = st.text_input("输入 Python 命令:", "print('Hello Security')")
if st.button("执行"):
st.code(f"执行结果: \n>>> {cmd}\nSuccess.")