Spaces:
Sleeping
Sleeping
Keldos
commited on
Commit
·
8b5c04c
1
Parent(s):
657f21e
WIP: 调整右栏tab,关于,更新弹窗等样式
Browse files
ChuanhuChatbot.py
CHANGED
@@ -152,7 +152,7 @@ with gr.Blocks(theme=small_and_beautiful_theme) as demo:
|
|
152 |
with gr.Column(elem_id="toolbox-area", scale=1):
|
153 |
with gr.Box(elem_id="chuanhu-toolbox"): # For CSS setting, there is an extra box. Don't remove it.
|
154 |
with gr.Row():
|
155 |
-
gr.Markdown("##
|
156 |
gr.HTML(get_html("close_btn.html").format(obj="toolbox"), elem_classes="close-btn")
|
157 |
with gr.Tabs(elem_id="chuanhu-toolbox-tabs"):
|
158 |
with gr.Tab(label=i18n("Prompt")):
|
@@ -188,65 +188,8 @@ with gr.Blocks(theme=small_and_beautiful_theme) as demo:
|
|
188 |
container=False,
|
189 |
)
|
190 |
with gr.Tab(label=i18n("Parameters")):
|
191 |
-
gr.Markdown("will be here soon...")
|
192 |
-
with gr.Tab(label=i18n("Extensions")):
|
193 |
-
gr.Markdown("no, not yet...")
|
194 |
-
with gr.Tab(label=i18n("不知道还有啥tab")):
|
195 |
-
gr.Markdown("I am Keldos. Hello, world!")
|
196 |
-
|
197 |
-
# changeAPIURLBtn = gr.Button(i18n("🔄 切换API地址"))
|
198 |
-
updateChuanhuBtn = gr.Button(visible=False, elem_classes="invisible-btn", elem_id="update-chuanhu-btn")
|
199 |
-
historySelectBtn = gr.Button(visible=False, elem_classes="invisible-btn", elem_id="history-select-btn")
|
200 |
-
|
201 |
-
with gr.Row(elem_id="popup-wrapper"):
|
202 |
-
with gr.Box(elem_id="chuanhu-popup"):
|
203 |
-
with gr.Box(elem_id="chuanhu-setting"):
|
204 |
-
with gr.Row():
|
205 |
-
gr.Markdown("## Settings")
|
206 |
-
gr.HTML(get_html("close_btn.html").format(obj="box"),elem_classes="close-btn")
|
207 |
-
with gr.Tabs(elem_id="chuanhu-setting-tabs"):
|
208 |
-
with gr.Tab(label=i18n("模型")):
|
209 |
-
keyTxt = gr.Textbox(
|
210 |
-
show_label=True,
|
211 |
-
placeholder=f"Your API-key...",
|
212 |
-
value=hide_middle_chars(user_api_key.value),
|
213 |
-
type="password",
|
214 |
-
visible=not HIDE_MY_KEY,
|
215 |
-
label="API-Key",
|
216 |
-
)
|
217 |
-
if multi_api_key:
|
218 |
-
usageTxt = gr.Markdown(i18n("多账号模式已开启,无需输入key,可直接开始对话"), elem_id="usage-display", elem_classes="insert-block", visible=show_api_billing)
|
219 |
-
else:
|
220 |
-
usageTxt = gr.Markdown(i18n("**发送消息** 或 **提交key** 以显示额度"), elem_id="usage-display", elem_classes="insert-block", visible=show_api_billing)
|
221 |
-
# model_select_dropdown = gr.Dropdown(
|
222 |
-
# label=i18n("选择模型"), choices=MODELS, multiselect=False, value=MODELS[DEFAULT_MODEL], interactive=True
|
223 |
-
# )
|
224 |
-
# lora_select_dropdown = gr.Dropdown(
|
225 |
-
# label=i18n("选择LoRA模型"), choices=[], multiselect=False, interactive=True, visible=False
|
226 |
-
# )
|
227 |
-
with gr.Row():
|
228 |
-
single_turn_checkbox = gr.Checkbox(label=i18n("单轮对话"), value=False, elem_classes="switch-checkbox")
|
229 |
-
use_websearch_checkbox = gr.Checkbox(label=i18n("使用在线搜索"), value=False, elem_classes="switch-checkbox")
|
230 |
-
language_select_dropdown = gr.Dropdown(
|
231 |
-
label=i18n("选择回复语言(针对搜索&索引功能)"),
|
232 |
-
choices=REPLY_LANGUAGES,
|
233 |
-
multiselect=False,
|
234 |
-
value=REPLY_LANGUAGES[0],
|
235 |
-
)
|
236 |
-
index_files = gr.Files(label=i18n("上传"), type="file", elem_id="upload-index-file")
|
237 |
-
two_column = gr.Checkbox(label=i18n("双栏pdf"), value=advance_docs["pdf"].get("two_column", False))
|
238 |
-
summarize_btn = gr.Button(i18n("总结"))
|
239 |
-
# TODO: 公式ocr
|
240 |
-
# formula_ocr = gr.Checkbox(label=i18n("识别公式"), value=advance_docs["pdf"].get("formula_ocr", False))
|
241 |
-
|
242 |
-
with gr.Tab(label=i18n("高级")):
|
243 |
-
gr.HTML(get_html("appearance_switcher.html").format(label=i18n("切换亮暗色主题")), elem_classes="insert-block")
|
244 |
-
use_streaming_checkbox = gr.Checkbox(
|
245 |
-
label=i18n("实时传输回答"), value=True, visible=ENABLE_STREAMING_OPTION, elem_classes="switch-checkbox"
|
246 |
-
)
|
247 |
-
checkUpdateBtn = gr.Button(i18n("🔄 检查更新..."), visible=check_update)
|
248 |
gr.Markdown(i18n("# ⚠️ 务必谨慎更改 ⚠️"), elem_id="advanced-warning")
|
249 |
-
with gr.Accordion(i18n("
|
250 |
temperature_slider = gr.Slider(
|
251 |
minimum=-0,
|
252 |
maximum=2.0,
|
@@ -324,36 +267,94 @@ with gr.Blocks(theme=small_and_beautiful_theme) as demo:
|
|
324 |
value=user_name.value,
|
325 |
lines=1,
|
326 |
)
|
|
|
|
|
327 |
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
# 网络代理
|
332 |
-
proxyTxt = gr.Textbox(
|
333 |
-
show_label=True,
|
334 |
-
placeholder=i18n("未设置代理..."),
|
335 |
-
label=i18n("代理地址"),
|
336 |
-
value=config.http_proxy,
|
337 |
-
lines=1,
|
338 |
-
interactive=False,
|
339 |
-
# container=False,
|
340 |
-
elem_classes="view-only-textbox no-container",
|
341 |
-
)
|
342 |
-
# changeProxyBtn = gr.Button(i18n("🔄 设置代理地址"))
|
343 |
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
354 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
355 |
|
356 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
357 |
gr.Markdown(CHUANHU_DESCRIPTION, elem_id="description")
|
358 |
|
359 |
with gr.Box(elem_id="chuanhu-training"):
|
@@ -380,9 +381,6 @@ with gr.Blocks(theme=small_and_beautiful_theme) as demo:
|
|
380 |
openai_cancel_all_jobs_btn = gr.Button(i18n("取消所有任务"))
|
381 |
add_to_models_btn = gr.Button(i18n("添加训练好的模型到模型列表"), interactive=False)
|
382 |
|
383 |
-
|
384 |
-
gr.HTML(get_html("footer.html").format(versions=versions_html()), elem_id="footer")
|
385 |
-
|
386 |
# https://github.com/gradio-app/gradio/pull/3296
|
387 |
def create_greeting(request: gr.Request):
|
388 |
if hasattr(request, "username") and request.username: # is not None or is not ""
|
@@ -590,7 +588,7 @@ with gr.Blocks(theme=small_and_beautiful_theme) as demo:
|
|
590 |
# [status_display],
|
591 |
# show_progress=True,
|
592 |
# )
|
593 |
-
checkUpdateBtn.click(fn=None, _js='manualCheckUpdate')
|
594 |
|
595 |
# Invisible elements
|
596 |
updateChuanhuBtn.click(
|
|
|
152 |
with gr.Column(elem_id="toolbox-area", scale=1):
|
153 |
with gr.Box(elem_id="chuanhu-toolbox"): # For CSS setting, there is an extra box. Don't remove it.
|
154 |
with gr.Row():
|
155 |
+
gr.Markdown("## Toolbox")
|
156 |
gr.HTML(get_html("close_btn.html").format(obj="toolbox"), elem_classes="close-btn")
|
157 |
with gr.Tabs(elem_id="chuanhu-toolbox-tabs"):
|
158 |
with gr.Tab(label=i18n("Prompt")):
|
|
|
188 |
container=False,
|
189 |
)
|
190 |
with gr.Tab(label=i18n("Parameters")):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
191 |
gr.Markdown(i18n("# ⚠️ 务必谨慎更改 ⚠️"), elem_id="advanced-warning")
|
192 |
+
with gr.Accordion(i18n("参数"), open=True):
|
193 |
temperature_slider = gr.Slider(
|
194 |
minimum=-0,
|
195 |
maximum=2.0,
|
|
|
267 |
value=user_name.value,
|
268 |
lines=1,
|
269 |
)
|
270 |
+
with gr.Tab(label=i18n("Extensions")):
|
271 |
+
gr.Markdown("Will be here soon...\n(We hope)")
|
272 |
|
273 |
+
# changeAPIURLBtn = gr.Button(i18n("🔄 切换API地址"))
|
274 |
+
updateChuanhuBtn = gr.Button(visible=False, elem_classes="invisible-btn", elem_id="update-chuanhu-btn")
|
275 |
+
historySelectBtn = gr.Button(visible=False, elem_classes="invisible-btn", elem_id="history-select-btn")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
276 |
|
277 |
+
with gr.Row(elem_id="popup-wrapper"):
|
278 |
+
with gr.Box(elem_id="chuanhu-popup"):
|
279 |
+
with gr.Box(elem_id="chuanhu-setting"):
|
280 |
+
with gr.Row():
|
281 |
+
gr.Markdown("## Settings")
|
282 |
+
gr.HTML(get_html("close_btn.html").format(obj="box"),elem_classes="close-btn")
|
283 |
+
with gr.Tabs(elem_id="chuanhu-setting-tabs"):
|
284 |
+
with gr.Tab(label=i18n("模型")):
|
285 |
+
keyTxt = gr.Textbox(
|
286 |
+
show_label=True,
|
287 |
+
placeholder=f"Your API-key...",
|
288 |
+
value=hide_middle_chars(user_api_key.value),
|
289 |
+
type="password",
|
290 |
+
visible=not HIDE_MY_KEY,
|
291 |
+
label="API-Key",
|
292 |
+
)
|
293 |
+
if multi_api_key:
|
294 |
+
usageTxt = gr.Markdown(i18n("多账号模式已开启,无需输入key,可直接开始对话"), elem_id="usage-display", elem_classes="insert-block", visible=show_api_billing)
|
295 |
+
else:
|
296 |
+
usageTxt = gr.Markdown(i18n("**发送消息** 或 **提交key** 以显示额度"), elem_id="usage-display", elem_classes="insert-block", visible=show_api_billing)
|
297 |
+
# model_select_dropdown = gr.Dropdown(
|
298 |
+
# label=i18n("选择模型"), choices=MODELS, multiselect=False, value=MODELS[DEFAULT_MODEL], interactive=True
|
299 |
+
# )
|
300 |
+
# lora_select_dropdown = gr.Dropdown(
|
301 |
+
# label=i18n("选择LoRA模型"), choices=[], multiselect=False, interactive=True, visible=False
|
302 |
+
# )
|
303 |
+
with gr.Row():
|
304 |
+
single_turn_checkbox = gr.Checkbox(label=i18n("单轮对话"), value=False, elem_classes="switch-checkbox")
|
305 |
+
use_websearch_checkbox = gr.Checkbox(label=i18n("使用在线搜索"), value=False, elem_classes="switch-checkbox")
|
306 |
+
language_select_dropdown = gr.Dropdown(
|
307 |
+
label=i18n("选择回复语言(针对搜索&索引功能)"),
|
308 |
+
choices=REPLY_LANGUAGES,
|
309 |
+
multiselect=False,
|
310 |
+
value=REPLY_LANGUAGES[0],
|
311 |
+
)
|
312 |
+
index_files = gr.Files(label=i18n("上传"), type="file", elem_id="upload-index-file")
|
313 |
+
two_column = gr.Checkbox(label=i18n("双栏pdf"), value=advance_docs["pdf"].get("two_column", False))
|
314 |
+
summarize_btn = gr.Button(i18n("总结"))
|
315 |
+
# TODO: 公式ocr
|
316 |
+
# formula_ocr = gr.Checkbox(label=i18n("识别公式"), value=advance_docs["pdf"].get("formula_ocr", False))
|
317 |
+
|
318 |
+
with gr.Tab(label=i18n("高级")):
|
319 |
+
gr.HTML(get_html("appearance_switcher.html").format(label=i18n("切换亮暗色主题")), elem_classes="insert-block", visible=False)
|
320 |
+
use_streaming_checkbox = gr.Checkbox(
|
321 |
+
label=i18n("实时传输回答"), value=True, visible=ENABLE_STREAMING_OPTION, elem_classes="switch-checkbox"
|
322 |
)
|
323 |
+
# checkUpdateBtn = gr.Button(i18n("🔄 检查更新..."), visible=check_update)
|
324 |
+
|
325 |
+
with gr.Tab(i18n("网络参数")):
|
326 |
+
gr.Markdown(i18n("⚠️ 为保证API-Key安全,请在配置文件`config.json`中修改网络设置"), elem_id="netsetting-warning")
|
327 |
+
default_btn = gr.Button(i18n("🔙 恢复默认网络设置"))
|
328 |
+
# 网络代理
|
329 |
+
proxyTxt = gr.Textbox(
|
330 |
+
show_label=True,
|
331 |
+
placeholder=i18n("未设置代理..."),
|
332 |
+
label=i18n("代理地址"),
|
333 |
+
value=config.http_proxy,
|
334 |
+
lines=1,
|
335 |
+
interactive=False,
|
336 |
+
# container=False,
|
337 |
+
elem_classes="view-only-textbox no-container",
|
338 |
+
)
|
339 |
+
# changeProxyBtn = gr.Button(i18n("🔄 设置代理地址"))
|
340 |
|
341 |
+
# 优先展示自定义的api_host
|
342 |
+
apihostTxt = gr.Textbox(
|
343 |
+
show_label=True,
|
344 |
+
placeholder="api.openai.com",
|
345 |
+
label="OpenAI API-Host",
|
346 |
+
value=config.api_host or shared.API_HOST,
|
347 |
+
lines=1,
|
348 |
+
interactive=False,
|
349 |
+
# container=False,
|
350 |
+
elem_classes="view-only-textbox no-container",
|
351 |
+
)
|
352 |
+
|
353 |
+
with gr.Tab(label=i18n("关于"), elem_id="about-tab"):
|
354 |
+
gr.Markdown("\n\n")
|
355 |
+
gr.Markdown("![Chuanhu Chat logo](file=web_assets/chatbot.png)")
|
356 |
+
gr.Markdown("# 川虎Chat")
|
357 |
+
gr.HTML(get_html("footer.html").format(versions=versions_html()), elem_id="footer")
|
358 |
gr.Markdown(CHUANHU_DESCRIPTION, elem_id="description")
|
359 |
|
360 |
with gr.Box(elem_id="chuanhu-training"):
|
|
|
381 |
openai_cancel_all_jobs_btn = gr.Button(i18n("取消所有任务"))
|
382 |
add_to_models_btn = gr.Button(i18n("添加训练好的模型到模型列表"), interactive=False)
|
383 |
|
|
|
|
|
|
|
384 |
# https://github.com/gradio-app/gradio/pull/3296
|
385 |
def create_greeting(request: gr.Request):
|
386 |
if hasattr(request, "username") and request.username: # is not None or is not ""
|
|
|
588 |
# [status_display],
|
589 |
# show_progress=True,
|
590 |
# )
|
591 |
+
# checkUpdateBtn.click(fn=None, _js='manualCheckUpdate')
|
592 |
|
593 |
# Invisible elements
|
594 |
updateChuanhuBtn.click(
|
web_assets/javascript/ChuanhuChat.js
CHANGED
@@ -96,9 +96,9 @@ function initialize() {
|
|
96 |
setChatbotHeight();
|
97 |
setChatbotScroll();
|
98 |
setPopupBoxPosition();
|
99 |
-
setChatAreaWidth();
|
100 |
setSlider();
|
101 |
checkModel();
|
|
|
102 |
|
103 |
if (!historyLoaded) loadHistoryHtml();
|
104 |
if (!usernameGotten) getUserInfo();
|
@@ -240,25 +240,30 @@ function btnToggleDarkMode() {
|
|
240 |
toggleDarkMode(apSwitch.checked);
|
241 |
}
|
242 |
|
243 |
-
function
|
244 |
-
const
|
245 |
-
const
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
|
|
261 |
}
|
|
|
|
|
|
|
|
|
262 |
}
|
263 |
|
264 |
function setPopupBoxPosition() {
|
@@ -349,7 +354,7 @@ window.addEventListener('resize', ()=>{
|
|
349 |
adjustSide();
|
350 |
windowWidth = window.innerWidth;
|
351 |
});
|
352 |
-
window.addEventListener('scroll', ()=>{setChatbotHeight();
|
353 |
window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", adjustDarkMode);
|
354 |
|
355 |
// console suprise
|
|
|
96 |
setChatbotHeight();
|
97 |
setChatbotScroll();
|
98 |
setPopupBoxPosition();
|
|
|
99 |
setSlider();
|
100 |
checkModel();
|
101 |
+
// setScrollShadow();
|
102 |
|
103 |
if (!historyLoaded) loadHistoryHtml();
|
104 |
if (!usernameGotten) getUserInfo();
|
|
|
240 |
toggleDarkMode(apSwitch.checked);
|
241 |
}
|
242 |
|
243 |
+
function setScrollShadow() {
|
244 |
+
const toolboxScroll = toolbox.querySelector('#toolbox-area > .gradio-box > .gradio-tabs > div.tab-nav');
|
245 |
+
const toolboxTabs = toolboxScroll.querySelectorAll('button');
|
246 |
+
let toolboxScrollWidth = 0;
|
247 |
+
toolboxTabs.forEach((tab) => {
|
248 |
+
toolboxScrollWidth += tab.offsetWidth; // 获取按钮宽度并累加
|
249 |
+
});
|
250 |
+
function adjustScrollShadow() {
|
251 |
+
if (toolboxScroll.scrollLeft > 0) {
|
252 |
+
toolboxScroll.classList.add('scroll-shadow-left');
|
253 |
+
} else {
|
254 |
+
toolboxScroll.classList.remove('scroll-shadow-left');
|
255 |
+
}
|
256 |
+
|
257 |
+
if (toolboxScroll.scrollLeft + toolboxScroll.clientWidth < toolboxScrollWidth) {
|
258 |
+
toolboxScroll.classList.add('scroll-shadow-right');
|
259 |
+
} else {
|
260 |
+
toolboxScroll.classList.remove('scroll-shadow-right');
|
261 |
+
}
|
262 |
}
|
263 |
+
toolboxScroll.addEventListener('scroll', () => {
|
264 |
+
adjustScrollShadow();
|
265 |
+
});
|
266 |
+
// no, I failed to make shadow appear on the top layer...
|
267 |
}
|
268 |
|
269 |
function setPopupBoxPosition() {
|
|
|
354 |
adjustSide();
|
355 |
windowWidth = window.innerWidth;
|
356 |
});
|
357 |
+
window.addEventListener('scroll', ()=>{setChatbotHeight(); setPopupBoxPosition();});
|
358 |
window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", adjustDarkMode);
|
359 |
|
360 |
// console suprise
|
web_assets/javascript/updater.js
CHANGED
@@ -139,7 +139,7 @@ function cancelUpdate() {
|
|
139 |
}
|
140 |
function openUpdateToast() {
|
141 |
showingUpdateInfo = true;
|
142 |
-
|
143 |
}
|
144 |
function closeUpdateToast() {
|
145 |
updateToast.style.setProperty('top', '-500px');
|
@@ -201,10 +201,10 @@ function disableUpdateBtn_enableCancelBtn() {
|
|
201 |
document.querySelector('#cancel-button.btn-update').disabled = false;
|
202 |
}
|
203 |
|
204 |
-
function setUpdateWindowHeight() {
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
}
|
|
|
139 |
}
|
140 |
function openUpdateToast() {
|
141 |
showingUpdateInfo = true;
|
142 |
+
updateToast.style.setProperty('top', '0px');
|
143 |
}
|
144 |
function closeUpdateToast() {
|
145 |
updateToast.style.setProperty('top', '-500px');
|
|
|
201 |
document.querySelector('#cancel-button.btn-update').disabled = false;
|
202 |
}
|
203 |
|
204 |
+
// function setUpdateWindowHeight() {
|
205 |
+
// if (!showingUpdateInfo) {return;}
|
206 |
+
// const scrollPosition = window.scrollY;
|
207 |
+
// // const originalTop = updateToast.style.getPropertyValue('top');
|
208 |
+
// const resultTop = scrollPosition - 20 + 'px';
|
209 |
+
// updateToast.style.setProperty('top', resultTop);
|
210 |
+
// }
|
web_assets/stylesheet/ChuanhuChat.css
CHANGED
@@ -44,11 +44,18 @@ body.popup-open {
|
|
44 |
}
|
45 |
#description {
|
46 |
text-align: center;
|
47 |
-
margin: 32px 0 4px 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
}
|
49 |
|
50 |
/* 高级页面 */
|
51 |
#advanced-warning {
|
|
|
52 |
display: flex;
|
53 |
flex-wrap: wrap;
|
54 |
flex-direction: column;
|
@@ -618,20 +625,20 @@ body.popup-open {
|
|
618 |
overflow: hidden;
|
619 |
}
|
620 |
#toolbox-area > .gradio-box > .gradio-tabs > div.tabitem {
|
621 |
-
height: calc(100% -
|
622 |
overflow-y: auto;
|
623 |
border-style: none;
|
624 |
}
|
625 |
#toolbox-area > .gradio-box > .gradio-tabs > div.tab-nav {
|
626 |
display: flex;
|
627 |
margin: 0;
|
628 |
-
padding: 4px;
|
629 |
overflow-x: auto;
|
630 |
overflow-y: hidden;
|
631 |
flex-direction: row;
|
632 |
flex-wrap: nowrap;
|
633 |
-
border-radius: 10px;
|
634 |
-
gap: 4px;
|
635 |
width: 100%;
|
636 |
height: auto;
|
637 |
background: var(--button-secondary-background-fill);
|
@@ -642,19 +649,23 @@ body.popup-open {
|
|
642 |
#toolbox-area > .gradio-box > .gradio-tabs > div.tab-nav > button {
|
643 |
display: inline-block;
|
644 |
position: relative;
|
645 |
-
padding:
|
646 |
border: none;
|
647 |
white-space: nowrap;
|
648 |
width: auto;
|
649 |
text-align: center;
|
650 |
background: var(--button-secondary-background-fill);
|
651 |
transition: font-size 0.3s ease-in-out;
|
|
|
|
|
652 |
}
|
653 |
#toolbox-area > .gradio-box > .gradio-tabs > div.tab-nav > button.selected {
|
654 |
-
background-color: var(--
|
655 |
font-weight: bold;
|
|
|
|
|
656 |
/* font-size: large; */
|
657 |
-
color: white;
|
658 |
}
|
659 |
}
|
660 |
|
@@ -662,6 +673,14 @@ body.popup-open {
|
|
662 |
padding: 0;
|
663 |
height: 100%;
|
664 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
665 |
/* #chuanhu-popup ul.options {
|
666 |
transform: translate(-50%, -50%);
|
667 |
} */
|
|
|
44 |
}
|
45 |
#description {
|
46 |
text-align: center;
|
47 |
+
/* margin: 32px 0 4px 0; */
|
48 |
+
}
|
49 |
+
#about-tab {
|
50 |
+
text-align: center;
|
51 |
+
}
|
52 |
+
#about-tab img {
|
53 |
+
margin: 0 auto;
|
54 |
}
|
55 |
|
56 |
/* 高级页面 */
|
57 |
#advanced-warning {
|
58 |
+
/* margin-top: 1rem; */
|
59 |
display: flex;
|
60 |
flex-wrap: wrap;
|
61 |
flex-direction: column;
|
|
|
625 |
overflow: hidden;
|
626 |
}
|
627 |
#toolbox-area > .gradio-box > .gradio-tabs > div.tabitem {
|
628 |
+
height: calc(100% - 35px);
|
629 |
overflow-y: auto;
|
630 |
border-style: none;
|
631 |
}
|
632 |
#toolbox-area > .gradio-box > .gradio-tabs > div.tab-nav {
|
633 |
display: flex;
|
634 |
margin: 0;
|
635 |
+
/* padding: 4px; */
|
636 |
overflow-x: auto;
|
637 |
overflow-y: hidden;
|
638 |
flex-direction: row;
|
639 |
flex-wrap: nowrap;
|
640 |
+
/* border-radius: 10px; */
|
641 |
+
/* gap: 4px; */
|
642 |
width: 100%;
|
643 |
height: auto;
|
644 |
background: var(--button-secondary-background-fill);
|
|
|
649 |
#toolbox-area > .gradio-box > .gradio-tabs > div.tab-nav > button {
|
650 |
display: inline-block;
|
651 |
position: relative;
|
652 |
+
padding: 8px 16px;
|
653 |
border: none;
|
654 |
white-space: nowrap;
|
655 |
width: auto;
|
656 |
text-align: center;
|
657 |
background: var(--button-secondary-background-fill);
|
658 |
transition: font-size 0.3s ease-in-out;
|
659 |
+
border-right: 1px var(--border-color-primary) solid;
|
660 |
+
border-radius: 0;
|
661 |
}
|
662 |
#toolbox-area > .gradio-box > .gradio-tabs > div.tab-nav > button.selected {
|
663 |
+
background-color: var(--block-background-fill);
|
664 |
font-weight: bold;
|
665 |
+
/* border-top-left-radius: 8px;
|
666 |
+
border-top-right-radius: 8px; */
|
667 |
/* font-size: large; */
|
668 |
+
/* color: white; */
|
669 |
}
|
670 |
}
|
671 |
|
|
|
673 |
padding: 0;
|
674 |
height: 100%;
|
675 |
}
|
676 |
+
#toolbox-area > .gradio-box > .gradio-tabs > div.tabitem {
|
677 |
+
padding: 0;
|
678 |
+
/* 理论上不该是0,但这里考虑内部gradio有好多container有padding了 */
|
679 |
+
}
|
680 |
+
#toolbox-area > .gradio-box > .gradio-tabs > div.tabitem > div > .gradio-markdown {
|
681 |
+
padding: 12px;
|
682 |
+
}
|
683 |
+
|
684 |
/* #chuanhu-popup ul.options {
|
685 |
transform: translate(-50%, -50%);
|
686 |
} */
|
web_assets/stylesheet/custom-components.css
CHANGED
@@ -28,7 +28,7 @@
|
|
28 |
|
29 |
/* updater */
|
30 |
#toast-update {
|
31 |
-
position:
|
32 |
display: flex;
|
33 |
top: -500px;
|
34 |
width: 100%;
|
@@ -238,3 +238,25 @@ input:checked + .apSlider::before {
|
|
238 |
left: 18px;
|
239 |
}
|
240 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
|
29 |
/* updater */
|
30 |
#toast-update {
|
31 |
+
position: fixed;
|
32 |
display: flex;
|
33 |
top: -500px;
|
34 |
width: 100%;
|
|
|
238 |
left: 18px;
|
239 |
}
|
240 |
|
241 |
+
|
242 |
+
/* .scroll-shadow-left::before {
|
243 |
+
content: "";
|
244 |
+
position: absolute;
|
245 |
+
top: 0;
|
246 |
+
left: -6px;
|
247 |
+
width: 6px;
|
248 |
+
height: 100%;
|
249 |
+
box-shadow: 6px 0 10px rgba(0, 0, 0, 0.36);
|
250 |
+
z-index: 1;
|
251 |
+
}
|
252 |
+
|
253 |
+
.scroll-shadow-right::before {
|
254 |
+
content: "";
|
255 |
+
position: absolute;
|
256 |
+
top: 0;
|
257 |
+
right: -6px;
|
258 |
+
width: 6px;
|
259 |
+
height: 100%;
|
260 |
+
box-shadow: -6px 0 10px rgba(0, 0, 0, 0.36);
|
261 |
+
z-index: 1;
|
262 |
+
} */
|