sidebar.html 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8" />
  5. <title>派维斯智能体助手</title>
  6. <link rel="stylesheet" href="css/sidebar.css" />
  7. <link rel="stylesheet" href="css/chat.css" />
  8. </head>
  9. <body>
  10. <div class="sidebar-header">
  11. <h1>派维斯智能体助手</h1>
  12. <button id="close-sidebar" class="close-btn">×</button>
  13. </div>
  14. <div class="chat-container">
  15. <!-- 聊天消息区域 -->
  16. <div class="chat-messages" id="chat-messages">
  17. <!-- 欢迎消息 -->
  18. <div class="message assistant">
  19. <div class="message-content">
  20. <p>你好!我是派维斯智能助手。</p>
  21. <p>使用说明:</p>
  22. <ul>
  23. <li>直接发送消息开始对话</li>
  24. <li>使用快捷指令快速操作</li>
  25. <li>可选:输入 /setapi YOUR_API_KEY 设置自定义API密钥</li>
  26. </ul>
  27. </div>
  28. </div>
  29. </div>
  30. <!-- 输入区域 -->
  31. <div class="page-info-card">
  32. <img class="page-favicon" src="" alt="网站图标" />
  33. <div class="page-title-container">
  34. <p class="page-title"></p>
  35. </div>
  36. <button class="summarize-button">总结</button>
  37. </div>
  38. <div class="chat-input-container">
  39. <!-- 工具栏 -->
  40. <div class="toolbar">
  41. <div class="toolbar-left">
  42. <button class="toolbar-button" id="prompt-button">
  43. <svg viewBox="0 0 24 24" fill="currentColor">
  44. <path
  45. 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"
  46. />
  47. <path d="M7 12h2v5H7zm4-3h2v8h-2zm4-3h2v11h-2z" />
  48. </svg>
  49. 快捷指令
  50. </button>
  51. <button class="toolbar-button" id="tools-button">
  52. <svg viewBox="0 0 24 24" fill="currentColor">
  53. <path
  54. 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"
  55. />
  56. </svg>
  57. 常用工具
  58. </button>
  59. </div>
  60. <div class="toolbar-right">
  61. <!-- 这里可以添加右侧工具按钮 -->
  62. </div>
  63. </div>
  64. <!-- 快捷指令面板 -->
  65. <div class="prompt-panel" id="prompt-panel">
  66. <div class="prompt-header">
  67. <h3>快捷指令</h3>
  68. <button class="close-prompt">
  69. <svg viewBox="0 0 24 24" fill="currentColor">
  70. <path
  71. 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"
  72. />
  73. </svg>
  74. </button>
  75. </div>
  76. <div class="prompt-list">
  77. <button class="prompt-item">
  78. <svg viewBox="0 0 24 24" fill="currentColor">
  79. <path
  80. d="M3 17v2h6v-2H3zM3 5v2h10V5H3zm10 16v-2h8v-2h-8v-2h-2v6h2zM7 9v2H3v2h4v2h2V9H7zm14 4v-2H11v2h10zm-6-4h2V7h4V5h-4V3h-2v6z"
  81. />
  82. </svg>
  83. 分析当前页面的主要观点和论据
  84. </button>
  85. <!-- 添加更多快捷指令 -->
  86. </div>
  87. </div>
  88. <!-- 工具箱面板 -->
  89. <div class="tools-panel" id="tools-panel">
  90. <div class="tools-header">
  91. <h3>工具箱</h3>
  92. <button class="close-tools">
  93. <svg viewBox="0 0 24 24" fill="currentColor">
  94. <path
  95. 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"
  96. />
  97. </svg>
  98. </button>
  99. </div>
  100. <div class="tools-content">
  101. <!-- 文本处理工具 -->
  102. <div class="tools-section">
  103. <h4>文本处理</h4>
  104. <div class="tools-grid">
  105. <button class="tool-item">
  106. <svg viewBox="0 0 24 24" fill="currentColor">
  107. <path
  108. d="M14 17H4v2h10v-2zm6-8H4v2h16V9zM4 15h16v-2H4v2zM4 5v2h16V5H4z"
  109. />
  110. </svg>
  111. <span>文本格式化</span>
  112. </button>
  113. <button class="tool-item">
  114. <svg viewBox="0 0 24 24" fill="currentColor">
  115. <path
  116. 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"
  117. />
  118. </svg>
  119. <span>摘要生成</span>
  120. </button>
  121. </div>
  122. </div>
  123. <!-- 代码工具 -->
  124. <div class="tools-section">
  125. <h4>代码工具</h4>
  126. <div class="tools-grid">
  127. <button class="tool-item">
  128. <svg viewBox="0 0 24 24" fill="currentColor">
  129. <path
  130. 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"
  131. />
  132. </svg>
  133. <span>代码格式化</span>
  134. </button>
  135. <button class="tool-item">
  136. <svg viewBox="0 0 24 24" fill="currentColor">
  137. <path
  138. 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"
  139. />
  140. </svg>
  141. <span>代码注释</span>
  142. </button>
  143. </div>
  144. </div>
  145. <!-- 翻译工具 -->
  146. <div class="tools-section">
  147. <h4>翻译工具</h4>
  148. <div class="tools-grid">
  149. <button class="tool-item">
  150. <svg viewBox="0 0 24 24" fill="currentColor">
  151. <path
  152. 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"
  153. />
  154. </svg>
  155. <span>中英互译</span>
  156. </button>
  157. </div>
  158. </div>
  159. </div>
  160. </div>
  161. <div class="input-wrapper">
  162. <textarea
  163. id="chat-input"
  164. placeholder="输入消息..."
  165. rows="1"
  166. autofocus
  167. ></textarea>
  168. <div class="input-buttons">
  169. <button id="upload-button" class="icon-button" title="上传文件">
  170. <svg viewBox="0 0 24 24" fill="currentColor">
  171. <path
  172. 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"
  173. />
  174. </svg>
  175. </button>
  176. <!-- 隐藏的文件输入框 -->
  177. <input type="file" id="file-input" style="display: none" multiple />
  178. <button id="send-button" class="icon-button" title="发送">
  179. <svg viewBox="0 0 24 24" width="20" height="20">
  180. <path
  181. fill="currentColor"
  182. d="M2.01 21L23 12 2.01 3 2 10l15 2-15 2z"
  183. />
  184. </svg>
  185. </button>
  186. </div>
  187. </div>
  188. </div>
  189. </div>
  190. <script src="js/config.js"></script>
  191. <script src="js/utils.js"></script>
  192. <script src="js/ai-service.js"></script>
  193. <script src="js/chat-ui.js"></script>
  194. <script src="js/sidebar.js"></script>
  195. </body>
  196. </html>