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
This commit is contained in:
@@ -29,6 +29,7 @@ def init_db():
|
||||
from app.models import admin_user, upstream, snapshot, webhook_config, notification_log, custom_page, website, revoked_token # noqa: F401
|
||||
Base.metadata.create_all(bind=engine)
|
||||
_migrate_custom_pages()
|
||||
_migrate_upstreams()
|
||||
|
||||
|
||||
def _migrate_custom_pages():
|
||||
@@ -67,3 +68,22 @@ def _migrate_custom_pages():
|
||||
if "linked_upstream_id" not in columns:
|
||||
conn.execute(text("ALTER TABLE custom_pages ADD COLUMN linked_upstream_id INTEGER"))
|
||||
|
||||
|
||||
def _migrate_upstreams():
|
||||
"""Apply SQLite-safe migrations to the upstreams table."""
|
||||
inspector = inspect(engine)
|
||||
if "upstreams" not in inspector.get_table_names():
|
||||
return
|
||||
columns = {col["name"] for col in inspector.get_columns("upstreams")}
|
||||
with engine.begin() as conn:
|
||||
if "balance" not in columns:
|
||||
conn.execute(text("ALTER TABLE upstreams ADD COLUMN balance FLOAT"))
|
||||
if "balance_updated_at" not in columns:
|
||||
conn.execute(text("ALTER TABLE upstreams ADD COLUMN balance_updated_at DATETIME"))
|
||||
if "balance_endpoint" not in columns:
|
||||
conn.execute(text("ALTER TABLE upstreams ADD COLUMN balance_endpoint VARCHAR(256) NOT NULL DEFAULT ''"))
|
||||
if "balance_response_path" not in columns:
|
||||
conn.execute(text("ALTER TABLE upstreams ADD COLUMN balance_response_path VARCHAR(256) NOT NULL DEFAULT ''"))
|
||||
if "balance_divisor" not in columns:
|
||||
conn.execute(text("ALTER TABLE upstreams ADD COLUMN balance_divisor FLOAT NOT NULL DEFAULT 1.0"))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user