Files
ipass-plugin-cache/www/apix.html
T
ssw 43718bd0c4 iPass cache gateway 源码
容量管理: zones.rs 直读 nginx file_cache 共享内存记账(双轴: 磁盘 + keys_zone 索引内存), ?scan=1 扫盘上限 20 万文件; POST /api/admin/cache/purge 整区清理(只删文件不删目录, 根治 [crit] mkdir failed); POST /api/admin/cache/invalidate 按制品精准失效(预览->确认两步式, glob/子串, 删除上限 5000/扫描上限 20 万); GET /api/admin/cache 新增 capacity 块; 前端容量面板 + 按制品失效工具条; 测试 test-cache-capacity.sh 48/48(容量 27 + 精准失效 21, 含 EXPECT_MIN 护栏与前端静态契约); docs 容量管理章节
2026-09-21 09:25:11 +08:00

52 lines
2.2 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<base href="/admin/">
<title>API 代理 · 尚数网 山海关</title>
<link rel="stylesheet" href="assets/admin.css">
</head>
<body>
<div id="shell"></div>
<div class="wrap">
<div class="panel">
<div class="panel-head">
<div>
<h2>代理列表</h2>
<div class="desc">
把外部供应商的 API 挂到网关下:调用方用<b>同一把账号 API Key</b> 访问
<code>/apix/&lt;slug&gt;?参数=值</code>,网关换成<b>该代理自身登记的供应商 Key</b>后转发,并返回供应商原样结果。
每家供应商的基址与 Key 都在每一条代理里单独填写,互不影响。停用的代理对调用方表现为 404(共享内存已摘除,立即生效)。
<br><br>
<b>代理模式</b>:
<span class="badge" style="background:#eee;color:#666">vendor</span>
单一供应商收口 <code>POST /api/v1/ai/request</code>,网关按 <code>asset_id</code> 拼体(防止客户端挑最贵的资产刷);
<span class="badge" style="background:#eef6ee;color:#3a7">passthrough</span>
透传内部 REST 服务(OCR / 文生图 / TTS),访问 <code>/apixp/&lt;slug&gt;/&lt;路径尾部&gt;</code>,
方法/请求体/Content-Type 原样转发,上游路径 = base + 尾部。
<br><br>
<b>调用语法提示(<code>usage_hint</code>)</b>:
passthrough 推荐填写一段机器可读文本,由 <code>GET /api/v1/me</code> 下发给用户 AI,
让 AI <b>自己拼出</b>调用语法(路径尾部/Content-Type/字段名/Swagger),不用看文档。
</div>
</div>
<button class="btn-primary btn-sm" id="newApixBtn">+ 新建代理</button>
</div>
<table>
<thead><tr>
<th>slug</th><th>asset_id</th><th>调用地址</th><th>供应商</th><th>状态</th><th>创建时间</th><th>操作</th>
</tr></thead>
<tbody id="apixBody"></tbody>
</table>
</div>
</div>
<div id="toast"></div>
<script src="assets/core.js"></script>
<script src="assets/apix.js"></script>
</body>
</html>