From 56ad83bbafec7217e4bba8d7416486582799df15 Mon Sep 17 00:00:00 2001 From: kqjy Date: Sun, 1 Feb 2026 14:56:20 +0800 Subject: [PATCH] Fix bidirectional sync UI issues --- app/admin_api.py | 7 +++++-- app/ui.py | 7 +++++-- templates/replication_wizard.html | 2 +- templates/sites.html | 8 ++++++-- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/app/admin_api.py b/app/admin_api.py index 49eb459..b565ba4 100644 --- a/app/admin_api.py +++ b/app/admin_api.py @@ -502,9 +502,12 @@ def check_bidirectional_status(site_id: str): admin_url = peer.endpoint.rstrip("/") + "/admin/sites" resp = requests.get( admin_url, - auth=(connection.access_key, connection.secret_key), timeout=10, - headers={"Accept": "application/json"}, + headers={ + "Accept": "application/json", + "X-Access-Key": connection.access_key, + "X-Secret-Key": connection.secret_key, + }, ) if resp.status_code == 200: diff --git a/app/ui.py b/app/ui.py index 1e060a5..5297c24 100644 --- a/app/ui.py +++ b/app/ui.py @@ -3035,9 +3035,12 @@ def check_peer_bidirectional_status(site_id: str): admin_url = peer.endpoint.rstrip("/") + "/admin/sites" resp = requests.get( admin_url, - auth=(connection.access_key, connection.secret_key), timeout=10, - headers={"Accept": "application/json"}, + headers={ + "Accept": "application/json", + "X-Access-Key": connection.access_key, + "X-Secret-Key": connection.secret_key, + }, ) if resp.status_code == 200: diff --git a/templates/replication_wizard.html b/templates/replication_wizard.html index f4b2057..8333fc5 100644 --- a/templates/replication_wizard.html +++ b/templates/replication_wizard.html @@ -28,7 +28,7 @@
- + Peer Site
diff --git a/templates/sites.html b/templates/sites.html index 0d88fb6..3553e87 100644 --- a/templates/sites.html +++ b/templates/sites.html @@ -718,8 +718,12 @@
`; - wizardLink.href = '/ui/sites/replication-wizard/' + encodeURIComponent(siteId); - wizardLink.classList.remove('d-none'); + const blockingErrors = ['NO_CONNECTION', 'CONNECTION_NOT_FOUND', 'REMOTE_UNREACHABLE', 'ENDPOINT_NOT_ALLOWED']; + const hasBlockingError = data.issues && data.issues.some(i => blockingErrors.includes(i.code)); + if (!hasBlockingError) { + wizardLink.href = '/ui/sites/peers/' + encodeURIComponent(siteId) + '/replication-wizard'; + wizardLink.classList.remove('d-none'); + } } contentDiv.innerHTML = html;