Update app.js

This commit is contained in:
oliver
2026-06-12 15:02:13 -03:00
parent a270f60311
commit 19b2edccf1
+7 -21
View File
@@ -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 = [
`<div class="server-info-row">
@@ -1408,16 +1400,10 @@ async function loadBackups(uuid) {
const body = document.getElementById("backups-body");
body.innerHTML = '<div class="loading-row"><div class="spinner"></div></div>';
// 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) {