From 19b2edccf1c7ecc85f1ee6840711fefbe0b03c2a Mon Sep 17 00:00:00 2001 From: oliver Date: Fri, 12 Jun 2026 15:02:13 -0300 Subject: [PATCH] Update app.js --- app.js | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/app.js b/app.js index 342cd3b..a814240 100644 --- a/app.js +++ b/app.js @@ -625,8 +625,7 @@ function selectAgent(uuid) { hide("wizard-card"); loadKeys(uuid); - loadBackups(uuid); - loadAgentInfo(uuid); + loadAgentInfo(uuid).then(() => loadBackups(uuid)); loadContract(uuid); } @@ -745,16 +744,9 @@ function renderAgentInfo(info) { const port = stripQuotes(info.ssh_port); const sshCmd = `ssh root@${activeUUID}.derez.ai -p ${port}`; - // Check SSH flag from agents list - const agent = agents.find((a) => (a.UUID || a.uuid) === activeUUID); - const hasSSH = - agent && - !( - agent.SSH === null || - agent.SSH === undefined || - agent.SSH === "null" || - agent.SSH === false - ); + // Check SSH flag from agent info response + const sshRaw = stripQuotes(info.ssh); + const hasSSH = sshRaw !== "—" && sshRaw !== "0" && sshRaw !== "false"; const rows = [ `
@@ -1408,16 +1400,10 @@ async function loadBackups(uuid) { const body = document.getElementById("backups-body"); body.innerHTML = '
'; - // Check BACKUP flag from agents list - const agent = agents.find((a) => (a.UUID || a.uuid) === uuid); + // Check BACKUP flag from agent info response + const backupRaw = activeAgentInfo ? stripQuotes(activeAgentInfo.backup) : "—"; const hasBackup = - agent && - !( - agent.BACKUP === null || - agent.BACKUP === undefined || - agent.BACKUP === "null" || - agent.BACKUP === false - ); + backupRaw !== "—" && backupRaw !== "0" && backupRaw !== "false"; const btn = document.getElementById("make-backup-btn"); if (btn) { if (hasBackup) {