fix: inline git test feedback and use form URLs (0.20.1)

Show git check result next to the button, scroll into view, and test unsaved repo URLs from the form.
This commit is contained in:
PTah
2026-06-20 16:29:48 +10:00
parent f411d8f070
commit 07b97bd111
7 changed files with 130 additions and 21 deletions
+16
View File
@@ -1,3 +1,5 @@
from dataclasses import replace
from datetime import datetime
from fastapi import APIRouter, Depends, HTTPException
@@ -582,6 +584,12 @@ class AgentUpdateSettingsUpdate(BaseModel):
git_branch: str | None = None
class AgentGitTestRequest(BaseModel):
rdp_git_repo_url: str | None = None
ssh_git_repo_url: str | None = None
git_branch: str | None = None
class AgentGitTestResponse(BaseModel):
git_latest_rdp_version: str | None = None
git_latest_ssh_version: str | None = None
@@ -661,10 +669,18 @@ def update_agent_update_settings(
@router.post("/agent-updates/test-git", response_model=AgentGitTestResponse)
def test_agent_git_release(
body: AgentGitTestRequest | None = None,
db: Session = Depends(get_db),
_user=Depends(require_admin),
) -> AgentGitTestResponse:
cfg = get_effective_agent_update_config(db)
if body is not None:
cfg = replace(
cfg,
rdp_git_repo_url=(body.rdp_git_repo_url or cfg.rdp_git_repo_url).strip(),
ssh_git_repo_url=(body.ssh_git_repo_url or cfg.ssh_git_repo_url).strip(),
git_branch=(body.git_branch or cfg.git_branch or "main").strip() or "main",
)
git_release = get_git_release_versions(cfg, db=db, force_refresh=True)
from app.services.agent_update_settings import PRODUCT_RDP, PRODUCT_SSH