This commit is contained in:
parent
76f1e25a80
commit
1b1e69b078
|
|
@ -29,7 +29,7 @@ def task_history_item(
|
||||||
|
|
||||||
return rx.list.item(
|
return rx.list.item(
|
||||||
rx.hstack(
|
rx.hstack(
|
||||||
# 会话历史项的会话描述
|
# 任务历史项的任务描述
|
||||||
rx.text(
|
rx.text(
|
||||||
item.description,
|
item.description,
|
||||||
flex=1,
|
flex=1,
|
||||||
|
|
@ -45,10 +45,11 @@ def task_history_item(
|
||||||
align_items="center",
|
align_items="center",
|
||||||
width="100%",
|
width="100%",
|
||||||
margin_bottom="8px",
|
margin_bottom="8px",
|
||||||
|
cursor="pointer",
|
||||||
# 点击事件:将指定任务唯一标识设置为当前任务唯一标识
|
# 点击事件:将指定任务唯一标识设置为当前任务唯一标识
|
||||||
on_click=lambda: TaskState.set_task_id(item.id),
|
on_click=lambda: TaskState.set_task_id(item.id),
|
||||||
),
|
),
|
||||||
# 会话历史项的更多按钮
|
# 任务历史项的更多按钮
|
||||||
rx.box(
|
rx.box(
|
||||||
rx.popover.root(
|
rx.popover.root(
|
||||||
rx.popover.trigger(
|
rx.popover.trigger(
|
||||||
|
|
@ -206,59 +207,6 @@ def task_history(
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def conversation_history(
|
|
||||||
is_conversation_history_shown: bool,
|
|
||||||
) -> rx.Component:
|
|
||||||
"""
|
|
||||||
会话历史
|
|
||||||
:param is_conversation_history_shown: 展示 / 隐藏
|
|
||||||
:return: Component
|
|
||||||
"""
|
|
||||||
return rx.box(
|
|
||||||
rx.vstack(
|
|
||||||
# 会话历史的标题
|
|
||||||
rx.hstack(
|
|
||||||
rx.text(
|
|
||||||
"会话历史",
|
|
||||||
margin_bottom="8px",
|
|
||||||
font_weight="var(--prismui-font-weight-3)",
|
|
||||||
white_space="nowrap",
|
|
||||||
),
|
|
||||||
align_items="center",
|
|
||||||
justify_content="space-between",
|
|
||||||
),
|
|
||||||
rx.auto_scroll(
|
|
||||||
rx.foreach(
|
|
||||||
TaskState.task_history,
|
|
||||||
task_history_item,
|
|
||||||
),
|
|
||||||
flex="1",
|
|
||||||
align_items="stretch",
|
|
||||||
width="100%",
|
|
||||||
margin_top="8px",
|
|
||||||
style={
|
|
||||||
"&::-webkit-scrollbar": {
|
|
||||||
"display": "none",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
overflow="auto",
|
|
||||||
),
|
|
||||||
display="flex",
|
|
||||||
flex_direction="column",
|
|
||||||
height="100%",
|
|
||||||
padding="12px",
|
|
||||||
background_color="#f9f9f9cc",
|
|
||||||
backdrop_filter="blur(50px)",
|
|
||||||
gap="12px",
|
|
||||||
),
|
|
||||||
width=rx.cond(is_conversation_history_shown, "25%", "0px"),
|
|
||||||
min_width=rx.cond(is_conversation_history_shown, "240px", "0px"),
|
|
||||||
max_width=rx.cond(is_conversation_history_shown, "380px", "0px"),
|
|
||||||
height="100%",
|
|
||||||
transition="all 0.18s ease-in-out",
|
|
||||||
overflow="hidden",
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def workflow_button(workflow_type: WorkflowType):
|
def workflow_button(workflow_type: WorkflowType):
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue