|
@@ -183,6 +183,10 @@ export function PaasChat(props: {
|
|
|
},
|
|
},
|
|
|
),
|
|
),
|
|
|
)
|
|
)
|
|
|
|
|
+ function refreshHistory() {
|
|
|
|
|
+ if (!props.api || !props.connected) return
|
|
|
|
|
+ props.agents.forEach((agent) => void history(paasText(agent.id)))
|
|
|
|
|
+ }
|
|
|
async function history(agentID: string) {
|
|
async function history(agentID: string) {
|
|
|
if (!props.api || !props.connected || ui.loading[agentID]) return
|
|
if (!props.api || !props.connected || ui.loading[agentID]) return
|
|
|
const epoch = life.epoch
|
|
const epoch = life.epoch
|
|
@@ -324,14 +328,28 @@ export function PaasChat(props: {
|
|
|
<section class="paas-nav-history-panel" aria-label="智能体会话导航">
|
|
<section class="paas-nav-history-panel" aria-label="智能体会话导航">
|
|
|
<div class="paas-session-heading">
|
|
<div class="paas-session-heading">
|
|
|
<strong>研究会话</strong>
|
|
<strong>研究会话</strong>
|
|
|
- <button
|
|
|
|
|
- type="button"
|
|
|
|
|
- aria-label="从 AgentPack 创建智能体"
|
|
|
|
|
- disabled={!props.connected}
|
|
|
|
|
- onClick={props.onOpenAgentPacks}
|
|
|
|
|
- >
|
|
|
|
|
- <Icon name="plus-small" />
|
|
|
|
|
- </button>
|
|
|
|
|
|
|
+ <div class="paas-session-heading-actions">
|
|
|
|
|
+ <button
|
|
|
|
|
+ type="button"
|
|
|
|
|
+ class="paas-session-icon-button"
|
|
|
|
|
+ aria-label="刷新历史会话"
|
|
|
|
|
+ title="刷新历史会话"
|
|
|
|
|
+ disabled={!props.connected}
|
|
|
|
|
+ onClick={refreshHistory}
|
|
|
|
|
+ >
|
|
|
|
|
+ <Icon name="reset" size="small" />
|
|
|
|
|
+ </button>
|
|
|
|
|
+ <button
|
|
|
|
|
+ type="button"
|
|
|
|
|
+ class="paas-session-icon-button"
|
|
|
|
|
+ aria-label="从 AgentPack 创建智能体"
|
|
|
|
|
+ title="从 AgentPack 创建智能体"
|
|
|
|
|
+ disabled={!props.connected}
|
|
|
|
|
+ onClick={props.onOpenAgentPacks}
|
|
|
|
|
+ >
|
|
|
|
|
+ <Icon name="plus-small" size="small" />
|
|
|
|
|
+ </button>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
<input
|
|
<input
|
|
|
class="paas-chat-search"
|
|
class="paas-chat-search"
|
|
@@ -408,12 +426,6 @@ export function PaasChat(props: {
|
|
|
</button>
|
|
</button>
|
|
|
)}
|
|
)}
|
|
|
</For>
|
|
</For>
|
|
|
- <button
|
|
|
|
|
- disabled={ui.loading[paasText(agent.id)]}
|
|
|
|
|
- onClick={() => void history(paasText(agent.id))}
|
|
|
|
|
- >
|
|
|
|
|
- {ui.loading[paasText(agent.id)] ? "正在读取历史…" : "刷新历史会话"}
|
|
|
|
|
- </button>
|
|
|
|
|
<Show when={ui.historyError[paasText(agent.id)]}>
|
|
<Show when={ui.historyError[paasText(agent.id)]}>
|
|
|
<small role="status">{ui.historyError[paasText(agent.id)]}</small>
|
|
<small role="status">{ui.historyError[paasText(agent.id)]}</small>
|
|
|
</Show>
|
|
</Show>
|
|
@@ -439,26 +451,35 @@ export function PaasChat(props: {
|
|
|
研究设置
|
|
研究设置
|
|
|
</button>
|
|
</button>
|
|
|
</Show>
|
|
</Show>
|
|
|
- <details class="paas-more-actions">
|
|
|
|
|
- <summary>更多操作</summary>
|
|
|
|
|
- <Show when={current()}>
|
|
|
|
|
- <button onClick={() => setUI({ renaming: true, title: current()!.title })}>重命名会话</button>
|
|
|
|
|
- <button title="仅整理本机列表,不会停止后台任务" onClick={() => model.archive()}>
|
|
|
|
|
- {current()?.archived ? "取消归档" : "在本机归档"}
|
|
|
|
|
- </button>
|
|
|
|
|
- </Show>
|
|
|
|
|
- <Show when={currentAgent() && props.onOpenWorkspace}>
|
|
|
|
|
- <button
|
|
|
|
|
- disabled={props.workspaceDisabled}
|
|
|
|
|
- onClick={() => void props.onOpenWorkspace?.(current()!.agentID)}
|
|
|
|
|
- >
|
|
|
|
|
- 打开工作区
|
|
|
|
|
- </button>
|
|
|
|
|
- </Show>
|
|
|
|
|
- </details>
|
|
|
|
|
<button disabled={!props.connected || !currentAgent()} onClick={() => model.choose(currentAgent()!, true)}>
|
|
<button disabled={!props.connected || !currentAgent()} onClick={() => model.choose(currentAgent()!, true)}>
|
|
|
新会话
|
|
新会话
|
|
|
</button>
|
|
</button>
|
|
|
|
|
+ <details class="paas-more-actions">
|
|
|
|
|
+ <summary>更多操作</summary>
|
|
|
|
|
+ <div
|
|
|
|
|
+ class="paas-more-actions-menu"
|
|
|
|
|
+ onClick={(event) => {
|
|
|
|
|
+ if (!(event.target as HTMLElement).closest("button")) return
|
|
|
|
|
+ const details = event.currentTarget.parentElement as HTMLDetailsElement | null
|
|
|
|
|
+ if (details) details.open = false
|
|
|
|
|
+ }}
|
|
|
|
|
+ >
|
|
|
|
|
+ <Show when={current()}>
|
|
|
|
|
+ <button onClick={() => setUI({ renaming: true, title: current()!.title })}>重命名会话</button>
|
|
|
|
|
+ <button title="仅整理本机列表,不会停止后台任务" onClick={() => model.archive()}>
|
|
|
|
|
+ {current()?.archived ? "取消归档" : "在本机归档"}
|
|
|
|
|
+ </button>
|
|
|
|
|
+ </Show>
|
|
|
|
|
+ <Show when={currentAgent() && props.onOpenWorkspace}>
|
|
|
|
|
+ <button
|
|
|
|
|
+ disabled={props.workspaceDisabled}
|
|
|
|
|
+ onClick={() => void props.onOpenWorkspace?.(current()!.agentID)}
|
|
|
|
|
+ >
|
|
|
|
|
+ 打开工作区
|
|
|
|
|
+ </button>
|
|
|
|
|
+ </Show>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </details>
|
|
|
</div>
|
|
</div>
|
|
|
</header>
|
|
</header>
|
|
|
<Show when={ui.renaming}>
|
|
<Show when={ui.renaming}>
|