-
Notifications
You must be signed in to change notification settings - Fork 21
/
side_panel.html
274 lines (268 loc) · 19.9 KB
/
side_panel.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<title>FisherAI</title>
<link rel="stylesheet" type="text/css" href="/css/styles.css">
<script type="text/javascript" src="/scripts/third/marked.min.js"></script>
<script type="text/javascript" src="/scripts/third/html2canvas.min.js"></script>
<script type="text/javascript" src="/scripts/third/html2canvas.min.js"></script>
<script type="text/javascript" src="/scripts/third/pdf.worker.min.js"></script>
<script type="text/javascript" src="/scripts/third/pdf.min.js"></script>
<script type="text/javascript" src="/scripts/third/aws-sdk-2.1618.0.min.js"></script>
<script type="text/javascript" src="/scripts/constants.js"></script>
<script type="text/javascript" src="/scripts/third/youtube-transcript.js"></script>
<script type="text/javascript" src="/scripts/utils.js"></script>
<script type="text/javascript" src="/scripts/llm.js"></script>
<script type="text/javascript" src="/scripts/side_panel.js"></script>
</head>
<body>
<div id="resultpage" class="my-extension-resultPage">
<div class="my-extension-header">
<span class="my-extension-settings-btn">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-settings"><circle cx="12" cy="12" r="3"></circle><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"></path></svg>
</span>
<span class="my-extension-share-btn">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-share"><path d="M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"></path><polyline points="16 6 12 2 8 6"></polyline><line x1="12" y1="2" x2="12" y2="15"></line></svg>
</span>
</div>
<div class="my-extension-content">
<div class="my-extension-slogan">
<b>FisherAI</b> - Your Best Summary Copilot
</div>
<div class="feature-container">
<div class="feature-title">功能推荐:</div>
<div class="feature-item">
<a id="my-extension-summary-btn">
<img src="/images/summary.webp" alt="Web Summary" class="feature-icon">
<div class="feature-text">
<div class="feature-name">智能摘要</div>
<div class="feature-desc">支持多种格式,包括网页、PDF 文件、Bilibili 和 YouTube 视频。</div>
</div>
</a>
</div>
<div class="feature-item">
<a id="my-extension-translate-btn">
<img src="/images/trans.webp" alt="Web Translation" class="feature-icon">
<div class="feature-text">
<div class="feature-name">网页翻译</div>
<div class="feature-desc">支持多种格式,包括网页、PDF 文件,保持原有布局和格式。</div>
</div>
</a>
</div>
<div class="feature-item">
<a id="my-extension-videotrans-btn">
<img src="/images/videotrans.png" alt="video Translation" class="feature-icon">
<div class="feature-text">
<div class="feature-name">视频翻译</div>
<div class="feature-desc">支持 Bilibili 和 YouTube 视频。</div>
</div>
</a>
</div>
</div>
<div class="chat-content">
<!-- 摘要的内容将在这里显示 -->
</div>
<!-- 预定义的SVG复制按钮模板 -->
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon-copy" style="display: none;">
<rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>
<path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v1"></path>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24" class="icon-right" style="display: none;">
<path fill="currentColor" fill-rule="evenodd" d="M18.063 5.674a1 1 0 0 1 .263 1.39l-7.5 11a1 1 0 0 1-1.533.143l-4.5-4.5a1 1 0 1 1 1.414-1.414l3.647 3.647 6.82-10.003a1 1 0 0 1 1.39-.263" clip-rule="evenodd"></path>
</svg>
</div>
<div class="my-extension-loading">
</div>
<svg id="delete-icon-template" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="display: none;">
<line x1="18" y1="6" x2="6" y2="18"></line>
<line x1="6" y1="6" x2="18" y2="18"></line>
</svg>
<div class="image-preview-area">
<!-- 图片预览将在这里显示 -->
</div>
<div class="navigation-bar">
<div id="model-selection-div">
<select id="model-selection">
<option value="gpt-3.5-turbo">gpt-3.5-turbo</option>
<option value="gpt-4-turbo">gpt-4-turbo</option>
<option value="gpt-4o">gpt-4o</option>
<option value="gpt-4o-mini">gpt-4o-mini</option>
<option value="chatgpt-4o-latest">chatgpt-4o-latest</option>
<option value="azure-gpt-35-turbo">azure-gpt-35-turbo</option>
<option value="azure-gpt-4-turbo">azure-gpt-4-turbo</option>
<option value="azure-gpt-4o">azure-gpt-4o</option>
<option value="gemini-1.5-pro-latest">gemini-1.5-pro-latest</option>
<option value="gemini-1.5-flash-latest">gemini-1.5-flash-latest</option>
<option value="llama3-70b-8192-groq">llama3-70b-groq</option>
<option value="llama3-8b-8192-groq">llama3-8b-groq</option>
<option value="glm-4">glm-4</option>
<option value="glm-4v">glm-4v</option>
<option value="glm-3-turbo">glm-3-turbo</option>
<option value="moonshot-v1-128k">moonshot-v1-128k</option>
<option value="moonshot-v1-8k">moonshot-v1-32k</option>
<option value="moonshot-v1-8k">moonshot-v1-8k</option>
<option value="deepseek-chat">deepseek-chat-32k</option>
<option value="deepseek-coder">deepseek-coder-16k</option>
<option value="yi-large">yi-large</option>
<option value="yi-large-turbo">yi-large-turbo</option>
<option value="yi-medium">yi-medium</option>
<option value="yi-medium-200k">yi-medium-200k</option>
<option value="yi-spark">yi-spark</option>
<option value="open-mixtral-8x22b">mixtral-8x22b</option>
<option value="open-mixtral-8x7b">mixtral-8x7b</option>
<option value="mixtral-8x7b-32768-groq">mixtral-8x7b-groq</option>
<option value="gemma-7b-it-groq">gemma-7b-groq</option>
</select>
</div>
<div id="params-div">
<label id="params-label">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<title>模型参数</title>
<rect width="24" height="24"/>
<circle cx="7" cy="7" r="2.5" stroke="black" stroke-width="2" fill="none"/>
<rect x="12" y="6" width="6" height="2" fill="black"/>
<circle cx="17" cy="17" r="2.5" stroke="black" stroke-width="2" fill="none"/>
<rect x="6" y="16" width="6" height="2" fill="black"/>
</svg>
</label>
</div>
<div id="tools-div">
<label id="tools-label">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 24 24" class="icon-md">
<title>工具</title>
<path fill="currentColor" fill-rule="evenodd" d="M6.75 4.5a2.25 2.25 0 1 0 0 4.5 2.25 2.25 0 0 0 0-4.5M2.5 6.75a4.25 4.25 0 1 1 8.5 0 4.25 4.25 0 0 1-8.5 0M17.25 4.5a2.25 2.25 0 1 0 0 4.5 2.25 2.25 0 0 0 0-4.5M13 6.75a4.25 4.25 0 1 1 8.5 0 4.25 4.25 0 0 1-8.5 0M6.75 15a2.25 2.25 0 1 0 0 4.5 2.25 2.25 0 0 0 0-4.5M2.5 17.25a4.25 4.25 0 1 1 8.5 0 4.25 4.25 0 0 1-8.5 0M17.25 15a2.25 2.25 0 1 0 0 4.5 2.25 2.25 0 0 0 0-4.5M13 17.25a4.25 4.25 0 1 1 8.5 0 4.25 4.25 0 0 1-8.5 0" clip-rule="evenodd"></path>
</svg>
</label>
</div>
<div id="image-upload-div">
<input type="file" id="image-upload" style="display:none" accept="image/*" multiple>
<label for="image-upload" id="image-upload-label">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 24 24">
<title>上传文件</title>
<path fill="currentColor" fill-rule="evenodd" d="M9 7a5 5 0 0 1 10 0v8a7 7 0 1 1-14 0V9a1 1 0 0 1 2 0v6a5 5 0 0 0 10 0V7a3 3 0 1 0-6 0v8a1 1 0 1 0 2 0V9a1 1 0 1 1 2 0v6a3 3 0 1 1-6 0z" clip-rule="evenodd"></path>
</svg>
</label>
</div>
<div id="newChat-div">
<label id="newchat-label">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24">
<title>新聊天</title>
<g transform="translate(-528 -216)">
<path fill="none" d="M0,0H24V24H0Z" transform="translate(528 216)"></path>
<path fill="#000000" d="M19.2.914v4.9a1.5,1.5,0,0,1-1.5,1.5H12.8a.914.914,0,1,1,0-1.829h3.392a7.768,7.768,0,1,0,.752,6.664.914.914,0,0,1,1.727.6,9.607,9.607,0,1,1-1.3-8.78V.914a.914.914,0,1,1,1.829,0Z" transform="translate(530.4 218.4)"></path>
</g>
</svg>
</label>
</div>
</div>
<div class="my-extension-dialogue">
<textarea type="text" id="my-extension-user-input" placeholder="Ask anything..."></textarea>
<button id="my-extension-submit-btn" class="my-extension-dialogue-submit">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24" class="icon-md text-white dark:text-black">
<path fill="currentColor" fill-rule="evenodd" d="M12 3a1 1 0 0 1 .707.293l7 7a1 1 0 0 1-1.414 1.414L13 6.414V20a1 1 0 1 1-2 0V6.414l-5.293 5.293a1 1 0 0 1-1.414-1.414l7-7A1 1 0 0 1 12 3" clip-rule="evenodd"></path>
</svg>
</button>
<button id="my-extension-generate-btn" class="my-extension-dialogue-generate">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24" class="h-2 w-2 text-token-text-primary">
<path fill="currentColor" d="M8.759 3h6.482c.805 0 1.47 0 2.01.044.563.046 1.08.145 1.565.392a4 4 0 0 1 1.748 1.748c.247.485.346 1.002.392 1.564C21 7.29 21 7.954 21 8.758v6.483c0 .805 0 1.47-.044 2.01-.046.563-.145 1.08-.392 1.565a4 4 0 0 1-1.748 1.748c-.485.247-1.002.346-1.564.392-.541.044-1.206.044-2.01.044H8.758c-.805 0-1.47 0-2.01-.044-.563-.046-1.08-.145-1.565-.392a4 4 0 0 1-1.748-1.748c-.247-.485-.346-1.002-.392-1.564C3 16.71 3 16.046 3 15.242V8.758c0-.805 0-1.47.044-2.01.046-.563.145-1.08.392-1.565a4 4 0 0 1 1.748-1.748c.485-.247 1.002-.346 1.564-.392C7.29 3 7.954 3 8.758 3"></path>
</svg>
</button>
</div>
</div>
<div id="shortcut-menu" class="shortcut-menu">
<div data-command="摘要:">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24" class="icon-md" style="color: rgb(237, 98, 98);">
<path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M4 4h16v16H4z"></path>
<path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M8 8h8M8 12h8M8 16h4"></path>
</svg>
<span class="shortcut-text-span">摘要</span>
</div>
<div data-command="查词:">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24" class="icon-md" style="color: rgb(237, 98, 98);">
<circle cx="10" cy="10" r="6" stroke="currentColor" stroke-width="2" fill="none"/>
<line x1="14.5" y1="14.5" x2="20" y2="20" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
<span class="shortcut-text-span">查词</span>
</div>
<div data-command="翻译:">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24" class="icon-md" style="color: rgb(237, 98, 98);">
<path d="M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2z" stroke="currentColor" stroke-width="2" fill="none"/>
<path d="M15 10h5v5" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M9 14H4V9" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M12 15l-3 3-3-3M12 9l3-3 3 3" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
<span class="shortcut-text-span">翻译</span>
</div>
<div data-command="润色:">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24" class="icon-md" style="color: rgb(237, 98, 98);"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M3 6h7M3 10h4"></path><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13.428 17.572 20.5 10.5a2.828 2.828 0 1 0-4-4l-7.072 7.072a2 2 0 0 0-.547 1.022L8 19l4.406-.881a2 2 0 0 0 1.022-.547"></path></svg>
<span class="shortcut-text-span">润色</span>
</div>
<div data-command="代码解释:">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24" class="icon-md" style="color: rgb(237, 98, 98);"><path fill="currentColor" fill-rule="evenodd" d="M3 6a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v12a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3zm3-1a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1zm1.293 4.293a1 1 0 0 1 1.414 0l2 2a1 1 0 0 1 0 1.414l-2 2a1 1 0 0 1-1.414-1.414L8.586 12l-1.293-1.293a1 1 0 0 1 0-1.414M12 14a1 1 0 0 1 1-1h3a1 1 0 1 1 0 2h-3a1 1 0 0 1-1-1" clip-rule="evenodd"></path></svg>
<span class="shortcut-text-span">代码解释</span>
</div>
<div data-command="图像转文本:">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24" class="icon-md" style="color: rgb(237, 98, 98);">
<rect x="3" y="3" width="18" height="14" rx="2" ry="2" stroke="currentColor" stroke-width="2" fill="none"/>
<circle cx="8.5" cy="8.5" r="1.5" fill="currentColor"/>
<path d="M21 15l-5-5-4 4-3-3-6 6" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
<span class="shortcut-text-span"> 图像转文本</span>
</div>
</div>
<div id="model-params" class="model-params">
<h2>模型参数</h2>
<div class="params-item">
<label for="temperature">温度</label>
<div class="param-control">
<input type="number" id="temperature" placeholder="0.7" min="0" max="2">
</div>
</div>
<div class="params-item">
<label for="top_p">Top P</label>
<input type="number" id="top_p" placeholder="0.7" min="0" max="1">
</div>
<div class="params-item">
<label for="frequency_penalty">频率惩罚</label>
<input type="number" id="frequency_penalty" placeholder="0" min="0" max="1">
</div>
<div class="params-item">
<label for="presence_penalty">存在惩罚</label>
<input type="number" id="presence_penalty" placeholder="0" min="0" max="1">
</div>
<div class="params-item">
<label for="max-tokens">最大 tokens</label>
<input type="number" id="max_tokens" placeholder="1024" min="1">
</div>
</div>
<div id="tool-store" class="tool-store" style="display: none;">
<h2>工具</h2>
<div class="tool-item">
<div>
<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" width="24" height="24" viewBox="0 0 48 48">
<path fill="#FFC107" d="M43.611,20.083H42V20H24v8h11.303c-1.649,4.657-6.08,8-11.303,8c-6.627,0-12-5.373-12-12c0-6.627,5.373-12,12-12c3.059,0,5.842,1.154,7.961,3.039l5.657-5.657C34.046,6.053,29.268,4,24,4C12.955,4,4,12.955,4,24c0,11.045,8.955,20,20,20c11.045,0,20-8.955,20-20C44,22.659,43.862,21.35,43.611,20.083z"></path><path fill="#FF3D00" d="M6.306,14.691l6.571,4.819C14.655,15.108,18.961,12,24,12c3.059,0,5.842,1.154,7.961,3.039l5.657-5.657C34.046,6.053,29.268,4,24,4C16.318,4,9.656,8.337,6.306,14.691z"></path><path fill="#4CAF50" d="M24,44c5.166,0,9.86-1.977,13.409-5.192l-6.19-5.238C29.211,35.091,26.715,36,24,36c-5.202,0-9.619-3.317-11.283-7.946l-6.522,5.025C9.505,39.556,16.227,44,24,44z"></path><path fill="#1976D2" d="M43.611,20.083H42V20H24v8h11.303c-0.792,2.237-2.231,4.166-4.087,5.571c0.001-0.001,0.002-0.001,0.003-0.002l6.19,5.238C36.971,39.205,44,34,44,24C44,22.659,43.862,21.35,43.611,20.083z"></path>
</svg>
<span>SerpApi</span>
<input type="checkbox" id="serpapi">
</div>
</div>
<div class="tool-item">
<div>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="24" height="24">
<g fill="none">
<path fill="#FBC02D" d="M32 2C48.57 2 62 15.43 62 32s-13.43 30-30 30S2 48.57 2 32 15.43 2 32 2z"/>
<circle cx="24" cy="20" r="6" fill="#43A047"/>
<circle cx="40" cy="18" r="6" fill="#1E88E5"/>
<circle cx="46" cy="30" r="6" fill="#8E24AA"/>
<circle cx="36" cy="42" r="6" fill="#E53935"/>
<circle cx="22" cy="38" r="8" fill="white"/>
</g>
</svg>
<span>DALL·E 3</span>
<input type="checkbox" id="dalle">
</div>
</div>
</div>
</body>
</html>