Commit Graph
18 Commits
Author SHA1 Message Date
liumangmang bea4344bb3 fix: reconcile upstream keys on list/generate/import to prevent stale key imports
- Extract reconcile_upstream_keys() to website_sync.py (shared scheduler + on-demand)
- Add reconcile_upstream_keys_full() for on-demand reconciliation at three entry points:
  list_generated_keys, generate_keys_by_groups, import_upstream_keys_as_accounts
- Safe on failure: active_group_ids=None / remote_key_ids=None skip cleanup
- Support custom managed_prefix via _fetch_remote_managed_key_ids() helper
- Exclude orphaned keys from frontend importable list
- Remove hardcoded search='SmartUp' from scheduler path
2026-06-01 11:29:37 +08:00
liumangmang 3408795289 feat: default upstream balance config for new upstream form
defaultForm() now uses sub2api presets for balance fields:
- balance_endpoint: /auth/me
- balance_response_path: data.balance
- balance_divisor: 1.0

Platform presets in handlePlatformChange() remain unchanged.
2026-06-01 11:09:31 +08:00
liumangmang 92eb4888d1 test: replace TestClient with direct router calls to fix hang in binding tests
- Removed TestClient/FastAPI/app.main imports entirely
- Tests now call websites_router.create_binding() and
  websites_router.update_binding() directly with db_session
- Bypasses all ASGI transport and lifespan issues
- All 13 tests pass in 0.75s
2026-06-01 10:26:23 +08:00
liumangmang 830b6df587 test: fix hang in group binding regression tests by isolating sessions and mocking lifespan 2026-06-01 09:32:44 +08:00
liumangmang 518e3e8efc feat: add one-click sync for website group bindings 2026-06-01 09:06:01 +08:00
liumangmang 890432e1a5 test: fix RuntimeWarnings in multi-tab concurrency test 2026-05-30 10:21:30 +08:00
liumangmang 18c04c1f86 test: enhance multi-tab coverage for concurrency and events 2026-05-30 10:17:24 +08:00
liumangmang 5268f1119b fix: multi-tab concurrency and metadata sync improvements 2026-05-30 10:08:55 +08:00
liumangmang 3ab3a5e26f feat: add multi-tab support to remote browser 2026-05-30 09:51:51 +08:00
liumangmang 5c20ddc8e6 feat: sync account priorities after rate changes 2026-05-29 17:51:12 +08:00
liumangmang c5778bb3e7 feat: persist browser sessions and update admin workflows 2026-05-29 16:00:43 +08:00
liumangmang 6044b00685 feat: 上游 Key 唯一化、分组导入跳过、账号导入平台识别&远端校验&base_url 注入
- 上游 Key 命名改为 {prefix}-{upstream.id}-{safe_group_name}-{group_id}
- 唯一约束 (upstream_id, group_id, managed_prefix) 加 managed_prefix 列
- 上游检测成功时同步 Key 状态,远端已删/分组已删自动清理
- 重复分组导入跳过,目标网站已存在同名分组返回 exists
- 账号导入平台自动识别(auto/manual 模式)
- 全选可导入 Key 按钮 + 目标分组自动匹配
- 导入幂等:已导入过的 Key 校验远端账号,不存在则重建
- 新增同步接口 POST /sync-imported-upstream-keys
- account_exists() 通过拉取账号列表判断,避免 404 误判
- credentials.base_url 注入来源上游地址,避免 401
- 前端导入弹窗自动同步+刷新按钮+并发/优先级设置
- 新增 12 个测试覆盖同步、幂等、远端删除、校验失败路径
2026-05-21 01:16:39 +08:00
liumangmang 0a27bba296 fix: 修复远程浏览器登录态保留 & 剪贴板同步问题 2026-05-20 10:13:13 +08:00
liumangmang 6cc797f915 feat: remote browser login persistence + balance display + UI consistency
- Retain login state in remote browser profiles (don't delete on disconnect)
- Add GET /api/browser-sessions/{id}/clipboard for clipboard sync
- Add POST /api/browser-sessions/{id}/autofill-login for manual credential fill
- Add DELETE /api/browser-sessions/profiles/{custom_page_id} for login clear
- Add balance tracking with configurable divisor (balance_divisor)
- Health check on session reuse, idle TTL eviction, background cleanup
- Add first-frame watchdog (10s timeout) to prevent infinite loading
- Reconnect browser on active=true when session was closed
- UI: uniform text-only inline buttons (websites + upstreams pages)
- Fix page switch race with closingRemoteSessionPromise
2026-05-20 09:44:20 +08:00
liumangmangandClaude Opus 4.7 1026134977 Add runtime data snapshot
Commit the current SmartUp runtime database and browser profile data so the deployed state can be restored from the repository.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-15 16:18:01 +08:00
liumangmangandClaude Opus 4.7 7adc7c00ab Add remote browser pages and website sync
Enable managed remote browser custom pages with login autofill and add website sync workflows so external admin surfaces can be handled inside SmartUp.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-15 15:43:58 +08:00
liumangmang a13a0070a5 Ignore local git metadata 2026-05-12 17:58:24 +08:00
liumangmang b564ca4797 Initial commit 2026-05-12 17:51:53 +08:00