index.html 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <!DOCTYPE HTML>
  2. <html lang="zh-CN">
  3. <head>
  4. <title>AI(智能助手)</title>
  5. <meta charset="UTF-8">
  6. <link rel="shortcut icon" href="../static/img/favicon.ico">
  7. <link rel="stylesheet" href="index.css"/>
  8. <script type="text/javascript" src="../static/vendor/evalCore.min.js"></script>
  9. <script type="text/javascript" src="../static/vendor/vue/vue.js"></script>
  10. </head>
  11. <body>
  12. <div class="wrapper" id="pageContainer">
  13. <div class="panel panel-default" style="margin-bottom: 0px;">
  14. <div class="panel-heading">
  15. <h3 class="panel-title">
  16. <a href="https://fehelper.com" target="_blank" class="x-a-high">
  17. <img src="../static/img/fe-16.png" alt="fehelper"/> FeHelper:</a>AI(智能助手)
  18. <a href="#" class="x-donate-link" @click="openDonateModal($event)"><i class="nav-icon">❤&nbsp;</i>打赏鼓励</a>
  19. <a class="x-other-tools" @click="openOptionsPage($event)"><i class="icon-plus-circle"></i> 探索更多实用工具 <span class="tool-market-badge">工具市场</span></a>
  20. <a href="#" class="x-history-link fh-nav-btn" @click="onHistoryClick($event)">
  21. <i class="icon-clock" style="margin-right:4px;font-size:18px;vertical-align:-2px;"></i>历史对话
  22. </a>
  23. <a href="#" class="x-newchat-link fh-nav-btn" @click="startNewChat($event)">
  24. <i class="icon-plus-circle" style="margin-right:4px;font-size:18px;vertical-align:-2px;"></i>开启新对话
  25. </a>
  26. </h3>
  27. </div>
  28. </div>
  29. <div v-if="showHistoryPanel" class="fh-history-sidebar">
  30. <div class="fh-history-header">
  31. <span>历史对话</span>
  32. <button class="fh-history-close" @click="showHistoryPanel = false">关闭</button>
  33. </div>
  34. <div class="fh-history-list">
  35. <template v-for="(day, date) in groupedHistory">
  36. <div class="fh-history-date">{{date}}</div>
  37. <ul>
  38. <li v-for="item in day" @click="loadHistory(item)">
  39. <span class="fh-history-theme">{{item.theme || item.message}}</span>
  40. </li>
  41. </ul>
  42. </template>
  43. </div>
  44. </div>
  45. <div :class="['panel-body', showHistoryPanel ? 'fh-main-shrink' : '']">
  46. <div class="row mod-inputs box-prompt">
  47. <form class="ui-mt-10" @submit.prevent="goChat">
  48. <textarea type="text" id="prompt" ref="prompt" v-model="prompt" class="form-control" placeholder="你有什么内容想要咨询AI的?(按Enter发送,Shift+Enter换行)"
  49. @keydown="onPromptKeydown"
  50. ></textarea>
  51. <input class="btn btn-sm btn-primary btn-chat" type="button" value="发送" @click="goChat">
  52. </form>
  53. </div>
  54. <div class="row mod-inputs box-result" ref="boxResult">
  55. <div class="row box-tips" v-if="!hideDemo">
  56. <div>你好,我是你的专属AI助理,不管你是要查BUG、写代码、还是要咨询什么技术问题,你都可以跟我说,我会竭尽全力帮你解决,比如你可以这样问我👇👇👇</div>
  57. <ul class="x-demos clearfix">
  58. <li v-for="demo in demos" @click="sendMessage(demo)">{{demo}}</li>
  59. </ul>
  60. </div>
  61. <div class="row box-message">
  62. <table>
  63. <template v-if="currentSession.length">
  64. <tr v-for="(msg, idx) in currentSession" :key="msg.id">
  65. <td class="td-icon x-me" v-if="msg.role==='user'"><img src="../static/img/me.png" alt="me"/></td>
  66. <td class="td-icon" v-if="msg.role==='assistant'"><img src="../static/img/fe-16.png" alt="fehelper"/></td>
  67. <td class="td-content">
  68. <b class="x-time">{{msg.time}}</b>
  69. <div class="x-xcontent x-user-content" v-if="msg.role==='user'">{{msg.content}}</div>
  70. <div class="x-xcontent" v-if="msg.role==='assistant'" v-html="msg.content"></div>
  71. </td>
  72. </tr>
  73. </template>
  74. <template v-else-if="respResult.id">
  75. <tr class="x-from-fh">
  76. <td class="td-icon x-me"><img src="../static/img/me.png" alt="me"/></td>
  77. <td class="td-content x-user-content"><b class="x-time">{{respResult.sendTime}} </b><div class="x-xcontent">{{respResult.message}}</div></td>
  78. </tr>
  79. <tr class="x-back-gpt">
  80. <td class="td-icon">
  81. <img src="../static/img/fe-16.png" alt="fehelper"/></td>
  82. <td class="td-content"><b class="x-time">{{respResult.respTime}}</b>
  83. <div :id="respResult.id" class="x-xcontent" v-html="respResult.respContent"></div>
  84. </td>
  85. </tr>
  86. </template>
  87. </table>
  88. </div>
  89. </div>
  90. </div>
  91. </div>
  92. </div>
  93. <script type="text/javascript" src="../static/vendor/highlight/highlight.js"></script>
  94. <script type="text/javascript" src="../html2markdown/libs/marked.js"></script>
  95. <script type="text/javascript" src="../html2markdown/libs/rawdeflate.js"></script>
  96. <script type="text/javascript" src="../html2markdown/libs/rawinflate.js"></script>
  97. <script type="text/javascript" src="../static/js/utils.js"></script>
  98. <script type="module" src="index.js"></script>
  99. </body>
  100. </html>