Add adaptive FPS and honest device reachability during streaming

DDP uses fire-and-forget UDP, so when a WiFi device becomes overwhelmed
by sustained traffic, sends appear successful while the device is
actually unreachable. This adds:

- HTTP liveness probe (GET /json/info, 2s timeout) every 10s during
  streaming, exposed as device_streaming_reachable in target state
- Adaptive FPS (opt-in): exponential backoff when device is unreachable,
  gradual recovery when it stabilizes — finds sustainable send rate
- Honest health checks: removed the lie that forced device_online=true
  during streaming; now runs actual health checks regardless
- Target editor toggle, FPS display shows effective rate when throttled,
  health dot reflects streaming reachability, red highlight when
  unreachable
- Auto-backup scheduling support in settings modal

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-26 20:22:58 +03:00
parent f8656b72a6
commit cadef971e7
23 changed files with 873 additions and 21 deletions

View File

@@ -79,3 +79,38 @@ class RestoreResponse(BaseModel):
missing_stores: List[str] = Field(default_factory=list, description="Store keys not found in backup")
restart_scheduled: bool = Field(description="Whether server restart was scheduled")
message: str = Field(description="Human-readable status message")
# ─── Auto-backup schemas ──────────────────────────────────────
class AutoBackupSettings(BaseModel):
"""Settings for automatic backup."""
enabled: bool = Field(description="Whether auto-backup is enabled")
interval_hours: float = Field(ge=0.5, le=168, description="Backup interval in hours")
max_backups: int = Field(ge=1, le=100, description="Maximum number of backup files to keep")
class AutoBackupStatusResponse(BaseModel):
"""Auto-backup settings plus runtime status."""
enabled: bool
interval_hours: float
max_backups: int
last_backup_time: str | None = None
next_backup_time: str | None = None
class BackupFileInfo(BaseModel):
"""Information about a saved backup file."""
filename: str
size_bytes: int
created_at: str
class BackupListResponse(BaseModel):
"""List of saved backup files."""
backups: List[BackupFileInfo]
count: int