فهرست منبع

移除部分日志

Taio_O 2 هفته پیش
والد
کامیت
b0274d87bf
4فایلهای تغییر یافته به همراه17 افزوده شده و 83 حذف شده
  1. 8 73
      README.md
  2. 7 4
      src/app.js
  3. 0 2
      src/core/scheduler.js
  4. 2 4
      start.js

+ 8 - 73
README.md

@@ -97,40 +97,6 @@ npm run dev
 npm start
 ```
 
-## API接口
-
-### 节点管理
-
-- `GET /api/nodes` - 获取节点列表
-- `GET /api/nodes/:id` - 获取节点详情
-- `POST /api/nodes` - 创建节点
-- `PUT /api/nodes/:id` - 更新节点
-- `DELETE /api/nodes/:id` - 删除节点
-
-### 配置导入
-
-- `POST /api/import/clash` - 导入Clash配置
-
-### 订阅管理
-
-- `POST /api/subscription/update` - 手动更新订阅
-- `GET /api/subscription/status` - 获取订阅状态
-
-### 测试管理
-
-- `POST /api/test/manual` - 手动触发测试
-- `GET /api/test/results` - 获取测试结果
-
-### 通知管理
-
-- `GET /api/notifications` - 获取通知列表
-- `POST /api/notifications/test` - 测试通知连接
-
-### 统计信息
-
-- `GET /api/stats` - 获取统计信息
-- `GET /api/status` - 获取系统状态
-
 ## 使用说明
 
 ### 1. 创建Telegram机器人
@@ -151,47 +117,16 @@ npm run get-chat-id
 npm run test-telegram
 ```
 
-### 2. 导入Clash配置
-
-```bash
-# 通过API导入
-curl -X POST http://localhost:3000/api/import/clash \
-  -H "Content-Type: application/json" \
-  -d '{
-    "configPath": "/path/to/your/clash/config.yaml"
-  }'
-
-# 或通过URL导入
-curl -X POST http://localhost:3000/api/import/clash \
-  -H "Content-Type: application/json" \
-  -d '{
-    "configUrl": "https://example.com/clash-config.yaml"
-  }'
-```
-
-### 3. 订阅管理
+### 2. 使用Web界面
 
-```bash
-# 手动更新订阅
-curl -X POST http://localhost:3000/api/subscription/update
+启动应用后,在浏览器中访问 `http://localhost:3000` 即可使用Web界面进行:
 
-# 获取订阅状态
-curl -X GET http://localhost:3000/api/subscription/status
-```
-
-### 4. 手动测试
-
-```bash
-# 测试所有节点
-curl -X POST http://localhost:3000/api/test/manual
-
-# 测试指定节点
-curl -X POST http://localhost:3000/api/test/manual \
-  -H "Content-Type: application/json" \
-  -d '{
-    "nodeIds": [1, 2, 3]
-  }'
-```
+- 节点管理
+- 配置导入
+- 订阅管理
+- 手动测试
+- 查看测试结果
+- 通知设置
 
 ## 项目结构
 

+ 7 - 4
src/app.js

@@ -40,8 +40,12 @@ app.use(express.static('public'));
 
 // 请求日志中间件 - 只记录重要请求
 app.use((req, res, next) => {
-  // 只记录API请求,不记录静态文件请求
-  if (req.path.startsWith('/api/') && !req.path.includes('/favicon') && !req.path.includes('/sw.js')) {
+  // 只记录重要的API请求,不记录频繁的自动刷新请求
+  if (req.path.startsWith('/api/') && 
+      !req.path.includes('/favicon') && 
+      !req.path.includes('/sw.js') &&
+      !req.path.includes('/stats') && 
+      !req.path.includes('/test/results')) {
     logger.info(`${req.method} ${req.path}`);
   }
   next();
@@ -124,8 +128,7 @@ async function startApp() {
     // 启动服务器
     app.listen(PORT, () => {
       logger.info(`服务器启动成功,端口: ${PORT}`);
-      logger.info(`健康检查: http://localhost:${PORT}/health`);
-      logger.info(`API文档: http://localhost:${PORT}/api`);
+      logger.info(`前端界面: http://localhost:${PORT}`);
     });
 
   } catch (error) {

+ 0 - 2
src/core/scheduler.js

@@ -246,8 +246,6 @@ class Scheduler {
 
     // 每次测速完成后都发送详细的测试总结报告
     await this.notifier.sendSummaryNotification(summary);
-
-    logger.info('测试摘要生成完成', summary);
   }
 
   /**

+ 2 - 4
start.js

@@ -66,10 +66,8 @@ async function start() {
     console.log(`   测试超时: ${process.env.SPEED_TEST_TIMEOUT || 10000}ms`);
     console.log(`   订阅更新间隔: ${(process.env.SUBSCRIPTION_UPDATE_INTERVAL || 3600000) / 1000}秒`);
     
-    console.log('\n🌐 API接口:');
-    console.log(`   健康检查: http://localhost:${process.env.PORT || 3000}/health`);
-    console.log(`   API文档: http://localhost:${process.env.PORT || 3000}/api`);
-    console.log(`   订阅状态: http://localhost:${process.env.PORT || 3000}/api/subscription/status`);
+    console.log('\n🌐 应用地址:');
+    console.log(`   前端界面: http://localhost:${process.env.PORT || 3000}`);
     
     console.log('\n🔄 启动应用...\n');