diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 45861aede..96293f768 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -90,6 +90,7 @@ Run the smallest focused test while iterating, then the relevant suite before op # Frontend suite, translation guard, type/build verification pnpm --dir frontend exec vitest run pnpm --dir frontend run check:i18n +pnpm --dir frontend run check:ui pnpm --dir frontend run build # Whitespace and conflict-marker check @@ -202,3 +203,11 @@ Use a `codex/`-prefixed branch when changes are made through Codex unless a main For ordinary bugs, open an issue with reproduction steps, expected and actual behavior, version information, and sanitized logs. Remove tokens, cookies, account identifiers, positions, and other private financial data. For a security-sensitive issue, do not publish exploit details or credentials in a public issue. Follow the private reporting instructions in [SECURITY.md](SECURITY.md). + +## Shared UI conventions + +Read the [UI guide](frontend/UI_GUIDELINES.md) ([简体中文](frontend/UI_GUIDELINES.zh-CN.md)) before changing controls or scrolling panels. Run `pnpm --dir frontend check:ui` to catch native selects, browser dialogs, and unstyled scroll regions; verify desktop/mobile and light/dark rendering as well. + +## Exchange calendar coverage + +Published annual closures and half-days live in `src/platform/scheduling/exchange_calendar_data.py` (currently 2026). Runtime warmup materializes only the previous 30 and upcoming 90 days without fetching historical calendars. Unpublished weekdays are unknown and cannot authorize automatic execution. Update the bundled annual data from exchange publications before the next year; preserve market-local dates, daylight-saving offsets, and half-day regression coverage. Configured Agent Cron/interval cycles remain unchanged; execution and preview share calendar gates. diff --git a/CONTRIBUTING.zh-CN.md b/CONTRIBUTING.zh-CN.md index 98dc7bc3b..ca04748a6 100644 --- a/CONTRIBUTING.zh-CN.md +++ b/CONTRIBUTING.zh-CN.md @@ -90,6 +90,7 @@ make install-hooks # 前端测试、多语言门禁、类型检查与生产构建 pnpm --dir frontend exec vitest run pnpm --dir frontend run check:i18n +pnpm --dir frontend run check:ui pnpm --dir frontend run build # 空白符和冲突标记检查 @@ -202,3 +203,11 @@ PR 标题和正文统一使用英文,标题同样采用 Conventional Commits 普通 Bug 请提交 Issue,包含复现步骤、预期/实际行为、版本信息和脱敏日志。务必移除 Token、Cookie、账户标识、持仓等金融隐私数据。 安全敏感问题不要在公开 Issue 中发布利用细节或凭据;请遵循 [SECURITY.md](SECURITY.md) 中的私密报告方式。 + +## 统一 UI 约定 + +修改控件或滚动面板前阅读 [UI 规范](frontend/UI_GUIDELINES.zh-CN.md)([English](frontend/UI_GUIDELINES.md))。运行 `pnpm --dir frontend check:ui` 拦截原生选择框、浏览器弹窗和漏用样式的滚动区域,并验证桌面 / 手机、亮色 / 深色效果。 + +## 交易日历覆盖 + +公布的年度休市日和半日市保存在 `src/platform/scheduling/exchange_calendar_data.py`(目前为 2026 年)。运行时只预热过去 30 天和未来 90 天,不请求历史日历。未公布年份的工作日标记未知,不能授权自动执行。跨年前应根据交易所公告补充下一年度数据,并验证市场当地日期、夏令时和半日市。已配置的 Agent Cron / 间隔保持不变,执行与预览共用交易日门禁。 diff --git a/README.md b/README.md index 5089f4f71..67f5eea60 100644 --- a/README.md +++ b/README.md @@ -2,13 +2,9 @@ [English](README.md) | [简体中文](README.zh-CN.md) -**Turn your watchlist and portfolio into an always-on AI research desk.** PanWatch combines real-time monitoring, portfolio management, automated analysis, and multi-channel alerts for China A-shares, Hong Kong, and U.S. markets—all on infrastructure you control. +Monitor A-shares, Hong Kong, and U.S. stocks, manage your portfolios, and research ideas with [TradingAgents](https://github.com/TauricResearch/TradingAgents). Self-host PanWatch with your preferred OpenAI-compatible provider or local models through Ollama. -Powered by [TradingAgents](https://github.com/TauricResearch/TradingAgents) for multi-agent investment research, including specialist analysis, bull/bear debate, risk review, and a portfolio-manager decision. - -> 🌐 Available in English and Simplified Chinese. On first visit, PanWatch follows the browser language; a manual selection is remembered. - -[Quick start](#quick-start) · [Feature overview](#-feature-overview) · [Core features](#core-features) · [Development](#local-development) · [Support](#support-the-project) · [Contributing](#contributing) +[Quick start](#quick-start) · [Core features](#core-features) · [Feature overview](#-feature-overview) · [Reference](#reference) · [Support](#support-the-project) · [Contributing](#contributing) [![GitHub stars](https://img.shields.io/github/stars/TNT-Likely/PanWatch?style=flat&logo=github&color=yellow)](https://github.com/TNT-Likely/PanWatch/stargazers) [![Docker Pulls](https://img.shields.io/docker/pulls/sunxiao0721/panwatch?logo=docker&label=docker%20pulls&color=2496ED)](https://hub.docker.com/r/sunxiao0721/panwatch) @@ -30,12 +26,74 @@ Powered by [TradingAgents](https://github.com/TauricResearch/TradingAgents) for > 🧠 **Start from a portfolio holding → let a nine-agent TradingAgents research team analyze it → follow the bull/bear debate and risk review → receive a PM decision memo and the complete reasoning trail in your messaging app within 3–5 minutes.** -## Why PanWatch? +## Core Features + +| Capability | What you can do | +|---|---| +| **Portfolio** | Manage multiple brokerage accounts, track holdings and P&L, and set trading styles. | +| **AI research** | Follow technical, sentiment, news, and fundamentals analysis through debate, risk review, and a portfolio-manager decision. | +| **Scheduled agents** | Run pre-market, intraday, and closing workflows on eligible exchange trading days using your configured schedules. | +| **Price alerts** | Combine conditions with AND/OR logic and configure cooldowns, daily limits, expiration, and notification channels. | +| **Opportunities** | Review ranked candidates with entry levels, targets, and risk context. | +| **Paper trading** | Simulate signal-based entries and exits, then track equity and performance. | +| **Notifications** | Deliver reports and alerts through Telegram, WeCom, DingTalk, Feishu, Bark, or webhooks. | +| **Mobile** | Install the PWA on your home screen and use the same workspace on your phone. | + +## Quick Start + +```bash +docker run -d \ + --name panwatch \ + --restart unless-stopped \ + -p 8000:8000 \ + -v panwatch_data:/app/data \ + sunxiao0721/panwatch:latest +``` + +Open `http://localhost:8000` and create your login credentials. + +
+Initial setup + +1. Open the web interface and create your login credentials. +2. Go to **Settings → AI Services** and configure an OpenAI-compatible API, such as OpenAI, Zhipu AI, DeepSeek, or Ollama. +3. Go to **Settings → Notification Channels** and add Telegram or another delivery channel. +4. Go to **Portfolio → Add Stock**, add a symbol to your watchlist, and enable the relevant agents. + +
+ +
+Docker Compose + +```yaml +services: + panwatch: + image: sunxiao0721/panwatch:latest + container_name: panwatch + ports: + - "8000:8000" + volumes: + - panwatch_data:/app/data + restart: unless-stopped + +volumes: + panwatch_data: +``` -- **Private by design** — self-host it so portfolio data remains under your control. -- **Action-oriented AI** — turn market data, news, technical signals, and portfolio context into concrete watch items instead of another indicator dashboard. -- **Always on** — schedule pre-market, intraday, and closing agents, then deliver results through Telegram, WeCom, DingTalk, Feishu, Bark, or webhooks. -- **Multi-market and model-agnostic** — monitor China A-shares, Hong Kong, and U.S. stocks with OpenAI-compatible providers, including local models through Ollama. +```bash +docker compose up -d +``` + +
+ +
+First startup and browser installation + +The image includes Playwright's system dependencies. Chromium's headless shell for screenshots is downloaded on first startup into the mounted volume (default `/app/data/playwright`), which requires network access and can take a few minutes. + +If you do not need browser features such as screenshots, set `PLAYWRIGHT_SKIP_BROWSER_INSTALL=1` to skip this installation. + +
## 📸 Feature Overview @@ -60,26 +118,33 @@ The screenshots below use the English interface; Simplified Chinese is available > 💡 If PanWatch is useful to you, please consider giving the project a ⭐ **Star**. It is the best way to support the project and help more people discover it. -## 🧠 Deep Analysis with TradingAgents +## Reference -PanWatch integrates [TradingAgents](https://github.com/TauricResearch/TradingAgents), the multi-agent investment decision framework with more than 76k stars. Select the 🧠 icon next to a portfolio holding to start an analysis: +
+Scheduled agents and deep analysis -- **Four analyst roles** — technical, sentiment, news, and fundamentals — followed by a **bull/bear debate**, **risk review**, and **portfolio-manager decision**. -- A complete reasoning trail is generated in 3–5 minutes and can be delivered to Telegram, WeCom, or DingTalk. -- The default model is `deepseek-chat`; a typical run costs about USD 0.05, keeping monthly spending predictable. -- [View the TradingAgents deep-analysis flowchart](docs/tradingagents-flow.en.md) -- [Read the backend architecture guide](src/ARCHITECTURE.en.md) +| Agent | Purpose | +|---|---| +| **Pre-market outlook** | Combine overnight moves, news, and technical structure into a plan. | +| **Intraday monitor** | Watch unusual moves and technical signals during open sessions. | +| **Daily report** | Review the session and prepare the next trading day's plan. | -## Core Features +Schedules are configurable. Automatic runs filter exchange holidays before collection and analysis; intraday workflows also require an open trading session. + +Select the brain icon beside a holding to start TradingAgents deep analysis. Four analyst roles feed a bull/bear debate, risk review, and portfolio-manager decision, with the reasoning trail available in the app and through configured notification channels. Runtime and cost depend on the selected models and configuration. + +[Deep-analysis flowchart](docs/tradingagents-flow.en.md) · [Backend architecture](src/ARCHITECTURE.en.md) + +
-Intelligent agent system +Market calendars and scheduling -| Agent | Trigger | Purpose | -|-------|---------|---------| -| **Pre-market outlook** | Before each market session | Combines overnight U.S. market moves, news, and technical structure into an action plan for the day. | -| **Intraday monitor** | During trading hours | Watches unusual moves and sends alerts when indicators such as RSI, KDJ, and MACD align. | -| **Daily report** | After market close | Reviews the session, analyzes capital flows, and prepares a plan for the next trading day. | +- Select the market status strip to compare all three exchanges across the next 14 dates. Opening/session times use your browser timezone; trade dates and status use each exchange's local date. +- A non-trading day shows closed; a completed trading day shows market closed. Beijing Saturday morning may still be New York Friday after close. +- Published 2026 closures and half-days are bundled locally. Startup warms only the previous 30 and next 90 days, without downloading full history. Unpublished weekdays show a pending calendar and block automatic execution; the bundled annual data must be updated for the next year. +- Agent Cron/interval settings remain unchanged; execution and schedule previews share calendar filters. Price alerts in “all day” mode still require a trading day. +- Paper fills require an open session for that stock's market. Paper notifications follow each exchange's local clock, including half-days and U.S. daylight-saving changes.
@@ -94,73 +159,16 @@ PanWatch integrates [TradingAgents](https://github.com/TauricResearch/TradingAge -
-Multiple markets and accounts - -- **Markets:** real-time quotes for China A-shares, Hong Kong stocks, and U.S. stocks. -- **Account management:** manage brokerage accounts independently while viewing consolidated total assets. -- **Trading styles:** set short-term, swing, or long-term preferences for more relevant AI suggestions. - -
- -
-Multi-channel notifications - -Telegram / WeCom / DingTalk / Feishu / Bark / custom webhooks - -
-
Price alerts - Combine price, percentage change, turnover, volume ratio, and other conditions with AND/OR logic. -- Limit rules to market hours or keep them active all day; configure cooldowns, daily trigger limits, and repeat behavior. +- Limit rules to market hours or keep them active all day on trading days; configure cooldowns, daily trigger limits, and repeat behavior. - Set an expiration date and `HH:mm` time in the rule dialog, or leave it empty so the rule never expires. - Choose notification channels per rule, or use the system default when none is selected.
-## Quick Start - -```bash -docker run -d \ - --name panwatch \ - --restart unless-stopped \ - -p 8000:8000 \ - -v panwatch_data:/app/data \ - sunxiao0721/panwatch:latest -``` - -Open `http://localhost:8000`, create your username and password, and connect an OpenAI-compatible provider. PanWatch selects English or Simplified Chinese from the browser language on first visit. - -The image includes the system dependencies required by Playwright. Chromium's headless shell, used for screenshots, is downloaded and installed into the mounted volume (by default `/app/data/playwright`) on the first container startup. This can take a few minutes and requires network access. - -If you do not need browser-based features such as screenshots, set `PLAYWRIGHT_SKIP_BROWSER_INSTALL=1` when starting the container to skip the initial Chromium installation. - -
-Docker Compose - -```yaml -services: - panwatch: - image: sunxiao0721/panwatch:latest - container_name: panwatch - ports: - - "8000:8000" - volumes: - - panwatch_data:/app/data - restart: unless-stopped - -volumes: - panwatch_data: -``` - -```bash -docker compose up -d -``` - -
-
Environment variables @@ -170,7 +178,7 @@ docker compose up -d | `AUTH_PASSWORD` | Preconfigured login password | Set on first visit | | `JWT_SECRET` | Secret used to sign JWTs | Generated automatically | | `DATA_DIR` | Data storage directory | `./data` | -| `TZ` | Application timezone used for agent schedules and displayed times | `Asia/Shanghai` | +| `TZ` | Application timezone for Agent schedules; market-calendar times follow the browser timezone | `Asia/Shanghai` | | `PLAYWRIGHT_SKIP_BROWSER_INSTALL` | Skip the initial Chromium installation when browser features are not required | Not set | | `LOG_LEVEL` | Console log level. `INFO` prints business events and errors; use `DEBUG` for scheduler heartbeats, collection steps, and other diagnostics. The UI log panel always retains the complete log. | `INFO` | | `HTTP_PROXY` / `HTTPS_PROXY` / `http_proxy` | Outbound HTTP proxy. Configure it through an external environment variable, `http_proxy=http://host:port` in `.env`, or **Settings → Global HTTP Proxy**. Priority: external environment variables > UI > `.env`. `NO_PROXY` includes `localhost,127.0.0.1` by default. | Not set | @@ -178,16 +186,6 @@ docker compose up -d
-
-Initial setup - -1. Open the web interface and create your login credentials. -2. Go to **Settings → AI Services** and configure an OpenAI-compatible API, such as OpenAI, Zhipu AI, DeepSeek, or Ollama. -3. Go to **Settings → Notification Channels** and add Telegram or another delivery channel. -4. Go to **Portfolio → Add Stock**, add a symbol to your watchlist, and enable the relevant agents. - -
-
Local development @@ -208,7 +206,8 @@ cd frontend && pnpm install && pnpm dev # Frontend on :5183 The frontend development server runs at `http://localhost:5183` and proxies `/api` to `127.0.0.1:8000`. -Port `5183` is used instead of Vite's default `5173` to avoid conflicts with other locally running projects such as BeeCount-Cloud. + +[Frontend UI conventions and checks](frontend/UI_GUIDELINES.md)
@@ -279,6 +278,12 @@ Configure these repository secrets before publishing: ## Support the Project +### Sponsorship + +For sponsorship or partnership inquiries, contact [sunxiaoyes@outlook.com](mailto:sunxiaoyes@outlook.com?subject=PanWatch%20sponsorship). + +### Donations + PanWatch is free and open source. If it saves you time or improves your workflow, you can support continued development: [![PayPal](https://img.shields.io/badge/PayPal-Donate-0070BA?logo=paypal&logoColor=white&style=for-the-badge)](https://paypal.me/sunxiaoyes) diff --git a/README.zh-CN.md b/README.zh-CN.md index 8024615d4..657dadd4a 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -2,13 +2,9 @@ [English](README.md) | [简体中文](README.zh-CN.md) -**把自选与持仓变成全天候 AI 投研工作台。** PanWatch 将 A 股 / 港股 / 美股实时监控、持仓管理、智能分析和全渠道推送整合在你自己的基础设施中。 +管理 A 股、港股和美股持仓,监控行情与提醒,并通过 [TradingAgents](https://github.com/TauricResearch/TradingAgents) 进行深度分析。自托管部署,可接入你选择的 OpenAI 兼容服务商或 Ollama 本地模型。 -集成 [TradingAgents](https://github.com/TauricResearch/TradingAgents) 多 Agent 投资决策:专业分析、看多看空辩论、风险审查,最终形成投资组合经理决策。 - -> 🌐 支持简体中文与英文。首次访问会跟随浏览器语言,手动切换后会记住你的选择。 - -[快速开始](#快速开始) · [功能一览](#-功能一览) · [核心功能](#核心功能) · [本地开发](#本地开发) · [捐赠支持](#捐赠支持) · [参与贡献](#贡献) +[快速开始](#快速开始) · [核心功能](#核心功能) · [功能一览](#-功能一览) · [详细说明](#详细说明) · [支持项目](#支持项目) · [参与贡献](#贡献) [![GitHub stars](https://img.shields.io/github/stars/TNT-Likely/PanWatch?style=flat&logo=github&color=yellow)](https://github.com/TNT-Likely/PanWatch/stargazers) [![Docker Pulls](https://img.shields.io/docker/pulls/sunxiao0721/panwatch?logo=docker&label=docker%20pulls&color=2496ED)](https://hub.docker.com/r/sunxiao0721/panwatch) @@ -30,12 +26,74 @@ > 🧠 **持仓页点一下 → TradingAgents 9-Agent 投研团队接力分析 → 看多看空辩论 → 风控审查 → PM 决策书,3-5 分钟一条完整推理链,结论直推到你的 IM。** -## 为什么选择盯盘侠? +## 核心功能 + +| 能力 | 可以做什么 | +|---|---| +| **持仓管理** | 管理多个券商账户,查看持仓和盈亏,设置交易风格。 | +| **AI 投研** | 由技术、情绪、新闻、基本面分析进入看多看空辩论、风控审查和投资组合经理决策。 | +| **定时 Agent** | 按已配置的周期,在对应市场交易日执行盘前、盘中和盘后工作流。 | +| **价格提醒** | 用 AND / OR 组合条件,设置冷却时间、日上限、到期时间和通知渠道。 | +| **机会发现** | 查看排序后的候选及其入场位、目标价和风险信息。 | +| **模拟盘** | 模拟按信号建仓和平仓,查看净值和绩效。 | +| **消息推送** | 通过 Telegram、企业微信、钉钉、飞书、Bark 或 Webhook 接收报告和提醒。 | +| **移动端** | 将 PWA 添加到主屏幕,在手机上使用同一套工作台。 | + +## 快速开始 + +```bash +docker run -d \ + --name panwatch \ + --restart unless-stopped \ + -p 8000:8000 \ + -v panwatch_data:/app/data \ + sunxiao0721/panwatch:latest +``` + +访问 `http://localhost:8000`,创建登录账号。 + +
+首次配置 + +1. 访问 Web 界面,设置登录账号 +2. **设置 → AI 服务商**:配置 OpenAI 兼容 API(支持 OpenAI / 智谱 / DeepSeek / Ollama 等) +3. **设置 → 通知渠道**:添加 Telegram 或其他推送渠道 +4. **持仓 → 添加股票**:添加自选股,启用对应 Agent + +
+ +
+Docker Compose + +```yaml +services: + panwatch: + image: sunxiao0721/panwatch:latest + container_name: panwatch + ports: + - "8000:8000" + volumes: + - panwatch_data:/app/data + restart: unless-stopped + +volumes: + panwatch_data: +``` -- **数据私有** — 自托管部署,持仓数据始终由你掌控 -- **面向行动的 AI** — 将行情、新闻、技术信号和持仓上下文转化为明确关注事项,而不是继续堆砌指标 -- **全天候运行** — 自动执行盘前、盘中和收盘 Agent,并推送至 Telegram、企业微信、钉钉、飞书、Bark 或 Webhook -- **多市场、模型无关** — 覆盖 A 股、港股和美股,兼容 OpenAI API,也可通过 Ollama 使用本地模型 +```bash +docker compose up -d +``` + +
+ +
+首次启动与浏览器安装 + +镜像已包含 Playwright 的系统依赖。用于截图的 Chromium 无头浏览器会在首次启动时下载到挂载卷(默认 `/app/data/playwright`),需要网络可达,可能耗时几分钟。 + +不需要截图等浏览器能力时,可设置 `PLAYWRIGHT_SKIP_BROWSER_INSTALL=1` 跳过安装。 + +
## 📸 功能一览 @@ -58,26 +116,33 @@ > 💡 如果盯盘侠对你有帮助,点右上角 ⭐ **Star** 支持一下 —— 这是对开源项目最好的鼓励,也能让更多人发现它。 -## 🧠 深度分析:TradingAgents 多 Agent 决策 +## 详细说明 -接入 [TradingAgents](https://github.com/TauricResearch/TradingAgents)(76k+ star)多 Agent 投资决策框架,在持仓页点 🧠 图标即可触发: +
+定时 Agent 与深度分析 -- **4 类分析师**(技术 / 情绪 / 新闻 / 基本面) → **看多看空辩论** → **风控审查** → **PM 整合决策** -- 3-5 分钟输出完整推理链,结论同步推送到 Telegram / 微信 / 钉钉 -- 默认 deepseek-chat,单次 ~$0.05,月度预算可控 -- [查看 TradingAgents 深度分析流程图](docs/tradingagents-flow.md) -- [阅读后端架构设计](src/ARCHITECTURE.md) +| Agent | 用途 | +|---|---| +| **盘前分析** | 综合隔夜走势、新闻和技术形态,形成操作计划。 | +| **盘中监测** | 在开市时监控行情异动与技术信号。 | +| **盘后日报** | 复盘当日交易,为下个交易日准备计划。 | -## 核心功能 +执行周期可配置。自动运行在采集和分析前过滤交易所休市日,盘中任务还需满足交易时段。 + +点击持仓旁的脑图标,可启动 TradingAgents 深度分析。四类分析师进入看多看空辩论、风控审查和投资组合经理决策,推理过程可在应用内查看,也可通过配置的通知渠道推送。耗时和费用取决于选择的模型与配置。 + +[深度分析流程图](docs/tradingagents-flow.md) · [后端架构](src/ARCHITECTURE.md) + +
-智能 Agent 系统 +交易日历与执行规则 -| Agent | 触发时机 | 功能 | -|-------|---------|------| -| **盘前分析** | 每日开盘前 | 综合隔夜美股、新闻消息、技术形态,给出今日操作策略 | -| **盘中监测** | 交易时段实时 | 监控异动信号,RSI/KDJ/MACD 共振时推送提醒 | -| **盘后日报** | 每日收盘后 | 复盘当日走势,分析资金流向,规划次日操作 | +- 点击市场状态栏,可对照三个市场未来 14 个日期是否交易。开盘和交易时段换算为浏览器所在时区;交易日期和当前状态按各市场当地日期判断。 +- 非交易日显示休市,当日交易结束后显示已收盘。北京时间周六上午,纽约可能仍是周五收盘后。 +- 应用内置 2026 年公布的休市日与半日市;启动只预热过去 30 天、未来 90 天,不请求全历史日历。未公布年份的工作日显示日历待更新,并暂停自动执行;跨年前需补充下一年度数据。 +- 保留已配置的 Agent Cron / 间隔,执行与时间预览共用交易日过滤。价格提醒的“全天”也只在交易日生效。 +- 模拟盘成交必须处于对应股票市场的交易时段;模拟盘通知按各交易所当地时间调度,兼容半日市与美股夏令时变化。
@@ -92,73 +157,16 @@ -
-多市场 & 多账户 - -- **覆盖市场**:A 股、港股、美股实时行情 -- **账户管理**:支持多券商账户独立管理,汇总展示总资产 -- **交易风格**:按短线/波段/长线分别设置,AI 建议更精准 - -
- -
-全渠道通知 - -Telegram / 企业微信 / 钉钉 / 飞书 / Bark / 自定义 Webhook - -
-
价格提醒 - 支持价格、涨跌幅、成交额、量比等条件组合(AND / OR) -- 支持交易时段/全天生效、冷却时间、日触发上限、重复触发模式 +- 支持仅交易时段 / 交易日全天生效、冷却时间、日触发上限、重复触发模式 - 到期时间使用弹窗内日期面板 + `HH:mm` 输入,留空表示永不过期 - 可按规则选择通知渠道,不选则走系统默认渠道
-## 快速开始 - -```bash -docker run -d \ - --name panwatch \ - --restart unless-stopped \ - -p 8000:8000 \ - -v panwatch_data:/app/data \ - sunxiao0721/panwatch:latest -``` - -访问 `http://localhost:8000`,设置账号密码并连接 OpenAI 兼容服务商即可开始使用。首次访问会根据浏览器语言进入中文或英文界面。 - -说明:镜像内已包含 Playwright 运行所需的系统依赖;用于截图的 Chromium 无头浏览器(headless shell)会在容器首次启动时自动下载并安装到挂载卷(默认 `/app/data/playwright`),首次启动可能需要几分钟且需要网络可达。 - -如果不需要截图等浏览器能力,可以在启动容器时设置 `PLAYWRIGHT_SKIP_BROWSER_INSTALL=1` 跳过首次 Chromium 下载/安装。 - -
-Docker Compose - -```yaml -services: - panwatch: - image: sunxiao0721/panwatch:latest - container_name: panwatch - ports: - - "8000:8000" - volumes: - - panwatch_data:/app/data - restart: unless-stopped - -volumes: - panwatch_data: -``` - -```bash -docker compose up -d -``` - -
-
环境变量 @@ -168,7 +176,7 @@ docker compose up -d | `AUTH_PASSWORD` | 预设登录密码 | 首次访问时设置 | | `JWT_SECRET` | JWT 签名密钥 | 自动生成 | | `DATA_DIR` | 数据存储目录 | `./data` | -| `TZ` | 应用时区(影响 Agent 调度触发时间与时间展示) | `Asia/Shanghai` | +| `TZ` | Agent 调度的应用时区;交易日历时间按浏览器时区展示 | `Asia/Shanghai` | | `PLAYWRIGHT_SKIP_BROWSER_INSTALL` | 跳过首次 Chromium 安装(不需要截图时可用) | 未设置 | | `LOG_LEVEL` | 控制台日志级别。默认 `INFO`(只输出业务事件 + 错误);排查问题时设 `DEBUG` 可看到调度心跳、采集过程等底层日志。UI 日志板始终保留完整记录,不受影响 | `INFO` | | `HTTP_PROXY` / `HTTPS_PROXY` / `http_proxy` | 出站 HTTP 代理。三种配置方式任选其一: ① 启动前 `export HTTP_PROXY=...`;② `.env` 里写 `http_proxy=http://host:port`;③ UI「设置 → 全局 HTTP 代理」。三者优先级:外部环境变量 > UI > `.env`。生效后所有 httpx 客户端走代理。`NO_PROXY` 默认包含 `localhost,127.0.0.1` | 未设置 | @@ -176,16 +184,6 @@ docker compose up -d
-
-首次配置 - -1. 访问 Web 界面,设置登录账号 -2. **设置 → AI 服务商**:配置 OpenAI 兼容 API(支持 OpenAI / 智谱 / DeepSeek / Ollama 等) -3. **设置 → 通知渠道**:添加 Telegram 或其他推送渠道 -4. **持仓 → 添加股票**:添加自选股,启用对应 Agent - -
-
本地开发 @@ -205,7 +203,8 @@ cd frontend && pnpm install && pnpm dev # 前端 :5183 ``` 前端 dev server 跑在 `http://localhost:5183`,并把 `/api` 代理到 `127.0.0.1:8000`。 -前端用 `:5183` 而非默认 `:5173`,是为了和 BeeCount-Cloud 等本地常驻前端错开。 + +[前端 UI 约定与检查](frontend/UI_GUIDELINES.zh-CN.md)
@@ -274,7 +273,13 @@ Langfuse / Tempo 同理,把 `OTEL_EXPORTER_OTLP_ENDPOINT` 指向对应 OTLP 入 -## 捐赠支持 +## 支持项目 + +### 赞助合作 + +欢迎品牌赞助与合作,点击 [sunxiaoyes@outlook.com](mailto:sunxiaoyes@outlook.com?subject=PanWatch%20sponsorship) 联系。 + +### 个人捐赠 PanWatch 完全免费开源。如果它节省了你的时间或改善了工作流,欢迎支持项目持续开发: diff --git a/frontend/UI_GUIDELINES.md b/frontend/UI_GUIDELINES.md new file mode 100644 index 000000000..f96c980ec --- /dev/null +++ b/frontend/UI_GUIDELINES.md @@ -0,0 +1,33 @@ +# Shared UI conventions + +[简体中文](UI_GUIDELINES.zh-CN.md) + +Feature code must reuse the primitives in `packages/base-ui/src/components/ui`. Read this guide before adding or changing interactive UI. + +## Scroll regions + +Add `scrollbar` to every native element using `overflow-auto`, `overflow-x-auto`, `overflow-y-auto`, or a scroll variant. It provides a transparent track and a themed thin thumb in light and dark mode. Use `scrollbar-none` only for intentional horizontal chip navigation; do not hide a long list's only scrolling affordance. Scroll classes on shared components such as `DialogContent` inherit their primitive's style. + +Constrain nested flex scroll regions with `min-h-0`, bound their height to the viewport, and use `overscroll-contain` inside floating panels. Keep table column headers outside the scrolling row group, or provide an opaque sticky header with proper stacking. Verify header/cell alignment after scrolling, long content, and no horizontal clipping at a 390 px viewport. Test both light and dark themes; a light scrollbar track in a dark panel is a defect. + +## Selects + +Use `Select`, `SelectTrigger`, `SelectValue`, `SelectContent`, and `SelectItem` from the shared Select module. Give triggers an accessible label and use `onValueChange`. Radix reserves an empty item value: use a nonempty UI sentinel for “all/default” and translate it to the empty API value explicitly. Do not introduce native ``、`