430 lines
27 KiB
HTML
430 lines
27 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="zh">
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||
<title>Agent 任务台</title>
|
||
<script src="/vendor/marked.min.js"></script>
|
||
<meta name="theme-color" content="#3964FE">
|
||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
||
<meta name="apple-mobile-web-app-title" content="Agent">
|
||
<link rel="manifest" href="/manifest.json">
|
||
<link rel="apple-touch-icon" href="/icons/apple-touch-icon.png">
|
||
<link rel="icon" type="image/png" sizes="192x192" href="/icons/icon-192.png">
|
||
<link rel="stylesheet" href="/css/style.css">
|
||
<style>
|
||
/* 「压缩」摘要卡片:与 .msg-think 同族的折叠交互,但做成更醒目的蓝色调卡片;
|
||
流式收尾(live)和历史重渲染(type='summary' 消息)共用同一套样式。
|
||
live 阶段 open=true 展开阅读;历史重渲染默认收起。 */
|
||
.msg-summary {
|
||
margin: 0 0 8px; border: 1px solid #dbe4fb; border-radius: 12px; overflow: hidden;
|
||
background: linear-gradient(180deg, #f7f9ff 0%, #ffffff 56%);
|
||
box-shadow: 0 1px 3px rgba(57, 100, 254, 0.08);
|
||
}
|
||
.msg-summary > summary {
|
||
list-style: none; cursor: pointer; user-select: none;
|
||
display: flex; align-items: center; gap: 7px;
|
||
padding: 9px 12px; font-size: 13px; font-weight: 600; color: var(--active);
|
||
}
|
||
.msg-summary > summary::-webkit-details-marker { display: none; }
|
||
.msg-summary > summary::before {
|
||
content: ''; flex: none; width: 0; height: 0; margin-left: 1px;
|
||
border-left: 5px solid var(--active); border-top: 4px solid transparent; border-bottom: 4px solid transparent;
|
||
transition: transform .15s ease;
|
||
}
|
||
.msg-summary[open] > summary::before { transform: rotate(90deg); }
|
||
.msg-summary .sum-ic { flex: none; width: 15px; height: 15px; }
|
||
.msg-summary .sum-hint { margin-left: auto; font-size: 11px; font-weight: 400; color: var(--gray); }
|
||
.msg-summary-body {
|
||
border-top: 1px dashed #dbe4fb; background: var(--page);
|
||
padding: 10px 13px 12px;
|
||
}
|
||
.msg-summary-body .bubble-ai { margin: 0; font-size: 14px; line-height: 1.7; }
|
||
/* 「仅摘要」后摘要之前的旧历史:UI 保留但变淡,尾部附存档说明(不再发给 AI) */
|
||
.msg-archived { opacity: .55; }
|
||
.archived-note {
|
||
display: flex; align-items: center; gap: 8px;
|
||
margin: 10px 0 12px; font-size: 11px; color: var(--gray);
|
||
}
|
||
.archived-note::before, .archived-note::after { content: ''; flex: 1; height: 1px; background: var(--border); }
|
||
/* 状态栏图标按钮(压缩):仅显示 SVG、去掉文字 padding;保持与文字按钮同高。 */
|
||
.stop-link.icon-only { padding: 0 8px; line-height: 0; }
|
||
.stop-link.icon-only .ic { width: 18px; height: 18px; vertical-align: middle; }
|
||
/* 状态栏「压缩」图标按钮:主操作色(蓝色),与其他 stop-link 区分(终止/选择模型是灰) */
|
||
.stop-link.icon-only.icon-primary { color: var(--active); }
|
||
.stop-link.icon-only.icon-primary:hover { color: #2854d6; }
|
||
/* 推到 phase-bar 最右侧(独立动作,与左侧状态/选择模型区分) */
|
||
.phase-bar .phase-bar-right { margin-left: auto; }
|
||
/* 定时任务状态条:整条可点,弹详情窗(改频次/提示词、删除;创建走 AI 的 schedule_task 工具),淡黄底区别于状态栏。
|
||
高度与 phase-bar 对齐:同 6px 上下内边距,sched-text 用与 stop-link 同构的 12px 字 + 4px 上下 padding(天然同 line-box),eye 同 icon-only 钮 */
|
||
.schedule-bar {
|
||
flex: none; display: flex; align-items: center; gap: 8px;
|
||
padding: 6px 12px; font-size: 12px; color: #8a6400; cursor: pointer;
|
||
background: #fffdf2; border-bottom: 1px solid #f0e6c8;
|
||
}
|
||
.schedule-bar:active { opacity: 0.75; }
|
||
.schedule-bar .sched-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 4px 0; }
|
||
/* eye 图标与 phase-bar 右侧 icon-only 钮垂直对齐:同 6px 上下内边距、同 0 8px 水平、同 18px 图标 */
|
||
.schedule-bar .sched-eye { margin-left: auto; flex: none; padding: 0 8px; line-height: 0; }
|
||
.schedule-bar .sched-eye .ic { width: 18px; height: 18px; vertical-align: middle; }
|
||
/* schedule 弹窗控件(.modal select/input 的 100% 宽会撑满整行,这里收窄成本行内样式) */
|
||
#schedule-modal .sched-row { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; font-size: 14px; color: var(--ink); flex-wrap: wrap; }
|
||
#schedule-modal .sched-row select,
|
||
#schedule-modal .sched-row input {
|
||
width: auto; margin: 0; padding: 7px 8px; font-size: 14px;
|
||
border: 1px solid #dde1ea; border-radius: 8px; background: #fff; color: var(--ink);
|
||
}
|
||
#schedule-modal .sched-row select { appearance: none; -webkit-appearance: none; }
|
||
#schedule-modal .sched-row .sched-num { width: 52px; text-align: center; }
|
||
#schedule-modal .sched-row .sched-grow { flex: 1; min-width: 130px; font-family: monospace; }
|
||
#schedule-modal .sched-meta { font-size: 12.5px; color: var(--gray); margin-bottom: 10px; white-space: pre-wrap; }
|
||
/* schedule 弹窗内的提示词编辑区(.modal input 不覆盖 textarea,单独给样式) */
|
||
#schedule-modal textarea {
|
||
width: 100%; box-sizing: border-box; display: block;
|
||
border: 1px solid #dde1ea; border-radius: 10px;
|
||
padding: 10px 12px; font-size: 14px; line-height: 1.5;
|
||
margin-bottom: 10px; background: #fff; color: var(--ink); resize: vertical;
|
||
}
|
||
#schedule-modal textarea:focus { border-color: var(--active); }
|
||
</style>
|
||
<script>
|
||
// 注册 Service Worker(PWA / 离线缓存)
|
||
if ('serviceWorker' in navigator) {
|
||
window.addEventListener('load', () => {
|
||
navigator.serviceWorker.register('/sw.js').catch((err) => {
|
||
console.warn('[SW] register failed:', err);
|
||
});
|
||
});
|
||
}
|
||
</script>
|
||
</head>
|
||
<body>
|
||
<div id="app">
|
||
|
||
<!-- ================= 顶部导航栏 ================= -->
|
||
<header class="header">
|
||
<button class="icon-btn" id="menu-btn" title="历史记录" aria-label="打开历史记录">
|
||
<svg viewBox="0 0 24 24" class="ic sm"><path stroke-width="2" stroke-linecap="round" d="M4 5h16M4 15h10"/></svg>
|
||
</button>
|
||
<div class="header-center" id="header-center"><!-- 未对话状态为空白,JS 注入对话信息 --></div>
|
||
<button class="icon-btn hidden" id="new-chat-btn" title="新建对话" aria-label="新建对话">
|
||
<svg class="ic" viewBox="0 0 24 24"><line x1="12" y1="5" x2="12" y2="19"></line><line x1="5" y1="12" x2="19" y2="12"></line></svg>
|
||
</button>
|
||
</header>
|
||
|
||
<!-- ================= 会话状态栏(搬自 index 的 phase-bar;仅在对话中显示) ================= -->
|
||
<div id="phase-bar" class="phase-bar hidden">
|
||
<span class="status-pill" id="status-pill">--</span>
|
||
<button class="stop-link hidden" id="stop-btn" onclick="stopSession()">终止</button>
|
||
<button class="stop-link hidden" id="model-switch-btn" onclick="openModelSwitch()">选择模型</button>
|
||
<button class="stop-link icon-only icon-primary phase-bar-right hidden" id="compress-btn" title="压缩上下文" aria-label="压缩上下文" onclick="summarizeChat()">
|
||
<svg class="ic" viewBox="0 0 24 24"><ellipse cx="12" cy="5" rx="8" ry="2.5" fill="none" stroke="currentColor" stroke-width="1.6"></ellipse><path fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" d="M4 5v6c0 1.4 3.6 2.5 8 2.5s8-1.1 8-2.5V5"></path><path fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" d="M4 11v6c0 1.4 3.6 2.5 8 2.5s8-1.1 8-2.5v-6"></path></svg>
|
||
</button>
|
||
</div>
|
||
|
||
<!-- ================= 定时任务状态栏(有任务才显示;数据随会话详情下发,见 routes/sessions.js GET /:id) ================= -->
|
||
<div id="schedule-bar" class="schedule-bar hidden" onclick="openScheduleModal()"></div>
|
||
|
||
<main>
|
||
<!-- ================= 未对话状态:模式切换区 ================= -->
|
||
<section id="welcome-view">
|
||
<div class="welcome-head">
|
||
<div class="logo-badge">
|
||
<svg class="ic" viewBox="0 0 24 24"><rect x="4" y="8" width="16" height="12" rx="3"></rect><line x1="12" y1="4" x2="12" y2="8"></line><circle cx="12" cy="3" r="1.4"></circle><circle cx="9" cy="13.5" r="1" fill="currentColor" stroke="none"></circle><circle cx="15" cy="13.5" r="1" fill="currentColor" stroke="none"></circle><line x1="9.5" y1="17" x2="14.5" y2="17"></line></svg>
|
||
</div>
|
||
<div class="welcome-slogan">选择模式开始对话</div>
|
||
</div>
|
||
|
||
<div class="mode-switch" role="tablist" id="mode-switch">
|
||
<button class="mode-chip on" data-mode="secretary" role="tab" aria-selected="true">
|
||
<svg class="ic sm" viewBox="0 0 24 24"><path d="M6 3h12l4 6-10 13L2 9z"></path><polyline points="2 9 22 9"></polyline><polyline points="10 3 8 9 12 22"></polyline><polyline points="14 3 16 9 12 22"></polyline></svg>
|
||
文秘助理
|
||
</button>
|
||
<button class="mode-chip" data-mode="vision" role="tab" aria-selected="false">
|
||
<svg class="ic sm" viewBox="0 0 24 24"><rect x="3" y="3" width="18" height="18" rx="2"></rect><circle cx="8.5" cy="8.5" r="1.5"></circle><polyline points="21 15 16 10 5 21"></polyline></svg>
|
||
识图专家
|
||
</button>
|
||
</div>
|
||
<div class="mode-hint" id="mode-hint"></div>
|
||
</section>
|
||
|
||
<!-- ================= 对话状态:对话内容区 ================= -->
|
||
<section id="chat-view" class="hidden"></section>
|
||
</main>
|
||
|
||
<!-- ================= 底部输入区 ================= -->
|
||
<footer>
|
||
<div class="attach-chips hidden" id="attach-chips"></div>
|
||
<div class="input-shell">
|
||
<div class="up-cards hidden" id="up-cards" aria-label="已上传文件"></div>
|
||
<textarea id="msg-input" placeholder="传送信息" rows="2" enterkeyhint="enter"></textarea>
|
||
<div class="input-actions">
|
||
<div class="ia-side ia-left">
|
||
<button class="think-toggle" id="deep-think-btn" title="深度思考">
|
||
<svg viewBox="0 0 24 24" class="ic sm"><path d="M12 10.2a1.8 1.8 0 1 0 0.001 3.6A1.8 1.8 0 0 0 12 10.2z"></path><path stroke-width="1.5" d="M15.76 15.76 C10.955 20.565 5.373 22.779 3.297 20.703 C1.22 18.627 3.434 13.045 8.24 8.24 C13.045 3.435 18.627 1.22 20.703 3.297 C22.779 5.374 20.565 10.955 15.76 15.76z"></path><path stroke-width="1.5" d="M16.096 7.904 C20.905 12.713 22.965 18.298 20.703 20.703 C18.44 23.108 13.003 20.755 8.24 15.76 C3.477 10.76 1.22 5.373 3.297 3.297 C5.374 1.22 10.955 3.434 16.096 7.904z"></path></svg>
|
||
深度思考
|
||
</button>
|
||
</div>
|
||
<div class="ia-side ia-right">
|
||
<button class="plus-btn" id="files-btn" title="任务文件" aria-label="任务文件">
|
||
<svg viewBox="0 0 24 24" class="ic sm"><path fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"></path></svg>
|
||
</button>
|
||
<button class="plus-btn" id="attach-btn" title="上传文件" aria-label="上传文件">
|
||
<svg viewBox="0 0 24 24" class="ic sm"><path fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"></path></svg>
|
||
</button>
|
||
<button class="send-btn" id="send-btn" title="发送" aria-label="发送">
|
||
<svg viewBox="0 0 24 24" class="ic sm"><line x1="12" y1="19" x2="12" y2="5"></line><polyline points="5 12 12 5 19 12"></polyline></svg>
|
||
</button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</footer>
|
||
|
||
<!-- 回到底部浮动按钮(搬自 index;上翻历史时出现、AI 输出中常驻转圈) -->
|
||
<button class="scroll-bottom-btn hidden" id="scroll-bottom-btn" onclick="clickScrollBottom()" title="回到底部" aria-label="回到底部">
|
||
<svg class="sb-arrow" viewBox="0 0 24 24"><polyline points="6 9 12 15 18 9"></polyline></svg>
|
||
<svg class="sb-spinner hidden" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle><path d="M22 12a10 10 0 0 1-10 10"></path></svg>
|
||
</button>
|
||
|
||
<!-- ================= 历史记录抽屉 ================= -->
|
||
<div id="scrim"></div>
|
||
<aside id="drawer" aria-label="对话历史">
|
||
<div class="drawer-search">
|
||
<div class="search-box">
|
||
<svg class="ic sm" viewBox="0 0 24 24"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>
|
||
<input type="search" id="search-input" placeholder="搜寻对话内容..." enterkeyhint="search">
|
||
</div>
|
||
</div>
|
||
<div class="drawer-list" id="drawer-list"></div>
|
||
<div class="drawer-user" id="drawer-user">
|
||
<div class="avatar" id="drawer-avatar">A</div>
|
||
<div class="user-name" id="drawer-user-name">Agent 用户</div>
|
||
<button class="user-more" id="user-more-btn" title="更多设置" aria-label="更多设置">
|
||
<svg class="ic sm" viewBox="0 0 24 24"><circle cx="5" cy="12" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="12" cy="12" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="19" cy="12" r="1.4" fill="currentColor" stroke="none"></circle></svg>
|
||
</button>
|
||
</div>
|
||
</aside>
|
||
|
||
<!-- ================= 任务文件面板(浮层:点输入行右侧文件夹按钮展开;盖住输入区+遮罩) ================= -->
|
||
<div id="files-mask" aria-hidden="true"></div>
|
||
<div class="files-panel" id="files-panel" aria-label="任务文件">
|
||
<div class="files-panel-header">
|
||
<div class="files-drag-handle" id="files-drag-handle" aria-label="拖拽调整高度"></div>
|
||
<span class="files-panel-title">任务文件<span class="files-panel-size" id="files-panel-size" title="当前目录下全部文件总大小(含隐藏的 .tmp)"></span></span>
|
||
<label class="file-upload" title="上传文件" aria-label="上传文件">
|
||
<input type="file" id="file-input" multiple hidden>
|
||
<svg viewBox="0 0 24 24"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="17 8 12 3 7 8"></polyline><line x1="12" y1="3" x2="12" y2="15"></line></svg>
|
||
</label>
|
||
</div>
|
||
<div class="files-crumbs hidden" id="files-crumbs" aria-label="目录路径"></div>
|
||
<div class="files-list" id="files-list"></div>
|
||
<div class="files-panel-progress hidden" id="fp-progress" aria-live="polite">
|
||
<div class="fp-track"><div class="bar" id="fp-progress-bar"></div></div>
|
||
<span class="pct" id="fp-progress-pct">0%</span>
|
||
</div>
|
||
<div class="files-panel-footer">
|
||
<div class="files-panel-footer-left">
|
||
<span class="file-check files-panel-check" id="files-toggle-all" role="checkbox" aria-checked="false" aria-label="全选" title="全选" tabindex="0"></span>
|
||
<span class="files-panel-count" id="files-count">未选择文件</span>
|
||
</div>
|
||
<div class="files-panel-actions">
|
||
<button class="files-fab" id="files-bulk-download" title="批量下载" aria-label="批量下载" disabled>
|
||
<svg viewBox="0 0 24 24"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="7 10 12 15 17 10"></polyline><line x1="12" y1="15" x2="12" y2="3"></line></svg>
|
||
</button>
|
||
<button class="files-fab del" id="files-bulk-delete" title="批量删除" aria-label="批量删除" disabled>
|
||
<svg viewBox="0 0 24 24"><polyline points="3 6 5 6 21 6"></polyline><path d="M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6"></path><line x1="10" y1="11" x2="10" y2="17"></line><line x1="14" y1="11" x2="14" y2="17"></line></svg>
|
||
</button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- ================= 设置区(覆盖层;入口:侧边栏用户区) ================= -->
|
||
<section id="settings-page" class="hidden" aria-label="设置">
|
||
<!-- 垫底静态快照层:子页右滑返回时,父页快照垫在这里(仅动画背景,pointer-events:none;滑完重渲染真页) -->
|
||
<div id="set-under" aria-hidden="true"></div>
|
||
<!-- 当前页层:返回滑动只平移这一层,底下露出垫底的父页 -->
|
||
<div id="set-top">
|
||
<!-- 顶栏:左侧返回 + 中间标题 + 右侧操作按钮,风格与对话页 header 一致 -->
|
||
<header class="header">
|
||
<button class="icon-btn" id="set-back-btn" title="返回" aria-label="返回">
|
||
<svg class="ic" viewBox="0 0 24 24"><polyline points="15 18 9 12 15 6"></polyline></svg>
|
||
</button>
|
||
<div class="header-center"><div class="header-title" id="set-title">设置</div></div>
|
||
<div class="header-right" id="set-actions"><!-- JS 按页注入操作按钮 --></div>
|
||
</header>
|
||
<div id="set-body"><!-- JS 按页渲染 --></div>
|
||
</div>
|
||
</section>
|
||
|
||
<!-- 新建技能弹窗(搬自 index) -->
|
||
<div id="skill-create-modal" class="modal-overlay hidden" onclick="if(event.target===this)sUI.closeCreate()">
|
||
<div class="modal">
|
||
<button class="modal-close-btn" onclick="sUI.closeCreate()">
|
||
<svg viewBox="0 0 24 24"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>
|
||
</button>
|
||
<h3>新建技能</h3>
|
||
<input type="text" id="skill-new-name" placeholder="技能名(字母/数字/-/_)">
|
||
<input type="text" id="skill-new-desc" placeholder="一句话描述(何时使用该技能)">
|
||
<button class="primary-btn" onclick="sUI.createSkill()">创建</button>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- 平台编辑/新增弹窗(模型池共用:点卡片内任一模型=编辑整个平台;右上+模型=新增整个平台) -->
|
||
<div id="model-edit-modal" class="modal-overlay hidden" onclick="if(event.target===this)sUI.mClose()">
|
||
<div class="modal modal-wide">
|
||
<button class="modal-close-btn" onclick="sUI.mClose()">
|
||
<svg viewBox="0 0 24 24"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>
|
||
</button>
|
||
<h3 id="mpe-title">编辑平台</h3>
|
||
<input type="text" id="mpe-name" placeholder="平台名(留空取 url 主机名首段)">
|
||
<input type="text" id="mpe-url" placeholder="平台上游地址(OpenAI 兼容 /v1)">
|
||
<div class="mpe-sec">
|
||
<div class="mpe-sec-head"><span>Key列表</span><button class="ghost-btn sm" onclick="sUI.mAddKey()">添加Key</button></div>
|
||
<div id="mpe-keys"></div>
|
||
</div>
|
||
<div class="mpe-sec">
|
||
<div class="mpe-sec-head"><span>模型</span><button class="ghost-btn sm" onclick="sUI.mAddModel()">添加模型</button></div>
|
||
<div id="mpe-models"></div>
|
||
</div>
|
||
<div class="btn-row mpe-foot">
|
||
<button class="ghost-btn danger hidden" id="mpe-del-btn" onclick="sUI.mDelPlat()">删除平台</button>
|
||
<button class="primary-btn" onclick="sUI.mSave()">保存</button>
|
||
</div>
|
||
<div class="cfg-note">仅写入配置,点击「重启服务」后生效。</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- MCP 服务编辑/新增弹窗:配置 name / url / 多条 headers / 单次调用超时 / 启用开关;保存后写入 config.yml,重启生效 -->
|
||
<div id="mcp-edit-modal" class="modal-overlay hidden" onclick="if(event.target===this)mcpUI.close()">
|
||
<div class="modal modal-wide">
|
||
<button class="modal-close-btn" onclick="mcpUI.close()">
|
||
<svg viewBox="0 0 24 24"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>
|
||
</button>
|
||
<h3 id="mce-title">编辑 MCP 服务</h3>
|
||
<input type="text" id="mce-name" placeholder="服务名(留空取 url 主机名首段)">
|
||
<input type="text" id="mce-url" placeholder="MCP 服务 JSON-RPC 端点(完整 URL)">
|
||
<div class="mpe-sec">
|
||
<div class="mpe-sec-head"><span>请求头(headers)</span><button class="ghost-btn sm" onclick="mcpUI.addHeader()">添加 header</button></div>
|
||
<div id="mce-headers"></div>
|
||
</div>
|
||
<div class="mpe-cks" style="margin-top:14px">
|
||
<label class="mpe-num">单次调用超时<input type="number" id="mce-timeout" min="1000" max="600000" step="1000" placeholder="默认 60000">ms</label>
|
||
<label class="mpe-ck"><input type="checkbox" id="mce-enable" checked>启用</label>
|
||
</div>
|
||
<div class="btn-row mpe-foot">
|
||
<button class="ghost-btn danger hidden" id="mce-del-btn" onclick="mcpUI.del()">删除服务</button>
|
||
<button class="primary-btn" onclick="mcpUI.save()">保存</button>
|
||
</div>
|
||
<div class="cfg-note">仅写入配置,点击「重启服务」后生效。</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- 定时任务详情弹窗:频次(预设控件组合 cron,无法识别的既有表达式落入自定义)+ 提示词(可改),动作:更新/删除。
|
||
必须在 confirm-modal 之前:同为 z-index:100,DOM 靠后者叠在上,删除二次确认要盖住本窗 -->
|
||
<div id="schedule-modal" class="modal-overlay hidden" onclick="if(event.target===this)closeScheduleModal()">
|
||
<div class="modal">
|
||
<button class="modal-close-btn" onclick="closeScheduleModal()">
|
||
<svg viewBox="0 0 24 24"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>
|
||
</button>
|
||
<h3>定时任务</h3>
|
||
<div class="sched-row">
|
||
<select id="sched-freq" onchange="schedFreqUi()">
|
||
<option value="daily">每天</option>
|
||
<option value="weekly">每周</option>
|
||
<option value="everyN">每隔</option>
|
||
<option value="custom">自定义</option>
|
||
</select>
|
||
<select id="sched-dow" class="hidden">
|
||
<option value="1">周一</option><option value="2">周二</option><option value="3">周三</option><option value="4">周四</option><option value="5">周五</option><option value="6">周六</option><option value="0">周日</option>
|
||
</select>
|
||
<input id="sched-hh" class="sched-num hidden" type="number" min="0" max="23" placeholder="时">
|
||
<span id="sched-colon" class="hidden">:</span>
|
||
<input id="sched-mm" class="sched-num hidden" type="number" min="0" max="59" placeholder="分">
|
||
<input id="sched-nh" class="sched-num hidden" type="number" min="1" max="23">
|
||
<span id="sched-nh-unit" class="hidden">小时</span>
|
||
<input id="sched-cron" class="sched-grow hidden" type="text" placeholder="分 时 日 月 周(5 段 cron)">
|
||
</div>
|
||
<div class="sched-meta" id="sched-modal-meta"></div>
|
||
<textarea id="sched-modal-prompt" rows="6" placeholder="每次触发时投递给本会话的提示词"></textarea>
|
||
<div class="btn-row">
|
||
<button class="ghost-btn danger" onclick="deleteSchedule()">删除</button>
|
||
<button class="primary-btn" onclick="saveSchedule()">更新</button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- 全局确认弹窗(替代原生 confirm;搬自 index) -->
|
||
<div id="confirm-modal" class="modal-overlay hidden" onclick="if(event.target===this)confirmClose(false)">
|
||
<div class="modal">
|
||
<h3 id="confirm-title">请确认</h3>
|
||
<div class="modal-text" id="confirm-text"></div>
|
||
<label class="del-dir hidden" id="confirm-check-wrap"><input type="checkbox" id="confirm-check"> <span id="confirm-check-label"></span></label>
|
||
<div class="btn-row">
|
||
<button class="ghost-btn" onclick="confirmClose(false)">取消</button>
|
||
<button class="primary-btn" id="confirm-ok-btn" onclick="confirmClose(true)">确定</button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- 全局输入弹窗(替代原生 prompt;搬自 index) -->
|
||
<div id="prompt-modal" class="modal-overlay hidden" onclick="if(event.target===this)promptCancel()">
|
||
<div class="modal">
|
||
<button class="modal-close-btn" onclick="promptCancel()">
|
||
<svg viewBox="0 0 24 24"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>
|
||
</button>
|
||
<h3 id="prompt-title">请输入</h3>
|
||
<input type="text" id="prompt-input">
|
||
<div class="btn-row">
|
||
<button class="ghost-btn" onclick="promptCancel()">取消</button>
|
||
<button class="primary-btn" onclick="promptOk()">确定</button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- 已完成/已终止会话:选择模型继续(搬自 index;phase-bar「选择模型」入口) -->
|
||
<div id="bind-model-modal" class="modal-overlay hidden" onclick="if(event.target===this)closeModelSwitch()">
|
||
<div class="modal">
|
||
<div class="msw-header">
|
||
<div class="msw-titles">
|
||
<h3>切换模型</h3>
|
||
<p class="msw-sub">选择一个模型继续当前会话</p>
|
||
</div>
|
||
<button class="modal-close-btn" onclick="closeModelSwitch()">
|
||
<svg viewBox="0 0 24 24"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>
|
||
</button>
|
||
</div>
|
||
<div class="msw-list" id="bind-model-list"></div>
|
||
<div class="msw-footer" id="bind-model-footer"></div>
|
||
</div>
|
||
</div>
|
||
|
||
<div id="toast" class="hidden"></div>
|
||
</div>
|
||
|
||
<!-- 图片全屏查看器(点击消息/工具卡中图片打开;双指缩放、放大后可拖动) -->
|
||
<div id="img-viewer" class="hidden">
|
||
<button class="fs-close" onclick="closeImageViewer()">✕</button>
|
||
<img id="img-viewer-img" alt="">
|
||
</div>
|
||
|
||
<!-- 消息全屏查看器(双击气泡/工具卡打开;支持双指缩放) -->
|
||
<div id="fs-viewer" class="hidden" onclick="if(event.target===this)closeFullscreen()">
|
||
<button class="fs-close" onclick="closeFullscreen()">✕</button>
|
||
<!-- 源码切换钮:仅当当前内容有源文本时显隐(toggleFsSrc 在渲染视图/源码面板间互切) -->
|
||
<button class="fs-close fs-eye hidden" id="fs-src-btn" title="显示源码" aria-label="显示源码">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"></path><circle cx="12" cy="12" r="3"></circle></svg>
|
||
</button>
|
||
<div class="fs-panel" id="fs-body"></div>
|
||
<div class="fs-panel fs-src-panel hidden" id="fs-src-pane"><pre id="fs-src-code"></pre></div>
|
||
</div>
|
||
|
||
<script src="/js/core.js"></script>
|
||
<script src="/js/chat.js"></script>
|
||
<script src="/js/sessions.js"></script>
|
||
<script src="/js/stream.js"></script>
|
||
<script src="/js/files.js"></script>
|
||
<script src="/js/settings.js"></script>
|
||
</body>
|
||
</html>
|