Skip to content

Commit 50ab5cb

Browse files
committed
chore: sync upstream v1.17.8
2 parents 44f3919 + e9817a8 commit 50ab5cb

246 files changed

Lines changed: 25173 additions & 18993 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/release.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ jobs:
2222
- name: Setup Node.js
2323
uses: actions/setup-node@v4
2424
with:
25-
node-version: '20'
26-
cache: 'npm'
25+
node-version: '24'
2726

2827
- name: Install dependencies
2928
run: npm ci

README.md

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
# CLI Proxy API Management Center
22

3-
A single-file Web UI (React + TypeScript) for operating and troubleshooting the **CLI Proxy API** via its **Management API** (config, credentials, logs, and usage).
3+
A single-file Web UI (React + TypeScript) for operating and troubleshooting the **CLI Proxy API** via its **Management API** (config, credentials, and logs).
44

55
[中文文档](README_CN.md)
66

77
**Main Project**: https://github.com/NGLSL/CLIProxyAPI
88
**Example URL**: https://remote.router-for.me/
9-
**Minimum Required Version**: ≥ 6.8.0 (recommended ≥ 6.8.15)
9+
**Minimum Required Version**: ≥ 7.1.0 (recommended latest)
1010

1111
Since version 6.0.19, the Web UI ships with the main program; access it via `/management.html` on the API port once the service is running.
1212

1313
## What this is (and isn’t)
1414

15-
- This repository is the Web UI only. It talks to the CLI Proxy API **Management API** (`/v0/management`) to read/update config, upload credentials, view logs, and inspect usage.
15+
- This repository is the Web UI only. It talks to the CLI Proxy API **Management API** (`/v0/management`) to read/update config, upload credentials, and view logs.
1616
- It is **not** a proxy and does not forward traffic.
1717

1818
## Quick start
@@ -28,22 +28,22 @@ The address is auto-detected from the current page URL; manual override is suppo
2828
### Option B: Run the dev server
2929

3030
```bash
31-
npm install
32-
npm run dev
31+
bun install --frozen-lockfile
32+
bun run dev
3333
```
3434

3535
Open `http://localhost:5173`, then connect to your CLI Proxy API backend instance.
3636

3737
### Option C: Build a single HTML file
3838

3939
```bash
40-
npm install
41-
npm run build
40+
bun install --frozen-lockfile
41+
bun run build
4242
```
4343

4444
- Output: `dist/index.html` (all assets are inlined).
4545
- For CLI Proxy API bundling, the release workflow renames it to `management.html`.
46-
- To preview locally: `npm run preview`
46+
- To preview locally: `bun run preview`
4747

4848
Tip: opening `dist/index.html` via `file://` may be blocked by browser CORS; serving it (preview/static server) is more reliable.
4949

@@ -69,46 +69,45 @@ This is different from the proxy `api-keys` you manage inside the UI (those are
6969
### Remote management
7070

7171
If you connect from a non-localhost browser, the server must allow remote management (e.g. `allow-remote-management: true`).
72-
See `api.md` for the full authentication rules, server-side limits, and edge cases.
72+
Check the CLI Proxy API server documentation/config comments for the full authentication rules, server-side limits, and edge cases.
7373

7474
## What you can manage (mapped to the UI pages)
7575

7676
- **Dashboard**: connection status, server version/build date, quick counts, model availability snapshot.
77-
- **Basic Settings**: debug, proxy URL, request retry, quota fallback (switch project or preview models when limits reached), usage statistics, request logging, file logging, WebSocket auth.
78-
- **API Keys**: manage proxy `api-keys` (add/edit/delete).
77+
- **Config Panel**: visual editor for common `config.yaml` fields, basic settings, proxy `api-keys`, and source editing with YAML highlighting/search plus a save diff preview.
7978
- **AI Providers**:
8079
- Gemini/Codex/Claude/Vertex key entries (base URL, headers, proxy, model aliases, excluded models, prefix).
8180
- OpenAI-compatible providers (multiple API keys, custom headers, model alias import via `/v1/models`, optional browser-side "chat/completions" test).
82-
- Ampcode integration (upstream URL/key, force mappings, model mapping table).
8381
- **Auth Files**: upload/download/delete JSON credentials, filter/search/pagination, runtime-only indicators, view supported models per credential (when the server supports it), manage OAuth excluded models (supports `*` wildcards), configure OAuth model alias mappings.
8482
- **OAuth**: start OAuth/device flows for supported providers, poll status, optionally submit callback `redirect_url`.
8583
- **Quota Management**: manage quota limits and usage for Claude, Antigravity, Codex, Gemini CLI, and other providers.
8684
- **Usage**: requests/tokens charts (hour/day), per-API & per-model breakdown, cached/reasoning token breakdown, RPM/TPM window, optional cost estimation with locally-saved model pricing.
8785
- **Config**: edit `/config.yaml` in-browser with YAML highlighting + search, then save/reload.
8886
- **Logs**: tail logs with incremental polling, auto-refresh, search, hide management traffic, clear logs; download request error log files.
89-
- **System**: quick links + fetch `/v1/models` (grouped view). Requires at least one proxy API key to query models.
87+
- **System**: quick links, update check, request logging toggle, local login data cleanup, and fetch `/v1/models` (grouped view). Requires at least one proxy API key to query models.
9088

9189
## Tech Stack
9290

93-
- React 19 + TypeScript 5.9
94-
- Vite 7 (single-file build)
91+
- React 19 + TypeScript 6.0
92+
- Vite 8 (single-file build)
9593
- Zustand (state management)
9694
- Axios (HTTP client)
9795
- react-router-dom v7 (HashRouter)
98-
- Chart.js (data visualization)
96+
- Motion (animations)
9997
- CodeMirror 6 (YAML editor)
10098
- SCSS Modules (styling)
10199
- i18next (internationalization)
102100

103101
## Internationalization
104102

105-
Currently supports three languages:
103+
Currently supports four languages:
106104

107105
- English (en)
108106
- Simplified Chinese (zh-CN)
107+
- Traditional Chinese (zh-TW)
109108
- Russian (ru)
110109

111-
The UI language is automatically detected from browser settings and can be manually switched at the bottom of the page.
110+
The UI language is automatically detected from browser settings and can be manually switched from the login page or header language menu.
112111

113112
## Browser Compatibility
114113

@@ -120,7 +119,7 @@ The UI language is automatically detected from browser settings and can be manua
120119

121120
- Vite produces a **single HTML** output (`dist/index.html`) with all assets inlined (via `vite-plugin-singlefile`).
122121
- Tagging `vX.Y.Z` triggers `.github/workflows/release.yml` to publish `dist/management.html`.
123-
- The UI version shown in the footer is injected at build time (env `VERSION`, git tag, or `package.json` fallback).
122+
- The UI version shown on the System page is injected at build time (env `VERSION`, git tag, or `package.json` fallback).
124123

125124
## Security notes
126125

@@ -138,12 +137,12 @@ The UI language is automatically detected from browser settings and can be manua
138137
## Development
139138

140139
```bash
141-
npm run dev # Vite dev server
142-
npm run build # tsc + Vite build
143-
npm run preview # serve dist locally
144-
npm run lint # ESLint (fails on warnings)
145-
npm run format # Prettier
146-
npm run type-check # tsc --noEmit
140+
bun run dev # Vite dev server
141+
bun run build # tsc + Vite build
142+
bun run preview # serve dist locally
143+
bun run lint # ESLint (fails on warnings)
144+
bun run format # Prettier
145+
bun run type-check # tsc --noEmit
147146
```
148147

149148
## Contributing
@@ -152,7 +151,7 @@ Issues and PRs are welcome. Please include:
152151

153152
- Reproduction steps (server version + UI version)
154153
- Screenshots for UI changes
155-
- Verification notes (`npm run lint`, `npm run type-check`)
154+
- Verification notes (`bun run lint`, `bun run type-check`, `bun run build`)
156155

157156
## License
158157

README_CN.md

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
# CLI Proxy API 管理中心
22

3-
用于管理与故障排查 **CLI Proxy API** 的单文件 Web UI(React + TypeScript),通过 **Management API** 完成配置、凭据、日志与统计等管理操作
3+
用于管理与故障排查 **CLI Proxy API** 的单文件 Web UI(React + TypeScript),通过 **Management API** 完成配置、凭据与日志等管理操作
44

55
[English](README.md)
66

77
**主项目**: https://github.com/NGLSL/CLIProxyAPI
88
**示例地址**: https://remote.router-for.me/
9-
**最低版本要求**: ≥ 6.8.0(推荐 ≥ 6.8.15
9+
**最低版本要求**: ≥ 7.1.0(推荐最新
1010

1111
从6.0.19版本开始,Web UI 随主程序一起提供;服务运行后,通过 API 端口上的"/management.html"访问它。
1212

1313
## 这是什么(以及不是什么)
1414

15-
- 本仓库只包含 Web 管理界面本身,通过 CLI Proxy API 的 **Management API**`/v0/management`)读取/修改配置、上传凭据、查看日志与使用统计
15+
- 本仓库只包含 Web 管理界面本身,通过 CLI Proxy API 的 **Management API**`/v0/management`)读取/修改配置、上传凭据与查看日志
1616
-**不是** 代理本体,不参与流量转发。
1717

1818
## 快速开始
@@ -28,22 +28,22 @@
2828
### 方式 B:开发调试
2929

3030
```bash
31-
npm install
32-
npm run dev
31+
bun install --frozen-lockfile
32+
bun run dev
3333
```
3434

3535
打开 `http://localhost:5173`,然后连接到你的 CLI Proxy API 后端实例。
3636

3737
### 方式 C:构建单文件 HTML
3838

3939
```bash
40-
npm install
41-
npm run build
40+
bun install --frozen-lockfile
41+
bun run build
4242
```
4343

4444
- 构建产物:`dist/index.html`(资源已全部内联)。
4545
- 在 CLI Proxy API 的发布流程里会重命名为 `management.html`
46-
- 本地预览:`npm run preview`
46+
- 本地预览:`bun run preview`
4747

4848
提示:直接用 `file://` 打开 `dist/index.html` 可能遇到浏览器 CORS 限制;更稳妥的方式是用预览/静态服务器打开。
4949

@@ -69,45 +69,45 @@ npm run build
6969
### 远程管理
7070

7171
当你从非 localhost 的浏览器访问时,服务端通常需要开启远程管理(例如 `allow-remote-management: true`)。
72+
完整鉴权规则、服务端限制与边界情况请参考 CLI Proxy API 服务端文档或配置注释。
7273

7374
## 功能一览(按页面对应)
7475

7576
- **仪表盘**:连接状态、服务版本/构建时间、关键数量概览、可用模型概览。
76-
- **基础设置**:调试开关、代理 URL、请求重试、配额回退(达到上限时切换项目或预览模型)、使用统计、请求日志、文件日志、WebSocket 鉴权。
77-
- **API Keys**:管理代理 `api-keys`(增/改/删)。
77+
- **配置面板**:可视化编辑常用 `config.yaml` 字段、基础设置与代理 `api-keys`;也支持源码编辑、YAML 高亮/搜索与保存前差异预览。
7878
- **AI 提供商**
7979
- Gemini/Codex/Claude/Vertex 配置(Base URL、Headers、代理、模型别名、排除模型、Prefix)。
8080
- OpenAI 兼容提供商(多 Key、Header、自助从 `/v1/models` 拉取并导入模型别名、可选浏览器侧 `chat/completions` 测试)。
81-
- Ampcode 集成(上游地址/密钥、强制映射、模型映射表)。
8281
- **认证文件**:上传/下载/删除 JSON 凭据,筛选/搜索/分页,标记 runtime-only;查看单个凭据可用模型(依赖后端支持);管理 OAuth 排除模型(支持 `*` 通配符);配置 OAuth 模型别名映射。
8382
- **OAuth**:对支持的提供商发起 OAuth/设备码流程,轮询状态;可选提交回调 `redirect_url`
8483
- **配额管理**:管理 Claude、Antigravity、Codex、Gemini CLI 等提供商的配额上限与使用情况。
8584
- **使用统计**:按小时/天图表、按 API 与按模型统计、缓存/推理 Token 拆分、RPM/TPM 时间窗、可选本地保存的模型价格用于费用估算。
8685
- **配置文件**:浏览器内编辑 `/config.yaml`(YAML 高亮 + 搜索),保存/重载。
8786
- **日志**:增量拉取日志、自动刷新、搜索、隐藏管理端流量、清空日志;下载请求错误日志文件。
88-
- **系统信息**:快捷链接 + 拉取 `/v1/models` 并分组展示(需要至少一个代理 API Key 才能查询模型)。
87+
- **系统信息**:快捷链接、版本检查、请求日志开关、本地登录信息清理,以及拉取 `/v1/models` 并分组展示(需要至少一个代理 API Key 才能查询模型)。
8988

9089
## 技术栈
9190

92-
- React 19 + TypeScript 5.9
93-
- Vite 7(单文件构建)
91+
- React 19 + TypeScript 6.0
92+
- Vite 8(单文件构建)
9493
- Zustand(状态管理)
9594
- Axios(HTTP 客户端)
9695
- react-router-dom v7(HashRouter)
97-
- Chart.js(数据可视化
96+
- Motion(动效
9897
- CodeMirror 6(YAML 编辑器)
9998
- SCSS Modules(样式)
10099
- i18next(国际化)
101100

102101
## 多语言支持
103102

104-
目前支持三种语言
103+
目前支持四种语言
105104

106105
- 英文 (en)
107106
- 简体中文 (zh-CN)
107+
- 繁体中文 (zh-TW)
108108
- 俄文 (ru)
109109

110-
界面语言会根据浏览器设置自动切换,也可在页面底部手动切换
110+
界面语言会根据浏览器设置自动切换,也可在登录页或顶部语言菜单手动切换
111111

112112
## 浏览器兼容性
113113

@@ -119,7 +119,7 @@ npm run build
119119

120120
- 使用 Vite 输出 **单文件 HTML**`dist/index.html`),资源全部内联(`vite-plugin-singlefile`)。
121121
-`vX.Y.Z` 标签会触发 `.github/workflows/release.yml`,发布 `dist/management.html`
122-
- 页脚显示的 UI 版本在构建期注入(优先使用环境变量 `VERSION`,否则使用 git tag / `package.json`)。
122+
- 系统信息页显示的 UI 版本在构建期注入(优先使用环境变量 `VERSION`,否则使用 git tag / `package.json`)。
123123

124124
## 安全提示
125125

@@ -137,12 +137,12 @@ npm run build
137137
## 开发命令
138138

139139
```bash
140-
npm run dev # 启动开发服务器
141-
npm run build # tsc + Vite 构建
142-
npm run preview # 本地预览 dist
143-
npm run lint # ESLint(warnings 视为失败)
144-
npm run format # Prettier
145-
npm run type-check # tsc --noEmit
140+
bun run dev # 启动开发服务器
141+
bun run build # tsc + Vite 构建
142+
bun run preview # 本地预览 dist
143+
bun run lint # ESLint(warnings 视为失败)
144+
bun run format # Prettier
145+
bun run type-check # tsc --noEmit
146146
```
147147

148148
## 贡献
@@ -151,7 +151,7 @@ npm run type-check # tsc --noEmit
151151

152152
- 复现步骤(服务端版本 + UI 版本)
153153
- UI 改动截图
154-
- 验证记录(`npm run lint``npm run type-check`
154+
- 验证记录(`bun run lint``bun run type-check``bun run build`
155155

156156
## 许可证
157157

src/assets/icons/apikey-fun.png

17.3 KB
Loading

src/assets/icons/grok-dark.svg

Lines changed: 1 addition & 0 deletions
Loading

src/assets/logoInline.ts

Lines changed: 2 additions & 1 deletion
Large diffs are not rendered by default.

src/components/common/ConfirmationModal.tsx

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,15 @@ export function ConfirmationModal() {
1515
return null;
1616
}
1717

18-
const { title, message, onConfirm, onCancel, confirmText, cancelText, variant = 'primary' } = options;
18+
const {
19+
title,
20+
message,
21+
onConfirm,
22+
onCancel,
23+
confirmText,
24+
cancelText,
25+
variant = 'primary',
26+
} = options;
1927

2028
const handleConfirm = async () => {
2129
try {
@@ -24,7 +32,7 @@ export function ConfirmationModal() {
2432
hideConfirmation();
2533
} catch (error) {
2634
console.error('Confirmation action failed:', error);
27-
// Optional: show error notification here if needed,
35+
// Optional: show error notification here if needed,
2836
// but usually the calling component handles specific errors.
2937
} finally {
3038
setConfirmationLoading(false);
@@ -52,11 +60,7 @@ export function ConfirmationModal() {
5260
<Button variant="ghost" onClick={handleCancel} disabled={isLoading}>
5361
{cancelText || t('common.cancel')}
5462
</Button>
55-
<Button
56-
variant={variant}
57-
onClick={handleConfirm}
58-
loading={isLoading}
59-
>
63+
<Button variant={variant} onClick={handleConfirm} loading={isLoading}>
6064
{confirmText || t('common.confirm')}
6165
</Button>
6266
</div>

src/components/common/NotificationContainer.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ export function NotificationContainer() {
2323

2424
const newNotifications = notifications.filter((n) => !prevIds.has(n.id));
2525

26-
const removedIds = new Set(prevNotifications.filter((n) => !currentIds.has(n.id)).map((n) => n.id));
26+
const removedIds = new Set(
27+
prevNotifications.filter((n) => !currentIds.has(n.id)).map((n) => n.id)
28+
);
2729

2830
setAnimatedNotifications((prev) => {
2931
let updated = prev.map((n) => (removedIds.has(n.id) ? { ...n, isExiting: true } : n));
@@ -49,7 +51,9 @@ export function NotificationContainer() {
4951
}, [notifications]);
5052

5153
const handleClose = (id: string) => {
52-
setAnimatedNotifications((prev) => prev.map((n) => (n.id === id ? { ...n, isExiting: true } : n)));
54+
setAnimatedNotifications((prev) =>
55+
prev.map((n) => (n.id === id ? { ...n, isExiting: true } : n))
56+
);
5357

5458
setTimeout(() => {
5559
removeNotification(id);

0 commit comments

Comments
 (0)