Skip to content

A modern and elegant dashboard for network traffic visualization and analysis.

64.8 KB
Raw Blame
{
  "type": "excalidraw",
  "version": 2,
  "source": "https://excalidraw.com",
  "elements": [
    {
      "id": "title",
      "type": "text",
      "x": 40,
      "y": -50,
      "width": 282.56,
      "height": 51.4,
      "angle": 0,
      "strokeColor": "#212529",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": null,
      "seed": 1000,
      "version": 1,
      "versionNonce": 1001,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false,
      "text": "Neko Master 系统架构图",
      "fontSize": 28,
      "fontFamily": 1,
      "textAlign": "left",
      "verticalAlign": "top",
      "containerId": null,
      "originalText": "Neko Master 系统架构图",
      "lineHeight": 1.55,
      "baseline": 28
    },
    {
      "id": "fe-layer",
      "type": "rectangle",
      "x": 40,
      "y": 0,
      "width": 1760,
      "height": 440,
      "angle": 0,
      "strokeColor": "#1971c2",
      "backgroundColor": "#e7f5ff",
      "fillStyle": "solid",
      "strokeWidth": 3,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": {
        "type": 3
      },
      "seed": 1002,
      "version": 1,
      "versionNonce": 1003,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false
    },
    {
      "id": "fe-title",
      "type": "text",
      "x": 60,
      "y": 8,
      "width": 453.92,
      "height": 34.35,
      "angle": 0,
      "strokeColor": "#1864ab",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": null,
      "seed": 1004,
      "version": 1,
      "versionNonce": 1005,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false,
      "text": "🖥  前端展示层 (Frontend)  ·  Next.js 16 App Router",
      "fontSize": 17,
      "fontFamily": 1,
      "textAlign": "left",
      "verticalAlign": "top",
      "containerId": null,
      "originalText": "🖥  前端展示层 (Frontend)  ·  Next.js 16 App Router",
      "lineHeight": 1.55,
      "baseline": 17
    },
    {
      "id": "fe-nextjs",
      "type": "rectangle",
      "x": 70,
      "y": 38,
      "width": 1700,
      "height": 185,
      "angle": 0,
      "strokeColor": "#339af0",
      "backgroundColor": "#d0ebff",
      "fillStyle": "solid",
      "strokeWidth": 2,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": {
        "type": 3
      },
      "seed": 1006,
      "version": 1,
      "versionNonce": 1007,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false
    },
    {
      "id": "fe-nextjs-t",
      "type": "text",
      "x": 90,
      "y": 46,
      "width": 196.32000000000002,
      "height": 29.7,
      "angle": 0,
      "strokeColor": "#1864ab",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": null,
      "seed": 1008,
      "version": 1,
      "versionNonce": 1009,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false,
      "text": "Next.js 16 (App Router)",
      "fontSize": 14,
      "fontFamily": 1,
      "textAlign": "left",
      "verticalAlign": "top",
      "containerId": null,
      "originalText": "Next.js 16 (App Router)",
      "lineHeight": 1.55,
      "baseline": 14
    },
    {
      "id": "fe-dash-r",
      "type": "rectangle",
      "x": 90,
      "y": 72,
      "width": 390,
      "height": 138,
      "angle": 0,
      "strokeColor": "#74c0fc",
      "backgroundColor": "#ffffff",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": {
        "type": 3
      },
      "seed": 1010,
      "version": 1,
      "versionNonce": 1011,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false
    },
    {
      "id": "fe-dash-t",
      "type": "text",
      "x": 102,
      "y": 82,
      "width": 76.48,
      "height": 82.4,
      "angle": 0,
      "strokeColor": "#1864ab",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": null,
      "seed": 1012,
      "version": 1,
      "versionNonce": 1013,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false,
      "text": "Dashboard\n仪表板\n\n主数据看板",
      "fontSize": 12,
      "fontFamily": 1,
      "textAlign": "left",
      "verticalAlign": "top",
      "containerId": null,
      "originalText": "Dashboard\n仪表板\n\n主数据看板",
      "lineHeight": 1.55,
      "baseline": 12
    },
    {
      "id": "fe-over-r",
      "type": "rectangle",
      "x": 500,
      "y": 72,
      "width": 390,
      "height": 138,
      "angle": 0,
      "strokeColor": "#74c0fc",
      "backgroundColor": "#ffffff",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": {
        "type": 3
      },
      "seed": 1014,
      "version": 1,
      "versionNonce": 1015,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false
    },
    {
      "id": "fe-over-t",
      "type": "text",
      "x": 512,
      "y": 82,
      "width": 69.76,
      "height": 82.4,
      "angle": 0,
      "strokeColor": "#1864ab",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": null,
      "seed": 1016,
      "version": 1,
      "versionNonce": 1017,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false,
      "text": "Overview\n概览\n\n汇总统计",
      "fontSize": 12,
      "fontFamily": 1,
      "textAlign": "left",
      "verticalAlign": "top",
      "containerId": null,
      "originalText": "Overview\n概览\n\n汇总统计",
      "lineHeight": 1.55,
      "baseline": 12
    },
    {
      "id": "fe-charts-r",
      "type": "rectangle",
      "x": 910,
      "y": 72,
      "width": 390,
      "height": 138,
      "angle": 0,
      "strokeColor": "#74c0fc",
      "backgroundColor": "#ffffff",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": {
        "type": 3
      },
      "seed": 1018,
      "version": 1,
      "versionNonce": 1019,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false
    },
    {
      "id": "fe-charts-t",
      "type": "text",
      "x": 922,
      "y": 82,
      "width": 56.32000000000001,
      "height": 82.4,
      "angle": 0,
      "strokeColor": "#1864ab",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": null,
      "seed": 1020,
      "version": 1,
      "versionNonce": 1021,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false,
      "text": "Charts\n图表\n\n趋势可视化",
      "fontSize": 12,
      "fontFamily": 1,
      "textAlign": "left",
      "verticalAlign": "top",
      "containerId": null,
      "originalText": "Charts\n图表\n\n趋势可视化",
      "lineHeight": 1.55,
      "baseline": 12
    },
    {
      "id": "fe-tables-r",
      "type": "rectangle",
      "x": 1320,
      "y": 72,
      "width": 440,
      "height": 138,
      "angle": 0,
      "strokeColor": "#74c0fc",
      "backgroundColor": "#ffffff",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": {
        "type": 3
      },
      "seed": 1022,
      "version": 1,
      "versionNonce": 1023,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false
    },
    {
      "id": "fe-tables-t",
      "type": "text",
      "x": 1332,
      "y": 82,
      "width": 136.96,
      "height": 82.4,
      "angle": 0,
      "strokeColor": "#1864ab",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": null,
      "seed": 1024,
      "version": 1,
      "versionNonce": 1025,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false,
      "text": "Interactive Tables\n交互式表格\n\n域名/IP/代理/规则",
      "fontSize": 12,
      "fontFamily": 1,
      "textAlign": "left",
      "verticalAlign": "top",
      "containerId": null,
      "originalText": "Interactive Tables\n交互式表格\n\n域名/IP/代理/规则",
      "lineHeight": 1.55,
      "baseline": 12
    },
    {
      "id": "fe-rq-r",
      "type": "rectangle",
      "x": 70,
      "y": 235,
      "width": 835,
      "height": 185,
      "angle": 0,
      "strokeColor": "#339af0",
      "backgroundColor": "#e7f5ff",
      "fillStyle": "solid",
      "strokeWidth": 2,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": {
        "type": 3
      },
      "seed": 1026,
      "version": 1,
      "versionNonce": 1027,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false
    },
    {
      "id": "fe-rq-t",
      "type": "text",
      "x": 90,
      "y": 245,
      "width": 176.16000000000003,
      "height": 108.75,
      "angle": 0,
      "strokeColor": "#1864ab",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": null,
      "seed": 1028,
      "version": 1,
      "versionNonce": 1029,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false,
      "text": "React Query (TanStack)\n\n· API 数据获取与缓存\n· 乐观更新与状态管理\n· 自动重试与错误处理",
      "fontSize": 13,
      "fontFamily": 1,
      "textAlign": "left",
      "verticalAlign": "top",
      "containerId": null,
      "originalText": "React Query (TanStack)\n\n· API 数据获取与缓存\n· 乐观更新与状态管理\n· 自动重试与错误处理",
      "lineHeight": 1.55,
      "baseline": 13
    },
    {
      "id": "fe-wsh-r",
      "type": "rectangle",
      "x": 925,
      "y": 235,
      "width": 845,
      "height": 185,
      "angle": 0,
      "strokeColor": "#339af0",
      "backgroundColor": "#e7f5ff",
      "fillStyle": "solid",
      "strokeWidth": 2,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": {
        "type": 3
      },
      "seed": 1030,
      "version": 1,
      "versionNonce": 1031,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false
    },
    {
      "id": "fe-wsh-t",
      "type": "text",
      "x": 945,
      "y": 245,
      "width": 176.16000000000003,
      "height": 108.75,
      "angle": 0,
      "strokeColor": "#1864ab",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": null,
      "seed": 1032,
      "version": 1,
      "versionNonce": 1033,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false,
      "text": "useStatsWebSocket Hook\n\n· WebSocket 连接管理\n· 实时数据订阅\n· 自动重连与心跳",
      "fontSize": 13,
      "fontFamily": 1,
      "textAlign": "left",
      "verticalAlign": "top",
      "containerId": null,
      "originalText": "useStatsWebSocket Hook\n\n· WebSocket 连接管理\n· 实时数据订阅\n· 自动重连与心跳",
      "lineHeight": 1.55,
      "baseline": 13
    },
    {
      "id": "arr-fe-svc",
      "type": "arrow",
      "x": 950,
      "y": 440,
      "width": 0,
      "height": 70,
      "angle": 0,
      "strokeColor": "#1971c2",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 2,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": {
        "type": 2
      },
      "seed": 1034,
      "version": 1,
      "versionNonce": 1035,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false,
      "points": [
        [
          0,
          0
        ],
        [
          0,
          70
        ]
      ],
      "lastCommittedPoint": null,
      "startBinding": null,
      "endBinding": null,
      "startArrowhead": null,
      "endArrowhead": "arrow"
    },
    {
      "id": "arr-fe-svc-lbl",
      "type": "text",
      "x": 960,
      "y": 448,
      "width": 210.88000000000002,
      "height": 26.6,
      "angle": 0,
      "strokeColor": "#1971c2",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": null,
      "seed": 1036,
      "version": 1,
      "versionNonce": 1037,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false,
      "text": "HTTP / WebSocket  (Cookie 认证)",
      "fontSize": 12,
      "fontFamily": 1,
      "textAlign": "left",
      "verticalAlign": "top",
      "containerId": null,
      "originalText": "HTTP / WebSocket  (Cookie 认证)",
      "lineHeight": 1.55,
      "baseline": 12
    },
    {
      "id": "svc-layer",
      "type": "rectangle",
      "x": 40,
      "y": 510,
      "width": 1760,
      "height": 1190,
      "angle": 0,
      "strokeColor": "#2f9e44",
      "backgroundColor": "#ebfbee",
      "fillStyle": "solid",
      "strokeWidth": 3,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": {
        "type": 3
      },
      "seed": 1038,
      "version": 1,
      "versionNonce": 1039,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false
    },
    {
      "id": "svc-title",
      "type": "text",
      "x": 60,
      "y": 518,
      "width": 273.04,
      "height": 34.35,
      "angle": 0,
      "strokeColor": "#2b8a3e",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": null,
      "seed": 1040,
      "version": 1,
      "versionNonce": 1041,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false,
      "text": "⚙️  服务层 (Collector Service)",
      "fontSize": 17,
      "fontFamily": 1,
      "textAlign": "left",
      "verticalAlign": "top",
      "containerId": null,
      "originalText": "⚙️  服务层 (Collector Service)",
      "lineHeight": 1.55,
      "baseline": 17
    },
    {
      "id": "svc-api-r",
      "type": "rectangle",
      "x": 70,
      "y": 550,
      "width": 840,
      "height": 300,
      "angle": 0,
      "strokeColor": "#51cf66",
      "backgroundColor": "#d3f9d8",
      "fillStyle": "solid",
      "strokeWidth": 2,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": {
        "type": 3
      },
      "seed": 1042,
      "version": 1,
      "versionNonce": 1043,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false
    },
    {
      "id": "svc-api-t",
      "type": "text",
      "x": 90,
      "y": 560,
      "width": 197.44000000000003,
      "height": 249.8,
      "angle": 0,
      "strokeColor": "#1b5e20",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": null,
      "seed": 1044,
      "version": 1,
      "versionNonce": 1045,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false,
      "text": "API Server (Fastify)\n\nREST API Endpoints:\n  /api/backends     - 后端管理\n  /api/stats        - 统计数据\n  /api/auth         - 认证管理\n  /api/domains      - 域名统计\n  /api/ips          - IP 统计\n  /api/proxies      - 代理统计\n  /api/rules        - 规则统计\n  /api/devices      - 设备统计\n  /api/gateway/*    - 网关代理\n  /api/retention    - 数据保留",
      "fontSize": 12,
      "fontFamily": 1,
      "textAlign": "left",
      "verticalAlign": "top",
      "containerId": null,
      "originalText": "API Server (Fastify)\n\nREST API Endpoints:\n  /api/backends     - 后端管理\n  /api/stats        - 统计数据\n  /api/auth         - 认证管理\n  /api/domains      - 域名统计\n  /api/ips          - IP 统计\n  /api/proxies      - 代理统计\n  /api/rules        - 规则统计\n  /api/devices      - 设备统计\n  /api/gateway/*    - 网关代理\n  /api/retention    - 数据保留",
      "lineHeight": 1.55,
      "baseline": 12
    },
    {
      "id": "svc-ws-r",
      "type": "rectangle",
      "x": 930,
      "y": 550,
      "width": 835,
      "height": 300,
      "angle": 0,
      "strokeColor": "#51cf66",
      "backgroundColor": "#d3f9d8",
      "fillStyle": "solid",
      "strokeWidth": 2,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": {
        "type": 3
      },
      "seed": 1046,
      "version": 1,
      "versionNonce": 1047,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false
    },
    {
      "id": "svc-ws-t",
      "type": "text",
      "x": 950,
      "y": 560,
      "width": 251.20000000000002,
      "height": 194,
      "angle": 0,
      "strokeColor": "#1b5e20",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": null,
      "seed": 1048,
      "version": 1,
      "versionNonce": 1049,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false,
      "text": "WebSocket Server (ws)\n\n· 连接管理 (Client Connections)\n· 订阅管理 (Range / Backend / Interval)\n· 广播推送 (Broadcast Stats)\n· 摘要缓存 (Summary Cache, 2s TTL)\n· 策略缓存同步 (Surge Policy Sync)\n\n数据包类型:\n  stats  trend  domains  ips  pong",
      "fontSize": 12,
      "fontFamily": 1,
      "textAlign": "left",
      "verticalAlign": "top",
      "containerId": null,
      "originalText": "WebSocket Server (ws)\n\n· 连接管理 (Client Connections)\n· 订阅管理 (Range / Backend / Interval)\n· 广播推送 (Broadcast Stats)\n· 摘要缓存 (Summary Cache, 2s TTL)\n· 策略缓存同步 (Surge Policy Sync)\n\n数据包类型:\n  stats  trend  domains  ips  pong",
      "lineHeight": 1.55,
      "baseline": 12
    },
    {
      "id": "svc-gc-outer",
      "type": "rectangle",
      "x": 70,
      "y": 870,
      "width": 1700,
      "height": 310,
      "angle": 0,
      "strokeColor": "#20c997",
      "backgroundColor": "#c3fae8",
      "fillStyle": "solid",
      "strokeWidth": 2,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": {
        "type": 3
      },
      "seed": 1050,
      "version": 1,
      "versionNonce": 1051,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false
    },
    {
      "id": "svc-gc-title",
      "type": "text",
      "x": 90,
      "y": 878,
      "width": 227.68,
      "height": 29.7,
      "angle": 0,
      "strokeColor": "#087f5b",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": null,
      "seed": 1052,
      "version": 1,
      "versionNonce": 1053,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false,
      "text": "Gateway Collectors  (数据采集器)",
      "fontSize": 14,
      "fontFamily": 1,
      "textAlign": "left",
      "verticalAlign": "top",
      "containerId": null,
      "originalText": "Gateway Collectors  (数据采集器)",
      "lineHeight": 1.55,
      "baseline": 14
    },
    {
      "id": "svc-clash1-r",
      "type": "rectangle",
      "x": 90,
      "y": 908,
      "width": 520,
      "height": 255,
      "angle": 0,
      "strokeColor": "#63e6be",
      "backgroundColor": "#ffffff",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": {
        "type": 3
      },
      "seed": 1054,
      "version": 1,
      "versionNonce": 1055,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false
    },
    {
      "id": "svc-clash1-t",
      "type": "text",
      "x": 102,
      "y": 918,
      "width": 176.16000000000003,
      "height": 195.55,
      "angle": 0,
      "strokeColor": "#087f5b",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": null,
      "seed": 1056,
      "version": 1,
      "versionNonce": 1057,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false,
      "text": "Clash Collector (Mihomo)\n\n协议: WebSocket\n  WS /connections  实时推送\n\n功能:\n· 流量追踪 + 增量计算 (delta)\n· 代理链提取 (chains)\n· 批量缓冲 (30s flush / 5000条)\n· GeoIP 查询集成\n· 指数退避重连",
      "fontSize": 11,
      "fontFamily": 1,
      "textAlign": "left",
      "verticalAlign": "top",
      "containerId": null,
      "originalText": "Clash Collector (Mihomo)\n\n协议: WebSocket\n  WS /connections  实时推送\n\n功能:\n· 流量追踪 + 增量计算 (delta)\n· 代理链提取 (chains)\n· 批量缓冲 (30s flush / 5000条)\n· GeoIP 查询集成\n· 指数退避重连",
      "lineHeight": 1.55,
      "baseline": 11
    },
    {
      "id": "svc-clash2-r",
      "type": "rectangle",
      "x": 630,
      "y": 908,
      "width": 520,
      "height": 255,
      "angle": 0,
      "strokeColor": "#63e6be",
      "backgroundColor": "#ffffff",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": {
        "type": 3
      },
      "seed": 1058,
      "version": 1,
      "versionNonce": 1059,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false
    },
    {
      "id": "svc-clash2-t",
      "type": "text",
      "x": 642,
      "y": 918,
      "width": 176.16000000000003,
      "height": 195.55,
      "angle": 0,
      "strokeColor": "#087f5b",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": null,
      "seed": 1060,
      "version": 1,
      "versionNonce": 1061,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false,
      "text": "Clash Collector (Mihomo)\n\n协议: WebSocket\n  WS /connections  实时推送\n\n功能:\n· 流量追踪 + 增量计算 (delta)\n· 代理链提取 (chains)\n· 批量缓冲 (30s flush / 5000条)\n· GeoIP 查询集成\n· 指数退避重连",
      "fontSize": 11,
      "fontFamily": 1,
      "textAlign": "left",
      "verticalAlign": "top",
      "containerId": null,
      "originalText": "Clash Collector (Mihomo)\n\n协议: WebSocket\n  WS /connections  实时推送\n\n功能:\n· 流量追踪 + 增量计算 (delta)\n· 代理链提取 (chains)\n· 批量缓冲 (30s flush / 5000条)\n· GeoIP 查询集成\n· 指数退避重连",
      "lineHeight": 1.55,
      "baseline": 11
    },
    {
      "id": "svc-surge1-r",
      "type": "rectangle",
      "x": 1170,
      "y": 908,
      "width": 580,
      "height": 255,
      "angle": 0,
      "strokeColor": "#63e6be",
      "backgroundColor": "#ffffff",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": {
        "type": 3
      },
      "seed": 1062,
      "version": 1,
      "versionNonce": 1063,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false
    },
    {
      "id": "svc-surge1-t",
      "type": "text",
      "x": 1182,
      "y": 918,
      "width": 206.96,
      "height": 195.55,
      "angle": 0,
      "strokeColor": "#087f5b",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": null,
      "seed": 1064,
      "version": 1,
      "versionNonce": 1065,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false,
      "text": "Surge Collector\n\n协议: HTTP REST Polling (2s)\n  GET /v1/requests/recent\n\n功能:\n· 防重复计算 (recentlyCompleted Map)\n· 策略缓存同步 (10min 定时)\n· 增量计算 + 批量缓冲 (30s)\n· GeoIP 查询集成\n· 指数退避重试 (≤5次)",
      "fontSize": 11,
      "fontFamily": 1,
      "textAlign": "left",
      "verticalAlign": "top",
      "containerId": null,
      "originalText": "Surge Collector\n\n协议: HTTP REST Polling (2s)\n  GET /v1/requests/recent\n\n功能:\n· 防重复计算 (recentlyCompleted Map)\n· 策略缓存同步 (10min 定时)\n· 增量计算 + 批量缓冲 (30s)\n· GeoIP 查询集成\n· 指数退避重试 (≤5次)",
      "lineHeight": 1.55,
      "baseline": 11
    },
    {
      "id": "svc-ps-r",
      "type": "rectangle",
      "x": 70,
      "y": 1210,
      "width": 840,
      "height": 170,
      "angle": 0,
      "strokeColor": "#51cf66",
      "backgroundColor": "#d3f9d8",
      "fillStyle": "solid",
      "strokeWidth": 2,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": {
        "type": 3
      },
      "seed": 1066,
      "version": 1,
      "versionNonce": 1067,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false
    },
    {
      "id": "svc-ps-t",
      "type": "text",
      "x": 90,
      "y": 1220,
      "width": 257.92,
      "height": 119.60000000000001,
      "angle": 0,
      "strokeColor": "#1b5e20",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": null,
      "seed": 1068,
      "version": 1,
      "versionNonce": 1069,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false,
      "text": "Policy Sync Service  (背景任务)\n\n· 定时同步 Surge 策略: /v1/policies\n            /v1/policy_groups/select\n· 存储: surge_policy_cache 表\n· 缓存过期: 10 分钟 | 回退: 直接 API",
      "fontSize": 12,
      "fontFamily": 1,
      "textAlign": "left",
      "verticalAlign": "top",
      "containerId": null,
      "originalText": "Policy Sync Service  (背景任务)\n\n· 定时同步 Surge 策略: /v1/policies\n            /v1/policy_groups/select\n· 存储: surge_policy_cache 表\n· 缓存过期: 10 分钟 | 回退: 直接 API",
      "lineHeight": 1.55,
      "baseline": 12
    },
    {
      "id": "svc-rt-r",
      "type": "rectangle",
      "x": 930,
      "y": 1210,
      "width": 835,
      "height": 170,
      "angle": 0,
      "strokeColor": "#51cf66",
      "backgroundColor": "#d3f9d8",
      "fillStyle": "solid",
      "strokeWidth": 2,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": {
        "type": 3
      },
      "seed": 1070,
      "version": 1,
      "versionNonce": 1071,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false
    },
    {
      "id": "svc-rt-t",
      "type": "text",
      "x": 950,
      "y": 1220,
      "width": 278.08000000000004,
      "height": 156.8,
      "angle": 0,
      "strokeColor": "#1b5e20",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": null,
      "seed": 1072,
      "version": 1,
      "versionNonce": 1073,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false,
      "text": "RealtimeStore  (内存实时数据, 按 backendId 隔离)\n\n· summaryByBackend  · minuteByBackend\n· domainByBackend   · ipByBackend\n· proxyByBackend    · ruleByBackend\n· countryByBackend  · deviceByBackend\n\nmerge*() 合并 DB 数据与实时增量",
      "fontSize": 12,
      "fontFamily": 1,
      "textAlign": "left",
      "verticalAlign": "top",
      "containerId": null,
      "originalText": "RealtimeStore  (内存实时数据, 按 backendId 隔离)\n\n· summaryByBackend  · minuteByBackend\n· domainByBackend   · ipByBackend\n· proxyByBackend    · ruleByBackend\n· countryByBackend  · deviceByBackend\n\nmerge*() 合并 DB 数据与实时增量",
      "lineHeight": 1.55,
      "baseline": 12
    },
    {
      "id": "svc-geo-r",
      "type": "rectangle",
      "x": 70,
      "y": 1410,
      "width": 1700,
      "height": 160,
      "angle": 0,
      "strokeColor": "#51cf66",
      "backgroundColor": "#d3f9d8",
      "fillStyle": "solid",
      "strokeWidth": 2,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": {
        "type": 3
      },
      "seed": 1074,
      "version": 1,
      "versionNonce": 1075,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false
    },
    {
      "id": "svc-geo-t",
      "type": "text",
      "x": 90,
      "y": 1420,
      "width": 459.52000000000004,
      "height": 82.4,
      "angle": 0,
      "strokeColor": "#1b5e20",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": null,
      "seed": 1076,
      "version": 1,
      "versionNonce": 1077,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false,
      "text": "GeoIP Service\n\nProviders: IP-API.com (默认)  |  IPInfo.io (备选)\n功能:    本地 LRU 缓存  ·  批量查询优化  ·  失败冷却机制  ·  IPv4/IPv6 双栈  ·  ASN 查询",
      "fontSize": 12,
      "fontFamily": 1,
      "textAlign": "left",
      "verticalAlign": "top",
      "containerId": null,
      "originalText": "GeoIP Service\n\nProviders: IP-API.com (默认)  |  IPInfo.io (备选)\n功能:    本地 LRU 缓存  ·  批量查询优化  ·  失败冷却机制  ·  IPv4/IPv6 双栈  ·  ASN 查询",
      "lineHeight": 1.55,
      "baseline": 12
    },
    {
      "id": "svc-bb-r",
      "type": "rectangle",
      "x": 70,
      "y": 1605,
      "width": 1700,
      "height": 80,
      "angle": 0,
      "strokeColor": "#51cf66",
      "backgroundColor": "#d3f9d8",
      "fillStyle": "solid",
      "strokeWidth": 2,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": {
        "type": 3
      },
      "seed": 1078,
      "version": 1,
      "versionNonce": 1079,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false
    },
    {
      "id": "svc-bb-t",
      "type": "text",
      "x": 90,
      "y": 1617,
      "width": 661.1200000000001,
      "height": 45.2,
      "angle": 0,
      "strokeColor": "#1b5e20",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": null,
      "seed": 1080,
      "version": 1,
      "versionNonce": 1081,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false,
      "text": "BatchBuffer.flush()  ·  三写模式 (Triple Write):\n    ① SQLite  (始终写入)     ② ClickHouse Buffer 表  (CH_WRITE_ENABLED=1)     ③ RealtimeStore  (内存实时)",
      "fontSize": 12,
      "fontFamily": 1,
      "textAlign": "left",
      "verticalAlign": "top",
      "containerId": null,
      "originalText": "BatchBuffer.flush()  ·  三写模式 (Triple Write):\n    ① SQLite  (始终写入)     ② ClickHouse Buffer 表  (CH_WRITE_ENABLED=1)     ③ RealtimeStore  (内存实时)",
      "lineHeight": 1.55,
      "baseline": 12
    },
    {
      "id": "arr-svc-sq",
      "type": "arrow",
      "x": 480,
      "y": 1700,
      "width": 0,
      "height": 20,
      "angle": 0,
      "strokeColor": "#f08c00",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 2,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": {
        "type": 2
      },
      "seed": 1082,
      "version": 1,
      "versionNonce": 1083,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false,
      "points": [
        [
          0,
          0
        ],
        [
          0,
          20
        ]
      ],
      "lastCommittedPoint": null,
      "startBinding": null,
      "endBinding": null,
      "startArrowhead": null,
      "endArrowhead": "arrow"
    },
    {
      "id": "arr-svc-ch",
      "type": "arrow",
      "x": 1400,
      "y": 1700,
      "width": 0,
      "height": 20,
      "angle": 0,
      "strokeColor": "#f08c00",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 2,
      "strokeStyle": "dashed",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": {
        "type": 2
      },
      "seed": 1084,
      "version": 1,
      "versionNonce": 1085,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false,
      "points": [
        [
          0,
          0
        ],
        [
          0,
          20
        ]
      ],
      "lastCommittedPoint": null,
      "startBinding": null,
      "endBinding": null,
      "startArrowhead": null,
      "endArrowhead": "arrow"
    },
    {
      "id": "arr-svc-sq-lbl",
      "type": "text",
      "x": 490,
      "y": 1704,
      "width": 96.08000000000001,
      "height": 25.05,
      "angle": 0,
      "strokeColor": "#e67700",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": null,
      "seed": 1086,
      "version": 1,
      "versionNonce": 1087,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false,
      "text": "SQLite (始终写入)",
      "fontSize": 11,
      "fontFamily": 1,
      "textAlign": "left",
      "verticalAlign": "top",
      "containerId": null,
      "originalText": "SQLite (始终写入)",
      "lineHeight": 1.55,
      "baseline": 11
    },
    {
      "id": "arr-svc-ch-lbl",
      "type": "text",
      "x": 1220,
      "y": 1704,
      "width": 231.60000000000002,
      "height": 25.05,
      "angle": 0,
      "strokeColor": "#e67700",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": null,
      "seed": 1088,
      "version": 1,
      "versionNonce": 1089,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false,
      "text": "ClickHouse (CH_WRITE_ENABLED=1, 可选)",
      "fontSize": 11,
      "fontFamily": 1,
      "textAlign": "left",
      "verticalAlign": "top",
      "containerId": null,
      "originalText": "ClickHouse (CH_WRITE_ENABLED=1, 可选)",
      "lineHeight": 1.55,
      "baseline": 11
    },
    {
      "id": "st-layer",
      "type": "rectangle",
      "x": 40,
      "y": 1720,
      "width": 1760,
      "height": 480,
      "angle": 0,
      "strokeColor": "#f59f00",
      "backgroundColor": "#fff9db",
      "fillStyle": "solid",
      "strokeWidth": 3,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": {
        "type": 3
      },
      "seed": 1090,
      "version": 1,
      "versionNonce": 1091,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false
    },
    {
      "id": "st-title",
      "type": "text",
      "x": 60,
      "y": 1728,
      "width": 196.88000000000002,
      "height": 34.35,
      "angle": 0,
      "strokeColor": "#e67700",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": null,
      "seed": 1092,
      "version": 1,
      "versionNonce": 1093,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false,
      "text": "💾  数据存储层 (Storage)",
      "fontSize": 17,
      "fontFamily": 1,
      "textAlign": "left",
      "verticalAlign": "top",
      "containerId": null,
      "originalText": "💾  数据存储层 (Storage)",
      "lineHeight": 1.55,
      "baseline": 17
    },
    {
      "id": "st-sq-r",
      "type": "rectangle",
      "x": 70,
      "y": 1762,
      "width": 840,
      "height": 415,
      "angle": 0,
      "strokeColor": "#fcc419",
      "backgroundColor": "#fff3bf",
      "fillStyle": "solid",
      "strokeWidth": 2,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": {
        "type": 3
      },
      "seed": 1094,
      "version": 1,
      "versionNonce": 1095,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false
    },
    {
      "id": "st-sq-t",
      "type": "text",
      "x": 90,
      "y": 1772,
      "width": 331.84000000000003,
      "height": 305.6,
      "angle": 0,
      "strokeColor": "#7d5807",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": null,
      "seed": 1096,
      "version": 1,
      "versionNonce": 1097,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false,
      "text": "SQLite Database  (WAL Mode)  [始终启用]\n\n统计表  (按 backend_id 分区):\n  domain_stats    ip_stats         proxy_stats\n  rule_stats      country_stats    device_stats\n  minute_stats    hourly_stats     daily_stats\n\n配置 / 缓存表:\n  backend_configs   geoip_cache   asn_cache\n  auth_config       retention_config\n  surge_policy_cache\n\nRepository 模式 (12 个 Repo 类):\n  domain · ip · rule · proxy · device\n  country · timeseries · config · backend\n  auth · surge · trafficWriter",
      "fontSize": 12,
      "fontFamily": 1,
      "textAlign": "left",
      "verticalAlign": "top",
      "containerId": null,
      "originalText": "SQLite Database  (WAL Mode)  [始终启用]\n\n统计表  (按 backend_id 分区):\n  domain_stats    ip_stats         proxy_stats\n  rule_stats      country_stats    device_stats\n  minute_stats    hourly_stats     daily_stats\n\n配置 / 缓存表:\n  backend_configs   geoip_cache   asn_cache\n  auth_config       retention_config\n  surge_policy_cache\n\nRepository 模式 (12 个 Repo 类):\n  domain · ip · rule · proxy · device\n  country · timeseries · config · backend\n  auth · surge · trafficWriter",
      "lineHeight": 1.55,
      "baseline": 12
    },
    {
      "id": "st-ch-r",
      "type": "rectangle",
      "x": 930,
      "y": 1762,
      "width": 835,
      "height": 415,
      "angle": 0,
      "strokeColor": "#fcc419",
      "backgroundColor": "#fff3bf",
      "fillStyle": "solid",
      "strokeWidth": 2,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": {
        "type": 3
      },
      "seed": 1098,
      "version": 1,
      "versionNonce": 1099,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false
    },
    {
      "id": "st-ch-t",
      "type": "text",
      "x": 950,
      "y": 1772,
      "width": 264.64,
      "height": 305.6,
      "angle": 0,
      "strokeColor": "#7d5807",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": null,
      "seed": 1100,
      "version": 1,
      "versionNonce": 1101,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false,
      "text": "ClickHouse  [可选, CH_ENABLED=1]\n\nBuffer 表 (异步接收, ~5min 合并):\n  traffic_detail_buffer\n  traffic_agg_buffer\n  country_buffer\n         ↓  merge  (SummingMergeTree)\n主数据表:\n  traffic_detail   (连接详情)\n  traffic_agg      (聚合统计)\n  country_stats    (国家统计)\n\n读取路由 (STATS_QUERY_SOURCE):\n  sqlite     → 全部读 SQLite  (默认)\n  clickhouse → 全部读 ClickHouse\n  auto       → 智能路由",
      "fontSize": 12,
      "fontFamily": 1,
      "textAlign": "left",
      "verticalAlign": "top",
      "containerId": null,
      "originalText": "ClickHouse  [可选, CH_ENABLED=1]\n\nBuffer 表 (异步接收, ~5min 合并):\n  traffic_detail_buffer\n  traffic_agg_buffer\n  country_buffer\n         ↓  merge  (SummingMergeTree)\n主数据表:\n  traffic_detail   (连接详情)\n  traffic_agg      (聚合统计)\n  country_stats    (国家统计)\n\n读取路由 (STATS_QUERY_SOURCE):\n  sqlite     → 全部读 SQLite  (默认)\n  clickhouse → 全部读 ClickHouse\n  auto       → 智能路由",
      "lineHeight": 1.55,
      "baseline": 12
    },
    {
      "id": "arr-ds-svc",
      "type": "arrow",
      "x": 100,
      "y": 2220,
      "width": 0,
      "height": 520,
      "angle": 0,
      "strokeColor": "#9c36b5",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 2,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": {
        "type": 2
      },
      "seed": 1102,
      "version": 1,
      "versionNonce": 1103,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false,
      "points": [
        [
          0,
          0
        ],
        [
          0,
          -520
        ]
      ],
      "lastCommittedPoint": null,
      "startBinding": null,
      "endBinding": null,
      "startArrowhead": null,
      "endArrowhead": "arrow"
    },
    {
      "id": "arr-ds-lbl",
      "type": "text",
      "x": 112,
      "y": 2100,
      "width": 83.76,
      "height": 59.15,
      "angle": 0,
      "strokeColor": "#9c36b5",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": null,
      "seed": 1104,
      "version": 1,
      "versionNonce": 1105,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false,
      "text": "数据采集\nWebSocket\n/ HTTP Poll",
      "fontSize": 11,
      "fontFamily": 1,
      "textAlign": "left",
      "verticalAlign": "top",
      "containerId": null,
      "originalText": "数据采集\nWebSocket\n/ HTTP Poll",
      "lineHeight": 1.55,
      "baseline": 11
    },
    {
      "id": "ds-layer",
      "type": "rectangle",
      "x": 40,
      "y": 2220,
      "width": 1760,
      "height": 360,
      "angle": 0,
      "strokeColor": "#9c36b5",
      "backgroundColor": "#f3d9fa",
      "fillStyle": "solid",
      "strokeWidth": 3,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": {
        "type": 3
      },
      "seed": 1106,
      "version": 1,
      "versionNonce": 1107,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false
    },
    {
      "id": "ds-title",
      "type": "text",
      "x": 60,
      "y": 2228,
      "width": 339.68,
      "height": 34.35,
      "angle": 0,
      "strokeColor": "#862e9c",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": null,
      "seed": 1108,
      "version": 1,
      "versionNonce": 1109,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false,
      "text": "📡  数据源层 (Data Sources / Gateways)",
      "fontSize": 17,
      "fontFamily": 1,
      "textAlign": "left",
      "verticalAlign": "top",
      "containerId": null,
      "originalText": "📡  数据源层 (Data Sources / Gateways)",
      "lineHeight": 1.55,
      "baseline": 17
    },
    {
      "id": "ds-clash-r",
      "type": "rectangle",
      "x": 70,
      "y": 2262,
      "width": 840,
      "height": 295,
      "angle": 0,
      "strokeColor": "#cc5de8",
      "backgroundColor": "#eedefa",
      "fillStyle": "solid",
      "strokeWidth": 2,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": {
        "type": 3
      },
      "seed": 1110,
      "version": 1,
      "versionNonce": 1111,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false
    },
    {
      "id": "ds-clash-t",
      "type": "text",
      "x": 90,
      "y": 2272,
      "width": 284.8,
      "height": 268.40000000000003,
      "angle": 0,
      "strokeColor": "#862e9c",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": null,
      "seed": 1112,
      "version": 1,
      "versionNonce": 1113,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false,
      "text": "Clash / Mihomo Gateway\n\nWebSocket 端点:\n  WS /connections  (实时推送, 每连接更新)\n  WS /traffic\n  HTTP /rules  /proxies\n\n连接数据格式:\n  { connections: [{\n    id: \"uuid\",\n    metadata: {\n      host, destinationIP, sourceIP,\n      chains: [...],  rule, rulePayload,\n      upload, download  }}]}",
      "fontSize": 12,
      "fontFamily": 1,
      "textAlign": "left",
      "verticalAlign": "top",
      "containerId": null,
      "originalText": "Clash / Mihomo Gateway\n\nWebSocket 端点:\n  WS /connections  (实时推送, 每连接更新)\n  WS /traffic\n  HTTP /rules  /proxies\n\n连接数据格式:\n  { connections: [{\n    id: \"uuid\",\n    metadata: {\n      host, destinationIP, sourceIP,\n      chains: [...],  rule, rulePayload,\n      upload, download  }}]}",
      "lineHeight": 1.55,
      "baseline": 12
    },
    {
      "id": "ds-surge-r",
      "type": "rectangle",
      "x": 930,
      "y": 2262,
      "width": 835,
      "height": 295,
      "angle": 0,
      "strokeColor": "#cc5de8",
      "backgroundColor": "#eedefa",
      "fillStyle": "solid",
      "strokeWidth": 2,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": {
        "type": 3
      },
      "seed": 1114,
      "version": 1,
      "versionNonce": 1115,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false
    },
    {
      "id": "ds-surge-t",
      "type": "text",
      "x": 950,
      "y": 2272,
      "width": 284.8,
      "height": 249.8,
      "angle": 0,
      "strokeColor": "#862e9c",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": null,
      "seed": 1116,
      "version": 1,
      "versionNonce": 1117,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false,
      "text": "Surge Gateway (v5+)\n\nHTTP REST API 端点:\n  GET /v1/requests/recent  (最近连接, 2s 轮询)\n  GET /v1/policies         (策略列表)\n  GET /v1/policy_groups/select  (策略组)\n\n开启方式:\n  http-api = 127.0.0.1:9091\n  http-api-tls = false\n\n注意: DNS 在代理服务器解析\n      无法获取真实落地 IP",
      "fontSize": 12,
      "fontFamily": 1,
      "textAlign": "left",
      "verticalAlign": "top",
      "containerId": null,
      "originalText": "Surge Gateway (v5+)\n\nHTTP REST API 端点:\n  GET /v1/requests/recent  (最近连接, 2s 轮询)\n  GET /v1/policies         (策略列表)\n  GET /v1/policy_groups/select  (策略组)\n\n开启方式:\n  http-api = 127.0.0.1:9091\n  http-api-tls = false\n\n注意: DNS 在代理服务器解析\n      无法获取真实落地 IP",
      "lineHeight": 1.55,
      "baseline": 12
    },
    {
      "id": "ag-section-title",
      "type": "text",
      "x": 40,
      "y": 2622,
      "width": 813.44,
      "height": 32.8,
      "angle": 0,
      "strokeColor": "#495057",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": null,
      "seed": 1118,
      "version": 1,
      "versionNonce": 1119,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false,
      "text": "── Agent 模式架构 (远程数据采集) ──────────────────────────────────────────────────────────────────",
      "fontSize": 16,
      "fontFamily": 1,
      "textAlign": "left",
      "verticalAlign": "top",
      "containerId": null,
      "originalText": "── Agent 模式架构 (远程数据采集) ──────────────────────────────────────────────────────────────────",
      "lineHeight": 1.55,
      "baseline": 16
    },
    {
      "id": "ag-panel-r",
      "type": "rectangle",
      "x": 600,
      "y": 2660,
      "width": 700,
      "height": 380,
      "angle": 0,
      "strokeColor": "#1971c2",
      "backgroundColor": "#e7f5ff",
      "fillStyle": "solid",
      "strokeWidth": 2,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": {
        "type": 3
      },
      "seed": 1120,
      "version": 1,
      "versionNonce": 1121,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false
    },
    {
      "id": "ag-panel-t",
      "type": "text",
      "x": 620,
      "y": 2670,
      "width": 217.60000000000002,
      "height": 268.40000000000003,
      "angle": 0,
      "strokeColor": "#1864ab",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": null,
      "seed": 1122,
      "version": 1,
      "versionNonce": 1123,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false,
      "text": "中心面板 (Neko Master)\n\nFastify API Server:\n  POST /api/agent/report\n       接收批量流量增量\n  POST /api/agent/heartbeat\n       接收心跳 (在线状态)\n  POST /api/agent/config-sync\n       规则/代理/Provider 配置\n  POST /api/agent/policy-state\n       当前策略状态\n\nBackend 类型: agent://\n系统生成 token, 绑定 agentId",
      "fontSize": 12,
      "fontFamily": 1,
      "textAlign": "left",
      "verticalAlign": "top",
      "containerId": null,
      "originalText": "中心面板 (Neko Master)\n\nFastify API Server:\n  POST /api/agent/report\n       接收批量流量增量\n  POST /api/agent/heartbeat\n       接收心跳 (在线状态)\n  POST /api/agent/config-sync\n       规则/代理/Provider 配置\n  POST /api/agent/policy-state\n       当前策略状态\n\nBackend 类型: agent://\n系统生成 token, 绑定 agentId",
      "lineHeight": 1.55,
      "baseline": 12
    },
    {
      "id": "ag-arr-up",
      "type": "arrow",
      "x": 950,
      "y": 3110,
      "width": 0,
      "height": 70,
      "angle": 0,
      "strokeColor": "#868e96",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 2,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": {
        "type": 2
      },
      "seed": 1124,
      "version": 1,
      "versionNonce": 1125,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false,
      "points": [
        [
          0,
          0
        ],
        [
          0,
          -70
        ]
      ],
      "lastCommittedPoint": null,
      "startBinding": null,
      "endBinding": null,
      "startArrowhead": null,
      "endArrowhead": "arrow"
    },
    {
      "id": "ag-arr-lbl",
      "type": "text",
      "x": 960,
      "y": 3060,
      "width": 114.56,
      "height": 25.05,
      "angle": 0,
      "strokeColor": "#868e96",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": null,
      "seed": 1126,
      "version": 1,
      "versionNonce": 1127,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false,
      "text": "HTTP  (token 鉴权)",
      "fontSize": 11,
      "fontFamily": 1,
      "textAlign": "left",
      "verticalAlign": "top",
      "containerId": null,
      "originalText": "HTTP  (token 鉴权)",
      "lineHeight": 1.55,
      "baseline": 11
    },
    {
      "id": "ag-host-r",
      "type": "rectangle",
      "x": 300,
      "y": 3110,
      "width": 1300,
      "height": 500,
      "angle": 0,
      "strokeColor": "#2f9e44",
      "backgroundColor": "#ebfbee",
      "fillStyle": "solid",
      "strokeWidth": 2,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": {
        "type": 3
      },
      "seed": 1128,
      "version": 1,
      "versionNonce": 1129,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false
    },
    {
      "id": "ag-host-t",
      "type": "text",
      "x": 320,
      "y": 3120,
      "width": 399.04,
      "height": 361.40000000000003,
      "angle": 0,
      "strokeColor": "#1b5e20",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": null,
      "seed": 1130,
      "version": 1,
      "versionNonce": 1131,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false,
      "text": "网关旁边的主机 (Remote Host)\n\nnekoagent  (CLI 管理器, Shell 脚本)\n  /etc/neko-agent/<instance>.env     配置文件\n  /var/run/neko-agent/<instance>.pid  PID 文件\n\nneko-agent  (守护进程, Go)\n  1. 拉取网关数据\n       Clash/Mihomo: WS /connections (实时推送)\n       Surge:        HTTP GET /v1/requests/recent (2s 轮询)\n  2. 增量计算 (Delta)\n       识别新/更新连接 → 计算 upload/download 增量 → 聚合\n  3. 批量上报 (每 2s)  POST /api/agent/report\n       最多 1000 条/批, 积压上限 50000 条\n  4. 心跳 (每 30s)  POST /api/agent/heartbeat\n  5. 配置同步 (每 2min, MD5 去重)  POST /api/agent/config-sync\n  6. 策略同步 (每 30s, 变化时)  POST /api/agent/policy-state\n\nPID 锁: 同一 backendId 同时只允许一个进程运行",
      "fontSize": 12,
      "fontFamily": 1,
      "textAlign": "left",
      "verticalAlign": "top",
      "containerId": null,
      "originalText": "网关旁边的主机 (Remote Host)\n\nnekoagent  (CLI 管理器, Shell 脚本)\n  /etc/neko-agent/<instance>.env     配置文件\n  /var/run/neko-agent/<instance>.pid  PID 文件\n\nneko-agent  (守护进程, Go)\n  1. 拉取网关数据\n       Clash/Mihomo: WS /connections (实时推送)\n       Surge:        HTTP GET /v1/requests/recent (2s 轮询)\n  2. 增量计算 (Delta)\n       识别新/更新连接 → 计算 upload/download 增量 → 聚合\n  3. 批量上报 (每 2s)  POST /api/agent/report\n       最多 1000 条/批, 积压上限 50000 条\n  4. 心跳 (每 30s)  POST /api/agent/heartbeat\n  5. 配置同步 (每 2min, MD5 去重)  POST /api/agent/config-sync\n  6. 策略同步 (每 30s, 变化时)  POST /api/agent/policy-state\n\nPID 锁: 同一 backendId 同时只允许一个进程运行",
      "lineHeight": 1.55,
      "baseline": 12
    },
    {
      "id": "ag-arr-gw",
      "type": "arrow",
      "x": 950,
      "y": 3680,
      "width": 0,
      "height": 70,
      "angle": 0,
      "strokeColor": "#868e96",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 2,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": {
        "type": 2
      },
      "seed": 1132,
      "version": 1,
      "versionNonce": 1133,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false,
      "points": [
        [
          0,
          0
        ],
        [
          0,
          -70
        ]
      ],
      "lastCommittedPoint": null,
      "startBinding": null,
      "endBinding": null,
      "startArrowhead": null,
      "endArrowhead": "arrow"
    },
    {
      "id": "ag-gw-lbl",
      "type": "text",
      "x": 960,
      "y": 3620,
      "width": 77.60000000000001,
      "height": 25.05,
      "angle": 0,
      "strokeColor": "#868e96",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": null,
      "seed": 1134,
      "version": 1,
      "versionNonce": 1135,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false,
      "text": "本地网络 (LAN)",
      "fontSize": 11,
      "fontFamily": 1,
      "textAlign": "left",
      "verticalAlign": "top",
      "containerId": null,
      "originalText": "本地网络 (LAN)",
      "lineHeight": 1.55,
      "baseline": 11
    },
    {
      "id": "ag-gw-r",
      "type": "rectangle",
      "x": 600,
      "y": 3680,
      "width": 700,
      "height": 100,
      "angle": 0,
      "strokeColor": "#9c36b5",
      "backgroundColor": "#f3d9fa",
      "fillStyle": "solid",
      "strokeWidth": 2,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": {
        "type": 3
      },
      "seed": 1136,
      "version": 1,
      "versionNonce": 1137,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false
    },
    {
      "id": "ag-gw-t",
      "type": "text",
      "x": 620,
      "y": 3700,
      "width": 290.40000000000003,
      "height": 29.7,
      "angle": 0,
      "strokeColor": "#862e9c",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": null,
      "seed": 1138,
      "version": 1,
      "versionNonce": 1139,
      "isDeleted": false,
      "boundElements": [],
      "updated": 1771730359905,
      "link": null,
      "locked": false,
      "text": "Clash/Mihomo  或  Surge  Gateway API",
      "fontSize": 14,
      "fontFamily": 1,
      "textAlign": "left",
      "verticalAlign": "top",
      "containerId": null,
      "originalText": "Clash/Mihomo  或  Surge  Gateway API",
      "lineHeight": 1.55,
      "baseline": 14
    }
  ],
  "appState": {
    "gridSize": null,
    "viewBackgroundColor": "#f8f9fa"
  },
  "files": {}
}