feat: stay on main screen after triggering a deploy
Previously clicking Deploy redirected to the app detail page. Now the page stays put and immediately flips the deploy badge to "building". The existing 5-second status poller advances both the deploy badge (building → success/failed) and the container badge (→ running) without any manual refresh. https://claude.ai/code/session_01FKCW3FDjNFj6jve4niMFXH
This commit is contained in:
parent
8267b30b15
commit
84b5b2d028
1 changed files with 10 additions and 2 deletions
|
|
@ -278,8 +278,16 @@ pub async fn index(State(s): State<AppState>) -> Result<Html<String>, StatusCode
|
||||||
async function deploy(id) {{
|
async function deploy(id) {{
|
||||||
if (!confirm('Deploy ' + id + ' now?')) return;
|
if (!confirm('Deploy ' + id + ' now?')) return;
|
||||||
const r = await fetch('/api/apps/' + id + '/deploy', {{method: 'POST'}});
|
const r = await fetch('/api/apps/' + id + '/deploy', {{method: 'POST'}});
|
||||||
if (r.ok) window.location.href = '/apps/' + id;
|
if (r.ok) {{
|
||||||
else alert('Error: ' + await r.text());
|
// Immediately show building; the 5 s poller will advance to the final status.
|
||||||
|
const row = document.querySelector(`tr[data-id="${{id}}"]`);
|
||||||
|
if (row) {{
|
||||||
|
const db = row.querySelector('[data-deploy-badge]');
|
||||||
|
if (db) db.innerHTML = deployBadgeHtml('building');
|
||||||
|
}}
|
||||||
|
}} else {{
|
||||||
|
alert('Error: ' + await r.text());
|
||||||
|
}}
|
||||||
}}
|
}}
|
||||||
async function del(id) {{
|
async function del(id) {{
|
||||||
if (!confirm('Delete app "' + id + '"? This cannot be undone.')) return;
|
if (!confirm('Delete app "' + id + '"? This cannot be undone.')) return;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue