feat: 添加 cloudflare_pages、mysql_d1_backup_scheduler,更新 start_system、ensemble_models 及配置文件
This commit is contained in:
1 parent
6184c34a3a
commit
62110554d1
20 files changed
+1438
-19
No files matched your search
@@ -0,0 +1,41 @@
|
||||
# Cloudflare Pages 看板
|
||||
|
||||
本目录提供一个可直接部署到 Cloudflare Pages 的页面,数据源为 D1(由 MySQL 备份任务同步而来)。
|
||||
|
||||
## 目录结构
|
||||
|
||||
- `public/`:静态页面资源
|
||||
- `functions/api/`:Pages Functions,直接查询 D1
|
||||
|
||||
## 必要前置
|
||||
|
||||
1. 已在 D1 中有备份表:
|
||||
- `backup_trades`
|
||||
- `backup_hourly_model_predictions`
|
||||
|
||||
2. Pages 项目绑定 D1(绑定名必须是 `DB`)
|
||||
|
||||
## 本地开发
|
||||
|
||||
```bash
|
||||
cd cloudflare_pages
|
||||
npx wrangler pages dev public --d1 DB=<你的D1数据库ID>
|
||||
```
|
||||
|
||||
## 生产部署
|
||||
|
||||
1. 在 Cloudflare Pages 新建项目,根目录设置为 `cloudflare_pages`
|
||||
2. Build command 留空
|
||||
3. Build output directory 设置为 `public`
|
||||
4. 在 Pages 项目 Settings -> Functions -> D1 bindings 中添加:
|
||||
- Variable name: `DB`
|
||||
- D1 database: 选择你的数据库
|
||||
|
||||
## 页面接口
|
||||
|
||||
- `/api/status`
|
||||
- `/api/trades/current`
|
||||
- `/api/trades/history?page=1&limit=15&month=YYYY-MM&day=YYYY-MM-DD`
|
||||
- `/api/accuracy/monthly?month=YYYY-MM`
|
||||
- `/api/accuracy/daily?month=YYYY-MM&page=1&limit=10`
|
||||
- `/api/accuracy/hourly/YYYY-MM-DD`
|
||||
Reference in new issue
Block a user