123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8" />
- <title>派维斯智能体助手</title>
- <link rel="stylesheet" href="css/sidebar.css" />
- <link rel="stylesheet" href="css/chat.css" />
- <script src="./openis.js" type="module"></script>
- </head>
- <body>
- <div class="sidebar-header">
- <h1>派维斯智能体助手</h1>
- <button id="close-sidebar" class="close-btn">×</button>
- </div>
- <div class="chat-container">
- <!-- 聊天消息区域 -->
- <div class="chat-messages" id="chat-messages">
- <!-- 欢迎消息 -->
- <div class="message assistant">
- <div class="message-content">
- <p>你好!我是派维斯智能助手。</p>
- <p>使用说明:</p>
- <ul>
- <li>直接发送消息开始对话</li>
- <li>使用快捷指令快速操作</li>
- <li>可选:输入 /setapi YOUR_API_KEY 设置自定义API密钥</li>
- </ul>
- </div>
- </div>
- </div>
- <!-- 输入区域 -->
- <div class="page-info-card">
- <img class="page-favicon" src="" alt="网站图标" />
- <div class="page-title-container">
- <p class="page-title"></p>
- </div>
- <!-- <button class="summarize-button">总结</button> -->
- </div>
- <div class="chat-input-container">
- <!-- 工具栏 -->
- <div class="toolbar">
- <div class="toolbar-left">
- <button class="toolbar-button" id="prompt-button">
- <svg viewBox="0 0 24 24" fill="currentColor">
- <path
- d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14z"
- />
- <path d="M7 12h2v5H7zm4-3h2v8h-2zm4-3h2v11h-2z" />
- </svg>
- 快捷指令
- </button>
- <button class="toolbar-button" id="tools-button">
- <svg viewBox="0 0 24 24" fill="currentColor">
- <path
- d="M22.7 19l-9.1-9.1c.9-2.3.4-5-1.5-6.9-2-2-5-2.4-7.4-1.3L9 6 6 9 1.6 4.7C.4 7.1.9 10.1 2.9 12.1c1.9 1.9 4.6 2.4 6.9 1.5l9.1 9.1c.4.4 1 .4 1.4 0l2.3-2.3c.5-.4.5-1.1.1-1.4z"
- />
- </svg>
- 常用工具
- </button>
- </div>
- <div class="toolbar-right">
- <!-- 这里可以添加右侧工具按钮 -->
- </div>
- </div>
- <!-- 快捷指令面板 -->
- <div class="prompt-panel" id="prompt-panel">
- <div class="prompt-header">
- <h3>快捷指令</h3>
- <button class="close-prompt">
- <svg viewBox="0 0 24 24" fill="currentColor">
- <path
- d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
- />
- </svg>
- </button>
- </div>
- <div class="prompt-list">
- <button class="prompt-item">
- <svg viewBox="0 0 24 24" fill="currentColor">
- <path
- d="M3 17v2h6v-2H3zM3 5v2h10V5H3zm10 16v-2h8v-2h-8v-2h-2v6h2zM7 9v2H3v2h4v2h2V9H7zm14 4v-2H11v2h10zm-6-4h2V7h4V5h-4V3h-2v6z"
- />
- </svg>
- 分析当前页面的主要观点和论据
- </button>
- <!-- 添加更多快捷指令 -->
- </div>
- </div>
- <!-- 工具箱面板 -->
- <div class="tools-panel" id="tools-panel">
- <div class="tools-header">
- <h3>工具箱</h3>
- <button class="close-tools">
- <svg viewBox="0 0 24 24" fill="currentColor">
- <path
- d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
- />
- </svg>
- </button>
- </div>
- <div class="tools-content">
- <!-- 文本处理工具 -->
- <div class="tools-section">
- <h4>文本处理</h4>
- <div class="tools-grid">
- <button class="tool-item">
- <svg viewBox="0 0 24 24" fill="currentColor">
- <path
- d="M14 17H4v2h10v-2zm6-8H4v2h16V9zM4 15h16v-2H4v2zM4 5v2h16V5H4z"
- />
- </svg>
- <span>文本格式化</span>
- </button>
- <button class="tool-item">
- <svg viewBox="0 0 24 24" fill="currentColor">
- <path
- d="M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H5.17L4 17.17V4h16v12z"
- />
- </svg>
- <span>摘要生成</span>
- </button>
- </div>
- </div>
- <!-- 代码工具 -->
- <div class="tools-section">
- <h4>代码工具</h4>
- <div class="tools-grid">
- <button class="tool-item">
- <svg viewBox="0 0 24 24" fill="currentColor">
- <path
- d="M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z"
- />
- </svg>
- <span>代码格式化</span>
- </button>
- <button class="tool-item">
- <svg viewBox="0 0 24 24" fill="currentColor">
- <path
- d="M20 2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h14l4 4V4c0-1.1-.9-2-2-2zm-2 12H6v-2h12v2zm0-3H6V9h12v2zm0-3H6V6h12v2z"
- />
- </svg>
- <span>代码注释</span>
- </button>
- </div>
- </div>
- <!-- 翻译工具 -->
- <div class="tools-section">
- <h4>翻译工具</h4>
- <div class="tools-grid">
- <button class="tool-item">
- <svg viewBox="0 0 24 24" fill="currentColor">
- <path
- d="M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"
- />
- </svg>
- <span>中英互译</span>
- </button>
- </div>
- </div>
- </div>
- </div>
- <div class="input-wrapper">
- <textarea
- id="chat-input"
- placeholder="输入消息..."
- rows="1"
- autofocus
- ></textarea>
- <div class="input-buttons">
- <button id="upload-button" class="icon-button" title="上传文件">
- <svg viewBox="0 0 24 24" fill="currentColor">
- <path
- d="M18 15v3H6v-3H4v3c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-3h-2zM7 9l1.41 1.41L11 7.83V16h2V7.83l2.59 2.58L17 9l-5-5-5 5z"
- />
- </svg>
- </button>
- <!-- 隐藏的文件输入框 -->
- <input type="file" id="file-input" style="display: none" multiple />
- <button id="send-button" class="icon-button" title="发送">
- <svg viewBox="0 0 24 24" width="20" height="20">
- <path
- fill="currentColor"
- d="M2.01 21L23 12 2.01 3 2 10l15 2-15 2z"
- />
- </svg>
- </button>
- <!-- 停止生成按钮 -->
- <button
- id="stop-button"
- class="icon-button stop-button"
- title="停止生成"
- style="display: none;"
- >
- <svg
- viewBox="0 0 24 24"
- fill="currentColor"
- width="20"
- height="20"
- >
- <path d="M6 6h12v12H6z" />
- </svg>
- </button>
- </div>
- </div>
- </div>
- </div>
- <!-- 第三方库 -->
- <script src="js/libs/xlsx.full.min.js"></script>
- <!-- 应用脚本 -->
- <script src="js/config.js"></script>
- <script src="js/utils.js"></script>
- <script src="js/ai-service.js"></script>
- <script src="js/chat-ui.js"></script>
- <script src="js/sidebar.js"></script>
- </body>
- </html>
|