From c503b94f324f7d24f3c5bf0874012183e07998d8 Mon Sep 17 00:00:00 2001 From: wonder Date: Fri, 19 Jun 2026 22:20:51 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AF=BC=E8=88=AA=E5=88=B0=E7=94=9F?= =?UTF-8?q?=E6=88=90/=E5=AE=A1=E6=9F=A5=E9=A1=B5=E9=9D=A2=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E5=B0=86=E6=89=80=E9=80=89=20Base/Head=20=E4=BD=9C?= =?UTF-8?q?=E4=B8=BA=20URL=20=E5=8F=82=E6=95=B0=E4=BC=A0=E9=80=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/pages/repo.html | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/templates/pages/repo.html b/templates/pages/repo.html index 669754b..daefca7 100644 --- a/templates/pages/repo.html +++ b/templates/pages/repo.html @@ -169,6 +169,7 @@ if (refsResp.ok) { currentRefs = await refsResp.json(); populateRefSelects(currentRefs); + updateButtonLinks(); } // Init graph with click-to-select @@ -305,6 +306,8 @@ showTab('diff'); loadDiff(); } + + updateButtonLinks(); } // Ensure a select has an option with given value @@ -331,12 +334,25 @@ if (baseHash || headHash) { GitGraph.setSelection(baseHash || null, headHash || null); } + updateButtonLinks(); }; baseSelect.addEventListener('change', sync); headSelect.addEventListener('change', sync); } + function updateButtonLinks() { + const base = document.getElementById('select-base').value; + const head = document.getElementById('select-head').value; + const params = new URLSearchParams(); + if (base) params.set('base', base); + if (head) params.set('head', head); + const qs = params.toString(); + const suffix = qs ? '?' + qs : ''; + document.getElementById('btn-generate').href = `/repo/${repoId}/generate${suffix}`; + document.getElementById('btn-review').href = `/repo/${repoId}/review${suffix}`; + } + function showTab(tab) { document.getElementById('panel-graph').classList.toggle('hidden', tab !== 'graph'); document.getElementById('panel-diff').classList.toggle('hidden', tab !== 'diff');