Update app.js
This commit is contained in:
@@ -625,8 +625,7 @@ function selectAgent(uuid) {
|
|||||||
|
|
||||||
hide("wizard-card");
|
hide("wizard-card");
|
||||||
loadKeys(uuid);
|
loadKeys(uuid);
|
||||||
loadBackups(uuid);
|
loadAgentInfo(uuid).then(() => loadBackups(uuid));
|
||||||
loadAgentInfo(uuid);
|
|
||||||
loadContract(uuid);
|
loadContract(uuid);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -745,16 +744,9 @@ function renderAgentInfo(info) {
|
|||||||
const port = stripQuotes(info.ssh_port);
|
const port = stripQuotes(info.ssh_port);
|
||||||
const sshCmd = `ssh root@${activeUUID}.derez.ai -p ${port}`;
|
const sshCmd = `ssh root@${activeUUID}.derez.ai -p ${port}`;
|
||||||
|
|
||||||
// Check SSH flag from agents list
|
// Check SSH flag from agent info response
|
||||||
const agent = agents.find((a) => (a.UUID || a.uuid) === activeUUID);
|
const sshRaw = stripQuotes(info.ssh);
|
||||||
const hasSSH =
|
const hasSSH = sshRaw !== "—" && sshRaw !== "0" && sshRaw !== "false";
|
||||||
agent &&
|
|
||||||
!(
|
|
||||||
agent.SSH === null ||
|
|
||||||
agent.SSH === undefined ||
|
|
||||||
agent.SSH === "null" ||
|
|
||||||
agent.SSH === false
|
|
||||||
);
|
|
||||||
|
|
||||||
const rows = [
|
const rows = [
|
||||||
`<div class="server-info-row">
|
`<div class="server-info-row">
|
||||||
@@ -1408,16 +1400,10 @@ async function loadBackups(uuid) {
|
|||||||
const body = document.getElementById("backups-body");
|
const body = document.getElementById("backups-body");
|
||||||
body.innerHTML = '<div class="loading-row"><div class="spinner"></div></div>';
|
body.innerHTML = '<div class="loading-row"><div class="spinner"></div></div>';
|
||||||
|
|
||||||
// Check BACKUP flag from agents list
|
// Check BACKUP flag from agent info response
|
||||||
const agent = agents.find((a) => (a.UUID || a.uuid) === uuid);
|
const backupRaw = activeAgentInfo ? stripQuotes(activeAgentInfo.backup) : "—";
|
||||||
const hasBackup =
|
const hasBackup =
|
||||||
agent &&
|
backupRaw !== "—" && backupRaw !== "0" && backupRaw !== "false";
|
||||||
!(
|
|
||||||
agent.BACKUP === null ||
|
|
||||||
agent.BACKUP === undefined ||
|
|
||||||
agent.BACKUP === "null" ||
|
|
||||||
agent.BACKUP === false
|
|
||||||
);
|
|
||||||
const btn = document.getElementById("make-backup-btn");
|
const btn = document.getElementById("make-backup-btn");
|
||||||
if (btn) {
|
if (btn) {
|
||||||
if (hasBackup) {
|
if (hasBackup) {
|
||||||
|
|||||||
Reference in New Issue
Block a user