Spaces:
Sleeping
Sleeping
Keldos
commited on
Commit
•
d443c93
1
Parent(s):
a294e14
WIP: 调整窗口填充架构
Browse files
ChuanhuChatbot.py
CHANGED
@@ -65,7 +65,7 @@ with gr.Blocks(theme=small_and_beautiful_theme) as demo:
|
|
65 |
historyFileSelectDropdown = gr.Radio(
|
66 |
label=i18n("从列表中加载对话"),
|
67 |
choices=get_history_names(plain=True),
|
68 |
-
multiselect=False,
|
69 |
container=False,
|
70 |
elem_id="history-select-dropdown"
|
71 |
)
|
@@ -98,7 +98,7 @@ with gr.Blocks(theme=small_and_beautiful_theme) as demo:
|
|
98 |
with gr.Column(elem_id="chuanhu-area", scale=5):
|
99 |
with gr.Column(elem_id="chatbot-area"):
|
100 |
with gr.Row():
|
101 |
-
chatbot = gr.Chatbot(label="Chuanhu Chat", elem_id="chuanhu-chatbot", latex_delimiters=latex_delimiters_set, height=700, avatar_images=[config.user_avatar, config.bot_avatar])
|
102 |
with gr.Row():
|
103 |
with gr.Column(min_width=225, scale=12):
|
104 |
user_input = gr.Textbox(
|
|
|
65 |
historyFileSelectDropdown = gr.Radio(
|
66 |
label=i18n("从列表中加载对话"),
|
67 |
choices=get_history_names(plain=True),
|
68 |
+
# multiselect=False,
|
69 |
container=False,
|
70 |
elem_id="history-select-dropdown"
|
71 |
)
|
|
|
98 |
with gr.Column(elem_id="chuanhu-area", scale=5):
|
99 |
with gr.Column(elem_id="chatbot-area"):
|
100 |
with gr.Row():
|
101 |
+
chatbot = gr.Chatbot(label="Chuanhu Chat", elem_id="chuanhu-chatbot", latex_delimiters=latex_delimiters_set, height=700, avatar_images=[config.user_avatar, config.bot_avatar], show_share_button=False, )
|
102 |
with gr.Row():
|
103 |
with gr.Column(min_width=225, scale=12):
|
104 |
user_input = gr.Textbox(
|
web_assets/javascript/webui.js
CHANGED
@@ -52,6 +52,7 @@ function closeSide(sideArea) {
|
|
52 |
} else if (sideArea == menu) {
|
53 |
menuOpening = false;
|
54 |
}
|
|
|
55 |
}
|
56 |
|
57 |
function openSide(sideArea) {
|
|
|
52 |
} else if (sideArea == menu) {
|
53 |
menuOpening = false;
|
54 |
}
|
55 |
+
adjustMask();
|
56 |
}
|
57 |
|
58 |
function openSide(sideArea) {
|
web_assets/stylesheet/ChuanhuChat.css
CHANGED
@@ -220,24 +220,28 @@ body.popup-open {
|
|
220 |
/* margin-top: 54px; */
|
221 |
/* height: calc(100vh - 72px); */
|
222 |
position: absolute;
|
223 |
-
top:
|
|
|
224 |
}
|
225 |
|
226 |
#chuanhu-area {
|
227 |
flex: unset;
|
228 |
width: 100%;
|
229 |
flex-wrap: nowrap;
|
230 |
-
/* gap: 0; */
|
231 |
justify-content: center;
|
232 |
overflow: hidden;
|
233 |
flex-direction: row;
|
234 |
-
padding-
|
235 |
-
margin:
|
|
|
|
|
|
|
|
|
|
|
236 |
}
|
237 |
#chatbot-area {
|
238 |
max-width: 1024px;
|
239 |
}
|
240 |
-
|
241 |
/* default invisible */
|
242 |
#menu-area, #toolbox-area {
|
243 |
height: 0;
|
@@ -261,20 +265,17 @@ body.popup-open {
|
|
261 |
#menu-area.showSide {
|
262 |
width: var(--menu-width);
|
263 |
max-width: var(--menu-width);
|
264 |
-
height:
|
265 |
visibility: visible;
|
266 |
/* margin-right: 16px; */
|
267 |
}
|
268 |
|
269 |
-
#toolbox-area {
|
270 |
-
|
271 |
-
}
|
272 |
#toolbox-area > div {
|
273 |
width: var(--toolbox-width);
|
274 |
}
|
275 |
#toolbox-area.showSide {
|
276 |
width: var(--toolbox-width);
|
277 |
-
height:
|
278 |
visibility: visible;
|
279 |
/* margin-left: 16px; */
|
280 |
}
|
@@ -336,6 +337,7 @@ body.popup-open {
|
|
336 |
padding: 24px !important;
|
337 |
border-bottom: 1.8px solid var(--border-color-primary);
|
338 |
}
|
|
|
339 |
#chuanhu-popup > .gradio-box > .gradio-row:first-of-type * {
|
340 |
margin: 0;
|
341 |
}
|
@@ -506,14 +508,14 @@ body.popup-open {
|
|
506 |
display: none;
|
507 |
}
|
508 |
#toolbox-area > .gradio-box > .gradio-tabs{
|
509 |
-
height:
|
510 |
width: var(--toolbox-width);
|
511 |
overflow: hidden;
|
512 |
}
|
513 |
#toolbox-area > .gradio-box > .gradio-tabs > div.tabitem {
|
514 |
-
height: calc(
|
515 |
-
overflow-
|
516 |
-
border: none;
|
517 |
}
|
518 |
#toolbox-area > .gradio-box > .gradio-tabs > div.tab-nav {
|
519 |
display: flex;
|
@@ -553,14 +555,26 @@ body.popup-open {
|
|
553 |
|
554 |
#toolbox-area > .gradio-box {
|
555 |
padding: 0;
|
|
|
556 |
}
|
557 |
/* #chuanhu-popup ul.options {
|
558 |
transform: translate(-50%, -50%);
|
559 |
} */
|
560 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
561 |
|
562 |
#history-select-wrap {
|
563 |
-
height:
|
564 |
overflow: auto;
|
565 |
overflow-x: hidden;
|
566 |
}
|
|
|
220 |
/* margin-top: 54px; */
|
221 |
/* height: calc(100vh - 72px); */
|
222 |
position: absolute;
|
223 |
+
top: 65px;
|
224 |
+
height: calc(100vh - 65px);
|
225 |
}
|
226 |
|
227 |
#chuanhu-area {
|
228 |
flex: unset;
|
229 |
width: 100%;
|
230 |
flex-wrap: nowrap;
|
|
|
231 |
justify-content: center;
|
232 |
overflow: hidden;
|
233 |
flex-direction: row;
|
234 |
+
padding-inline: 24px;
|
235 |
+
/* margin: 16px; */
|
236 |
+
/* border-radius: 24px; */
|
237 |
+
background: var(--chatbot-background-color-light);
|
238 |
+
}
|
239 |
+
.dark #chuanhu-area {
|
240 |
+
background: var(--chatbot-background-color-dark);
|
241 |
}
|
242 |
#chatbot-area {
|
243 |
max-width: 1024px;
|
244 |
}
|
|
|
245 |
/* default invisible */
|
246 |
#menu-area, #toolbox-area {
|
247 |
height: 0;
|
|
|
265 |
#menu-area.showSide {
|
266 |
width: var(--menu-width);
|
267 |
max-width: var(--menu-width);
|
268 |
+
height: calc(100vh - 65px);
|
269 |
visibility: visible;
|
270 |
/* margin-right: 16px; */
|
271 |
}
|
272 |
|
|
|
|
|
|
|
273 |
#toolbox-area > div {
|
274 |
width: var(--toolbox-width);
|
275 |
}
|
276 |
#toolbox-area.showSide {
|
277 |
width: var(--toolbox-width);
|
278 |
+
height: calc(100vh - 65px);
|
279 |
visibility: visible;
|
280 |
/* margin-left: 16px; */
|
281 |
}
|
|
|
337 |
padding: 24px !important;
|
338 |
border-bottom: 1.8px solid var(--border-color-primary);
|
339 |
}
|
340 |
+
#toolbox-area > .gradio-box > .gradio-row:first-of-type * ,
|
341 |
#chuanhu-popup > .gradio-box > .gradio-row:first-of-type * {
|
342 |
margin: 0;
|
343 |
}
|
|
|
508 |
display: none;
|
509 |
}
|
510 |
#toolbox-area > .gradio-box > .gradio-tabs{
|
511 |
+
height: 100%;
|
512 |
width: var(--toolbox-width);
|
513 |
overflow: hidden;
|
514 |
}
|
515 |
#toolbox-area > .gradio-box > .gradio-tabs > div.tabitem {
|
516 |
+
height: calc(100% - 40px);
|
517 |
+
overflow-y: auto;
|
518 |
+
border-style: none;
|
519 |
}
|
520 |
#toolbox-area > .gradio-box > .gradio-tabs > div.tab-nav {
|
521 |
display: flex;
|
|
|
555 |
|
556 |
#toolbox-area > .gradio-box {
|
557 |
padding: 0;
|
558 |
+
height: 100%;
|
559 |
}
|
560 |
/* #chuanhu-popup ul.options {
|
561 |
transform: translate(-50%, -50%);
|
562 |
} */
|
563 |
|
564 |
+
#chuanhu-history {
|
565 |
+
height: calc(100vh - 65px - 65px);
|
566 |
+
overflow-y: auto;
|
567 |
+
}
|
568 |
+
#chuanhu-func-nav {
|
569 |
+
position: absolute;
|
570 |
+
bottom: 0;
|
571 |
+
/* background: black; */
|
572 |
+
height: 64px;
|
573 |
+
overflow: hidden;
|
574 |
+
}
|
575 |
|
576 |
#history-select-wrap {
|
577 |
+
height: 600px;
|
578 |
overflow: auto;
|
579 |
overflow-x: hidden;
|
580 |
}
|
web_assets/stylesheet/chatbot.css
CHANGED
@@ -50,6 +50,11 @@ hr.append-display {
|
|
50 |
padding: 0 4px;
|
51 |
}
|
52 |
|
|
|
|
|
|
|
|
|
|
|
53 |
/* 亮色(默认) */
|
54 |
#chuanhu-chatbot {
|
55 |
background-color: var(--chatbot-background-color-light) !important;
|
|
|
50 |
padding: 0 4px;
|
51 |
}
|
52 |
|
53 |
+
/* 阻止generating时的border */
|
54 |
+
#chuanhu-chatbot > .wrap {
|
55 |
+
border: none !important;
|
56 |
+
}
|
57 |
+
|
58 |
/* 亮色(默认) */
|
59 |
#chuanhu-chatbot {
|
60 |
background-color: var(--chatbot-background-color-light) !important;
|
web_assets/stylesheet/override-gradio.css
CHANGED
@@ -1,7 +1,6 @@
|
|
1 |
.gradio-container {
|
2 |
max-width: unset !important;
|
3 |
-
padding
|
4 |
-
padding-right: 0 !important;
|
5 |
}
|
6 |
|
7 |
/* 解决container=False时的错误填充 */
|
|
|
1 |
.gradio-container {
|
2 |
max-width: unset !important;
|
3 |
+
padding: 0 !important;
|
|
|
4 |
}
|
5 |
|
6 |
/* 解决container=False时的错误填充 */
|