Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
CHANGED
|
@@ -70,12 +70,39 @@ def inject_custom_css():
|
|
| 70 |
color: #444;
|
| 71 |
letter-spacing: 1px;
|
| 72 |
}
|
| 73 |
-
/*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
[data-testid="stMainMenu"] {
|
| 75 |
position: fixed !important;
|
| 76 |
top: 0.35rem !important;
|
| 77 |
right: 0.5rem !important;
|
| 78 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 79 |
/* 减少标题上方空白 */
|
| 80 |
.block-container { padding-top: 1.5rem !important; }
|
| 81 |
</style>
|
|
@@ -92,24 +119,9 @@ st.markdown(
|
|
| 92 |
unsafe_allow_html=True,
|
| 93 |
)
|
| 94 |
|
| 95 |
-
# 未登录时显示
|
| 96 |
if not st.session_state.get("current_user"):
|
| 97 |
-
st.
|
| 98 |
-
"""
|
| 99 |
-
<div style="text-align:center; color:#888; padding:80px 20px 20px;">
|
| 100 |
-
<div style="font-size:52px; margin-bottom:16px;">🤖</div>
|
| 101 |
-
<div style="font-size:20px; font-weight:600; margin-bottom:10px;">欢迎使用智答 AI 助手</div>
|
| 102 |
-
<div style="font-size:15px; line-height:2;">
|
| 103 |
-
🌐 <b>联网模式</b> —— 大模型 + 网络搜索,实时回答<br>
|
| 104 |
-
📚 <b>知识库模式</b> —— 上传文档,基于私有知识回答<br>
|
| 105 |
-
</div>
|
| 106 |
-
<div style="margin-top:18px; font-size:13px; color:#aaa;">
|
| 107 |
-
👈 请先在左侧面板<b>登录</b>或<b>注册</b>后开始使用
|
| 108 |
-
</div>
|
| 109 |
-
</div>
|
| 110 |
-
""",
|
| 111 |
-
unsafe_allow_html=True,
|
| 112 |
-
)
|
| 113 |
|
| 114 |
# =========================
|
| 115 |
# 1.5 Supabase 客户端初始化
|
|
|
|
| 70 |
color: #444;
|
| 71 |
letter-spacing: 1px;
|
| 72 |
}
|
| 73 |
+
/* 侧边栏展开后的收起按钮 */
|
| 74 |
+
[data-testid="stSidebarCollapseButton"] button {
|
| 75 |
+
background: #f0f2f6 !important;
|
| 76 |
+
border-radius: 8px !important;
|
| 77 |
+
padding: 4px 10px !important;
|
| 78 |
+
border: 1px solid #ddd !important;
|
| 79 |
+
}
|
| 80 |
+
[data-testid="stSidebarCollapseButton"] button svg { display: none !important; }
|
| 81 |
+
[data-testid="stSidebarCollapseButton"] button::after {
|
| 82 |
+
content: "✕ 收起";
|
| 83 |
+
font-size: 14px;
|
| 84 |
+
color: #444;
|
| 85 |
+
letter-spacing: 1px;
|
| 86 |
+
}
|
| 87 |
+
/* 右上角三点菜单:替换为「⚙ 设置」按钮风格 */
|
| 88 |
[data-testid="stMainMenu"] {
|
| 89 |
position: fixed !important;
|
| 90 |
top: 0.35rem !important;
|
| 91 |
right: 0.5rem !important;
|
| 92 |
}
|
| 93 |
+
[data-testid="stMainMenu"] button {
|
| 94 |
+
background: #f0f2f6 !important;
|
| 95 |
+
border-radius: 8px !important;
|
| 96 |
+
padding: 4px 10px !important;
|
| 97 |
+
border: 1px solid #ddd !important;
|
| 98 |
+
}
|
| 99 |
+
[data-testid="stMainMenu"] button svg { display: none !important; }
|
| 100 |
+
[data-testid="stMainMenu"] button::before {
|
| 101 |
+
content: "⚙ 设置";
|
| 102 |
+
font-size: 14px;
|
| 103 |
+
color: #444;
|
| 104 |
+
letter-spacing: 1px;
|
| 105 |
+
}
|
| 106 |
/* 减少标题上方空白 */
|
| 107 |
.block-container { padding-top: 1.5rem !important; }
|
| 108 |
</style>
|
|
|
|
| 119 |
unsafe_allow_html=True,
|
| 120 |
)
|
| 121 |
|
| 122 |
+
# 未登录时显示简洁引导(登录后由 chat_box 内的欢迎页接管)
|
| 123 |
if not st.session_state.get("current_user"):
|
| 124 |
+
st.caption("👈 请在左侧面板**登录**或**注册**后开始使用")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 125 |
|
| 126 |
# =========================
|
| 127 |
# 1.5 Supabase 客户端初始化
|