|
@@ -407,98 +407,104 @@ export default function PaasWorkspace(props: { standalone?: boolean; onOpenDevel
|
|
|
<Switch>
|
|
<Switch>
|
|
|
<Match when={state.page === "connection"}>
|
|
<Match when={state.page === "connection"}>
|
|
|
{settingsTabs()}
|
|
{settingsTabs()}
|
|
|
- <div class="paas-section-title">
|
|
|
|
|
- <div>
|
|
|
|
|
- <h1>平台连接</h1>
|
|
|
|
|
- <p>连接团队平台,选择智能体,即可开始研究。</p>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <ol class="paas-start-steps" aria-label="开始研究的三个步骤">
|
|
|
|
|
- <li data-ready={state.connected}>1 · 连接平台</li>
|
|
|
|
|
- <li data-ready={state.connected && !!state.agents.length}>2 · 选择智能体</li>
|
|
|
|
|
- <li>3 · 添加材料,开始研究</li>
|
|
|
|
|
- </ol>
|
|
|
|
|
- <section class="paas-panel paas-connect paas-connection-page" aria-label="平台连接">
|
|
|
|
|
- <div>
|
|
|
|
|
- <strong>{state.connected ? "连接信息" : "连接你的 AgentPaaS"}</strong>
|
|
|
|
|
- <p>填写管理员提供的平台地址与访问凭证,即可开始研究。已有本机平台服务可直接一键连接。</p>
|
|
|
|
|
- <p class="paas-muted">桌面端不会自动安装平台服务。记住连接后,下次打开可自动进入工作台。</p>
|
|
|
|
|
- </div>
|
|
|
|
|
- <Show
|
|
|
|
|
- when={!state.connected}
|
|
|
|
|
- fallback={
|
|
|
|
|
- <div class="paas-actions">
|
|
|
|
|
- <code>{state.url}</code>
|
|
|
|
|
- <small>{state.remembered ? "连接已安全保存" : "当前为会话连接;未持久保存凭证"}</small>
|
|
|
|
|
- <button disabled={!!state.busy} onClick={workspace.disconnect}>
|
|
|
|
|
- 断开连接
|
|
|
|
|
- </button>
|
|
|
|
|
|
|
+ <div class="paas-settings-layout">
|
|
|
|
|
+ <div class="paas-settings-main">
|
|
|
|
|
+ <div class="paas-section-title">
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <h1>平台连接</h1>
|
|
|
|
|
+ <p>连接团队平台,选择智能体,即可开始研究。</p>
|
|
|
</div>
|
|
</div>
|
|
|
- }
|
|
|
|
|
- >
|
|
|
|
|
- <form
|
|
|
|
|
- onSubmit={(event) => {
|
|
|
|
|
- event.preventDefault()
|
|
|
|
|
- void workspace.connect()
|
|
|
|
|
- }}
|
|
|
|
|
- >
|
|
|
|
|
- <label>
|
|
|
|
|
- 平台地址
|
|
|
|
|
- <input
|
|
|
|
|
- type="url"
|
|
|
|
|
- required
|
|
|
|
|
- value={state.url}
|
|
|
|
|
- disabled={!!state.busy}
|
|
|
|
|
- onInput={(event) => workspace.setState("url", event.currentTarget.value)}
|
|
|
|
|
- placeholder="https://paas.example.com"
|
|
|
|
|
- />
|
|
|
|
|
- </label>
|
|
|
|
|
- <label>
|
|
|
|
|
- API Key
|
|
|
|
|
- <input
|
|
|
|
|
- type="password"
|
|
|
|
|
- required
|
|
|
|
|
- autocomplete="off"
|
|
|
|
|
- value={state.apiKey}
|
|
|
|
|
- disabled={!!state.busy}
|
|
|
|
|
- onInput={(event) => workspace.setState("apiKey", event.currentTarget.value)}
|
|
|
|
|
- placeholder="输入平台凭证"
|
|
|
|
|
- />
|
|
|
|
|
- </label>
|
|
|
|
|
- <label>
|
|
|
|
|
- <input
|
|
|
|
|
- type="checkbox"
|
|
|
|
|
- checked={state.remember}
|
|
|
|
|
- onChange={(event) => workspace.setState("remember", event.currentTarget.checked)}
|
|
|
|
|
- />
|
|
|
|
|
- 记住连接(加密保存凭证)
|
|
|
|
|
- </label>
|
|
|
|
|
- <button class="paas-primary" type="submit" disabled={!platform.paas || !!state.busy}>
|
|
|
|
|
- 连接平台
|
|
|
|
|
- </button>
|
|
|
|
|
- <button
|
|
|
|
|
- type="button"
|
|
|
|
|
- disabled={!platform.paas || !!state.busy}
|
|
|
|
|
- onClick={() => void workspace.connect(true)}
|
|
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <ol class="paas-start-steps" aria-label="开始研究的三个步骤">
|
|
|
|
|
+ <li data-ready={state.connected}>1 · 连接平台</li>
|
|
|
|
|
+ <li data-ready={state.connected && !!state.agents.length}>2 · 选择智能体</li>
|
|
|
|
|
+ <li>3 · 添加材料,开始研究</li>
|
|
|
|
|
+ </ol>
|
|
|
|
|
+ <section class="paas-panel paas-connect paas-connection-page" aria-label="平台连接">
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <strong>{state.connected ? "连接信息" : "连接你的 AgentPaaS"}</strong>
|
|
|
|
|
+ <p>填写管理员提供的平台地址与访问凭证,即可开始研究。已有本机平台服务可直接一键连接。</p>
|
|
|
|
|
+ <p class="paas-muted">桌面端不会自动安装平台服务。记住连接后,下次打开可自动进入工作台。</p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <Show
|
|
|
|
|
+ when={!state.connected}
|
|
|
|
|
+ fallback={
|
|
|
|
|
+ <div class="paas-actions">
|
|
|
|
|
+ <code>{state.url}</code>
|
|
|
|
|
+ <small>{state.remembered ? "连接已安全保存" : "当前为会话连接;未持久保存凭证"}</small>
|
|
|
|
|
+ <button disabled={!!state.busy} onClick={workspace.disconnect}>
|
|
|
|
|
+ 断开连接
|
|
|
|
|
+ </button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ }
|
|
|
>
|
|
>
|
|
|
- 一键连接本机
|
|
|
|
|
- </button>
|
|
|
|
|
- </form>
|
|
|
|
|
- </Show>
|
|
|
|
|
- </section>
|
|
|
|
|
|
|
+ <form
|
|
|
|
|
+ onSubmit={(event) => {
|
|
|
|
|
+ event.preventDefault()
|
|
|
|
|
+ void workspace.connect()
|
|
|
|
|
+ }}
|
|
|
|
|
+ >
|
|
|
|
|
+ <label>
|
|
|
|
|
+ 平台地址
|
|
|
|
|
+ <input
|
|
|
|
|
+ type="url"
|
|
|
|
|
+ required
|
|
|
|
|
+ value={state.url}
|
|
|
|
|
+ disabled={!!state.busy}
|
|
|
|
|
+ onInput={(event) => workspace.setState("url", event.currentTarget.value)}
|
|
|
|
|
+ placeholder="https://paas.example.com"
|
|
|
|
|
+ />
|
|
|
|
|
+ </label>
|
|
|
|
|
+ <label>
|
|
|
|
|
+ API Key
|
|
|
|
|
+ <input
|
|
|
|
|
+ type="password"
|
|
|
|
|
+ required
|
|
|
|
|
+ autocomplete="off"
|
|
|
|
|
+ value={state.apiKey}
|
|
|
|
|
+ disabled={!!state.busy}
|
|
|
|
|
+ onInput={(event) => workspace.setState("apiKey", event.currentTarget.value)}
|
|
|
|
|
+ placeholder="输入平台凭证"
|
|
|
|
|
+ />
|
|
|
|
|
+ </label>
|
|
|
|
|
+ <label>
|
|
|
|
|
+ <input
|
|
|
|
|
+ type="checkbox"
|
|
|
|
|
+ checked={state.remember}
|
|
|
|
|
+ onChange={(event) => workspace.setState("remember", event.currentTarget.checked)}
|
|
|
|
|
+ />
|
|
|
|
|
+ 记住连接(加密保存凭证)
|
|
|
|
|
+ </label>
|
|
|
|
|
+ <button class="paas-primary" type="submit" disabled={!platform.paas || !!state.busy}>
|
|
|
|
|
+ 连接平台
|
|
|
|
|
+ </button>
|
|
|
|
|
+ <button
|
|
|
|
|
+ type="button"
|
|
|
|
|
+ disabled={!platform.paas || !!state.busy}
|
|
|
|
|
+ onClick={() => void workspace.connect(true)}
|
|
|
|
|
+ >
|
|
|
|
|
+ 一键连接本机
|
|
|
|
|
+ </button>
|
|
|
|
|
+ </form>
|
|
|
|
|
+ </Show>
|
|
|
|
|
+ </section>
|
|
|
|
|
|
|
|
- <details class="paas-panel">
|
|
|
|
|
- <summary>还没有平台地址,或本机连接失败?</summary>
|
|
|
|
|
- <p>使用团队服务时,请向管理员获取平台地址和平台访问凭证;这里填写的不是模型 API Key。</p>
|
|
|
|
|
- <p>已有本机部署时,先启动 AgentPaaS 服务,再点击“一键连接本机”。桌面端不会替你安装后台服务。</p>
|
|
|
|
|
- <p>模型、工具和知识库在智能体设置中管理。资源检查可帮助定位问题,不是开始研究的必经审批。</p>
|
|
|
|
|
- </details>
|
|
|
|
|
- <Show when={state.connected}>
|
|
|
|
|
- <p class="paas-muted">已加载 {state.agents.length} 个智能体。重新连接后可继续查看平台历史会话。</p>
|
|
|
|
|
- <button class="paas-primary" onClick={() => workspace.setState("page", "chat")}>
|
|
|
|
|
- 进入会话
|
|
|
|
|
- </button>
|
|
|
|
|
- </Show>
|
|
|
|
|
|
|
+ <Show when={state.connected}>
|
|
|
|
|
+ <p class="paas-muted">已加载 {state.agents.length} 个智能体。重新连接后可继续查看平台历史会话。</p>
|
|
|
|
|
+ <button class="paas-primary" onClick={() => workspace.setState("page", "chat")}>
|
|
|
|
|
+ 进入会话
|
|
|
|
|
+ </button>
|
|
|
|
|
+ </Show>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <aside class="paas-settings-side">
|
|
|
|
|
+ <details class="paas-panel">
|
|
|
|
|
+ <summary>还没有平台地址,或本机连接失败?</summary>
|
|
|
|
|
+ <p>使用团队服务时,请向管理员获取平台地址和平台访问凭证;这里填写的不是模型 API Key。</p>
|
|
|
|
|
+ <p>已有本机部署时,先启动 AgentPaaS 服务,再点击“一键连接本机”。桌面端不会替你安装后台服务。</p>
|
|
|
|
|
+ <p>模型、工具和知识库在智能体设置中管理。资源检查可帮助定位问题,不是开始研究的必经审批。</p>
|
|
|
|
|
+ </details>
|
|
|
|
|
+ </aside>
|
|
|
|
|
+ </div>
|
|
|
</Match>
|
|
</Match>
|
|
|
<Match when={state.page === "agents"}>
|
|
<Match when={state.page === "agents"}>
|
|
|
<div class="paas-directory-heading">
|
|
<div class="paas-directory-heading">
|
|
@@ -687,107 +693,110 @@ export default function PaasWorkspace(props: { standalone?: boolean; onOpenDevel
|
|
|
setUI("chatTask", run)
|
|
setUI("chatTask", run)
|
|
|
workspace.setState("page", "chat")
|
|
workspace.setState("page", "chat")
|
|
|
}}
|
|
}}
|
|
|
|
|
+ onNewResearch={() => actions.newSession?.()}
|
|
|
/>
|
|
/>
|
|
|
</Match>
|
|
</Match>
|
|
|
<Match when={state.page === "resources"}>
|
|
<Match when={state.page === "resources"}>
|
|
|
{settingsTabs()}
|
|
{settingsTabs()}
|
|
|
- <div class="paas-section-title">
|
|
|
|
|
- <div>
|
|
|
|
|
- <h1>资源检查</h1>
|
|
|
|
|
- <p>核对模型、知识库与 Skill / MCP 的可用状态;检查不会创建研究任务。</p>
|
|
|
|
|
|
|
+ <div class="paas-settings-main paas-resource-page">
|
|
|
|
|
+ <div class="paas-section-title">
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <h1>资源检查</h1>
|
|
|
|
|
+ <p>核对模型、知识库与 Skill / MCP 的可用状态;检查不会创建研究任务。</p>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
- </div>
|
|
|
|
|
- <div class="paas-toolbar">
|
|
|
|
|
- <label>
|
|
|
|
|
- 智能体
|
|
|
|
|
- <select
|
|
|
|
|
- value={state.agentID}
|
|
|
|
|
- disabled={disabled()}
|
|
|
|
|
- onChange={(event) => workspace.selectAgent(event.currentTarget.value)}
|
|
|
|
|
|
|
+ <div class="paas-toolbar">
|
|
|
|
|
+ <label>
|
|
|
|
|
+ 智能体
|
|
|
|
|
+ <select
|
|
|
|
|
+ value={state.agentID}
|
|
|
|
|
+ disabled={disabled()}
|
|
|
|
|
+ onChange={(event) => workspace.selectAgent(event.currentTarget.value)}
|
|
|
|
|
+ >
|
|
|
|
|
+ <For each={state.agents}>
|
|
|
|
|
+ {(agent) => <option value={paasText(agent.id)}>{paasText(agent.name)}</option>}
|
|
|
|
|
+ </For>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ </label>
|
|
|
|
|
+ <button
|
|
|
|
|
+ class="paas-primary"
|
|
|
|
|
+ disabled={disabled() || !state.agentID}
|
|
|
|
|
+ onClick={() => void workspace.verify()}
|
|
|
>
|
|
>
|
|
|
- <For each={state.agents}>
|
|
|
|
|
- {(agent) => <option value={paasText(agent.id)}>{paasText(agent.name)}</option>}
|
|
|
|
|
- </For>
|
|
|
|
|
- </select>
|
|
|
|
|
- </label>
|
|
|
|
|
- <button
|
|
|
|
|
- class="paas-primary"
|
|
|
|
|
- disabled={disabled() || !state.agentID}
|
|
|
|
|
- onClick={() => void workspace.verify()}
|
|
|
|
|
- >
|
|
|
|
|
- 检查资源
|
|
|
|
|
- </button>
|
|
|
|
|
- <button disabled={disabled() || !state.agentID} onClick={() => void workspace.verify(true)}>
|
|
|
|
|
- 测试模型连接
|
|
|
|
|
- </button>
|
|
|
|
|
- <button
|
|
|
|
|
- disabled={disabled() || !state.agentID}
|
|
|
|
|
- onClick={() => {
|
|
|
|
|
- setUI({ editAgentID: state.agentID, editReturn: "resources" })
|
|
|
|
|
- workspace.setState("page", "edit-agent")
|
|
|
|
|
- }}
|
|
|
|
|
- >
|
|
|
|
|
- 配置模型与知识库
|
|
|
|
|
- </button>
|
|
|
|
|
- <button
|
|
|
|
|
- class="paas-text-action"
|
|
|
|
|
- disabled={disabled() || !state.agentID}
|
|
|
|
|
- onClick={() => {
|
|
|
|
|
- setUI("chatAgentID", state.agentID)
|
|
|
|
|
- workspace.setState("page", "chat")
|
|
|
|
|
- }}
|
|
|
|
|
- >
|
|
|
|
|
- 直接开始研究
|
|
|
|
|
- </button>
|
|
|
|
|
- </div>
|
|
|
|
|
- <p class="paas-muted">
|
|
|
|
|
- “检查资源”不调用模型;“测试模型连接”会发送少量测试请求,消耗模型额度。可跳过检查,直接开始研究。
|
|
|
|
|
- </p>
|
|
|
|
|
- <Show when={state.page === "resources"}>
|
|
|
|
|
- <Show
|
|
|
|
|
- when={state.verified}
|
|
|
|
|
- fallback={
|
|
|
|
|
- <Empty
|
|
|
|
|
- title={state.agentID ? "检查所选智能体的资源" : "先选择智能体"}
|
|
|
|
|
- text={
|
|
|
|
|
- state.agentID
|
|
|
|
|
- ? "尚未检查。结果会显示在这里;也可以跳过检查直接开始研究。"
|
|
|
|
|
- : "选择智能体后可检查绑定资源;模型配置与知识库绑定可在上方设置入口修改。"
|
|
|
|
|
- }
|
|
|
|
|
- />
|
|
|
|
|
- }
|
|
|
|
|
- >
|
|
|
|
|
- <div class="paas-notice">
|
|
|
|
|
- 检查通过仅表示该检查项通过;未检查的模型与知识能力不能据此认定可用。此页展示实际绑定的检查结果,不修改资源。
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ 检查资源
|
|
|
|
|
+ </button>
|
|
|
|
|
+ <button disabled={disabled() || !state.agentID} onClick={() => void workspace.verify(true)}>
|
|
|
|
|
+ 测试模型连接
|
|
|
|
|
+ </button>
|
|
|
|
|
+ <button
|
|
|
|
|
+ disabled={disabled() || !state.agentID}
|
|
|
|
|
+ onClick={() => {
|
|
|
|
|
+ setUI({ editAgentID: state.agentID, editReturn: "resources" })
|
|
|
|
|
+ workspace.setState("page", "edit-agent")
|
|
|
|
|
+ }}
|
|
|
|
|
+ >
|
|
|
|
|
+ 配置模型与知识库
|
|
|
|
|
+ </button>
|
|
|
|
|
+ <button
|
|
|
|
|
+ class="paas-text-action"
|
|
|
|
|
+ disabled={disabled() || !state.agentID}
|
|
|
|
|
+ onClick={() => {
|
|
|
|
|
+ setUI("chatAgentID", state.agentID)
|
|
|
|
|
+ workspace.setState("page", "chat")
|
|
|
|
|
+ }}
|
|
|
|
|
+ >
|
|
|
|
|
+ 直接开始研究
|
|
|
|
|
+ </button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <p class="paas-muted">
|
|
|
|
|
+ “检查资源”不调用模型;“测试模型连接”会发送少量测试请求,消耗模型额度。可跳过检查,直接开始研究。
|
|
|
|
|
+ </p>
|
|
|
|
|
+ <Show when={state.page === "resources"}>
|
|
|
<Show
|
|
<Show
|
|
|
- when={state.checks.length}
|
|
|
|
|
- fallback={<Empty title="平台没有返回检查项" text="空报告不代表所有资源均可用。" />}
|
|
|
|
|
|
|
+ when={state.verified}
|
|
|
|
|
+ fallback={
|
|
|
|
|
+ <Empty
|
|
|
|
|
+ title={state.agentID ? "检查所选智能体的资源" : "先选择智能体"}
|
|
|
|
|
+ text={
|
|
|
|
|
+ state.agentID
|
|
|
|
|
+ ? "尚未检查。结果会显示在这里;也可以跳过检查直接开始研究。"
|
|
|
|
|
+ : "选择智能体后可检查绑定资源;模型配置与知识库绑定可在上方设置入口修改。"
|
|
|
|
|
+ }
|
|
|
|
|
+ />
|
|
|
|
|
+ }
|
|
|
>
|
|
>
|
|
|
- <div class="paas-agent-grid">
|
|
|
|
|
- <For each={state.checks}>
|
|
|
|
|
- {(check) => (
|
|
|
|
|
- <article class="paas-panel">
|
|
|
|
|
- <span class="paas-eyebrow">
|
|
|
|
|
- {paasText(check.kind) || "资源"} · {check.required === true ? "必需" : "可选"}
|
|
|
|
|
- </span>
|
|
|
|
|
- <h2>{paasText(check.name) || "未命名资源"}</h2>
|
|
|
|
|
- <span class="paas-badge" data-status={paasText(check.status)}>
|
|
|
|
|
- {(
|
|
|
|
|
- { passed: "检查通过", failed: "检查失败", not_checked: "未检查" } as Record<
|
|
|
|
|
- string,
|
|
|
|
|
- string
|
|
|
|
|
- >
|
|
|
|
|
- )[paasText(check.status)] || "状态未知"}
|
|
|
|
|
- </span>
|
|
|
|
|
- <p>{paasText(check.error_code) || paasText(check.message)}</p>
|
|
|
|
|
- </article>
|
|
|
|
|
- )}
|
|
|
|
|
- </For>
|
|
|
|
|
|
|
+ <div class="paas-notice">
|
|
|
|
|
+ 检查通过仅表示该检查项通过;未检查的模型与知识能力不能据此认定可用。此页展示实际绑定的检查结果,不修改资源。
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <Show
|
|
|
|
|
+ when={state.checks.length}
|
|
|
|
|
+ fallback={<Empty title="平台没有返回检查项" text="空报告不代表所有资源均可用。" />}
|
|
|
|
|
+ >
|
|
|
|
|
+ <div class="paas-agent-grid">
|
|
|
|
|
+ <For each={state.checks}>
|
|
|
|
|
+ {(check) => (
|
|
|
|
|
+ <article class="paas-panel">
|
|
|
|
|
+ <span class="paas-eyebrow">
|
|
|
|
|
+ {paasText(check.kind) || "资源"} · {check.required === true ? "必需" : "可选"}
|
|
|
|
|
+ </span>
|
|
|
|
|
+ <h2>{paasText(check.name) || "未命名资源"}</h2>
|
|
|
|
|
+ <span class="paas-badge" data-status={paasText(check.status)}>
|
|
|
|
|
+ {(
|
|
|
|
|
+ { passed: "检查通过", failed: "检查失败", not_checked: "未检查" } as Record<
|
|
|
|
|
+ string,
|
|
|
|
|
+ string
|
|
|
|
|
+ >
|
|
|
|
|
+ )[paasText(check.status)] || "状态未知"}
|
|
|
|
|
+ </span>
|
|
|
|
|
+ <p>{paasText(check.error_code) || paasText(check.message)}</p>
|
|
|
|
|
+ </article>
|
|
|
|
|
+ )}
|
|
|
|
|
+ </For>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </Show>
|
|
|
</Show>
|
|
</Show>
|
|
|
</Show>
|
|
</Show>
|
|
|
- </Show>
|
|
|
|
|
|
|
+ </div>
|
|
|
</Match>
|
|
</Match>
|
|
|
</Switch>
|
|
</Switch>
|
|
|
</div>
|
|
</div>
|