protocol-proxy 2.5.1 → 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/config-store.js +83 -2
- package/package.json +1 -1
- package/public/app.js +436 -1
- package/public/index.html +60 -0
- package/public/style.css +483 -69
- package/server.js +245 -0
package/public/index.html
CHANGED
|
@@ -8,6 +8,10 @@
|
|
|
8
8
|
</head>
|
|
9
9
|
<body>
|
|
10
10
|
<div class="container">
|
|
11
|
+
<button class="theme-toggle" id="theme-toggle" onclick="toggleTheme()" title="切换主题">
|
|
12
|
+
<span id="theme-icon">☾</span>
|
|
13
|
+
<span id="theme-label" class="theme-label">深色</span>
|
|
14
|
+
</button>
|
|
11
15
|
<header>
|
|
12
16
|
<h1>Protocol Proxy</h1>
|
|
13
17
|
<p>OpenAI / Anthropic 协议转换透明代理</p>
|
|
@@ -79,9 +83,20 @@
|
|
|
79
83
|
<button class="btn" onclick="exportConfig()">导出配置</button>
|
|
80
84
|
<button class="btn" onclick="document.getElementById('import-file').click()">导入配置</button>
|
|
81
85
|
<input type="file" id="import-file" accept=".json" style="display:none" onchange="handleImportFile(event)">
|
|
86
|
+
<button class="btn" onclick="openHistoryViewer()">版本历史</button>
|
|
82
87
|
<button class="btn btn-primary" onclick="openModal()">+ 新建代理</button>
|
|
83
88
|
</div>
|
|
84
89
|
</div>
|
|
90
|
+
<div class="proxy-toolbar">
|
|
91
|
+
<div class="proxy-search">
|
|
92
|
+
<input type="text" id="proxy-search-input" placeholder="搜索代理名称、端口、供应商..." oninput="filterProxies()">
|
|
93
|
+
</div>
|
|
94
|
+
<div class="proxy-toolbar-actions">
|
|
95
|
+
<button class="btn btn-sm" onclick="startAllProxies()">全部启动</button>
|
|
96
|
+
<button class="btn btn-sm" onclick="stopAllProxies()">全部停止</button>
|
|
97
|
+
<button class="btn btn-sm" onclick="openLogViewer()">日志</button>
|
|
98
|
+
</div>
|
|
99
|
+
</div>
|
|
85
100
|
<div id="proxy-list" class="proxy-list">
|
|
86
101
|
<div class="empty">加载中...</div>
|
|
87
102
|
</div>
|
|
@@ -184,6 +199,7 @@
|
|
|
184
199
|
<div class="model-add-section" id="model-add-section">
|
|
185
200
|
<input type="text" class="model-add-input" id="model-add-input" placeholder="输入模型名称">
|
|
186
201
|
<button type="button" class="btn btn-primary btn-sm" id="model-add-btn">添加</button>
|
|
202
|
+
<button type="button" class="btn btn-sm" id="model-import-btn" onclick="importModels()">自动导入</button>
|
|
187
203
|
</div>
|
|
188
204
|
</div>
|
|
189
205
|
</div>
|
|
@@ -252,6 +268,7 @@
|
|
|
252
268
|
|
|
253
269
|
<div class="modal-footer">
|
|
254
270
|
<button type="button" class="btn" onclick="closeModal()">取消</button>
|
|
271
|
+
<button type="button" class="btn" id="test-connection-btn" onclick="testConnection()">测试连接</button>
|
|
255
272
|
<button type="submit" class="btn btn-primary">保存</button>
|
|
256
273
|
</div>
|
|
257
274
|
</form>
|
|
@@ -271,6 +288,49 @@
|
|
|
271
288
|
</div>
|
|
272
289
|
</div>
|
|
273
290
|
|
|
291
|
+
<!-- 测试结果弹窗 -->
|
|
292
|
+
<div class="modal confirm-modal" id="test-result-modal">
|
|
293
|
+
<div class="confirm-box test-result-box">
|
|
294
|
+
<div class="confirm-icon" id="test-result-icon">!</div>
|
|
295
|
+
<p class="confirm-text" id="test-result-summary"></p>
|
|
296
|
+
<div class="test-result-list" id="test-result-list"></div>
|
|
297
|
+
<div class="confirm-actions">
|
|
298
|
+
<button class="btn btn-primary" id="test-result-close">知道了</button>
|
|
299
|
+
</div>
|
|
300
|
+
</div>
|
|
301
|
+
</div>
|
|
302
|
+
|
|
303
|
+
<!-- 日志查看弹窗 -->
|
|
304
|
+
<div class="modal" id="log-modal">
|
|
305
|
+
<div class="modal-content" style="max-width:800px">
|
|
306
|
+
<div class="modal-header">
|
|
307
|
+
<h3>运行日志 <span id="log-total" style="color:#64748b;font-size:0.8rem;font-weight:400"></span></h3>
|
|
308
|
+
<button class="btn-close" onclick="closeLogViewer()">×</button>
|
|
309
|
+
</div>
|
|
310
|
+
<div class="log-toolbar">
|
|
311
|
+
<select id="log-lines-select" onchange="loadLogs()">
|
|
312
|
+
<option value="100">最近 100 行</option>
|
|
313
|
+
<option value="200" selected>最近 200 行</option>
|
|
314
|
+
<option value="500">最近 500 行</option>
|
|
315
|
+
<option value="1000">最近 1000 行</option>
|
|
316
|
+
</select>
|
|
317
|
+
<button class="btn btn-sm" onclick="loadLogs()">刷新</button>
|
|
318
|
+
</div>
|
|
319
|
+
<div class="log-content" id="log-content">加载中...</div>
|
|
320
|
+
</div>
|
|
321
|
+
</div>
|
|
322
|
+
|
|
323
|
+
<!-- 版本历史弹窗 -->
|
|
324
|
+
<div class="modal" id="history-modal">
|
|
325
|
+
<div class="modal-content" style="max-width:600px">
|
|
326
|
+
<div class="modal-header">
|
|
327
|
+
<h3>配置版本历史</h3>
|
|
328
|
+
<button class="btn-close" onclick="closeHistoryViewer()">×</button>
|
|
329
|
+
</div>
|
|
330
|
+
<div class="history-content" id="history-content">加载中...</div>
|
|
331
|
+
</div>
|
|
332
|
+
</div>
|
|
333
|
+
|
|
274
334
|
<!-- 导入预览弹窗 -->
|
|
275
335
|
<div class="modal" id="import-modal">
|
|
276
336
|
<div class="modal-content" style="max-width:500px">
|