From 46d8158c673d3023bb958f42490f9ddb6f2da158 Mon Sep 17 00:00:00 2001 From: oliver Date: Mon, 15 Jun 2026 13:35:34 -0300 Subject: [PATCH] new server --- app.js | 61 ++++++++++++++++++++---------------------------------- index.html | 11 +++++----- 2 files changed, 27 insertions(+), 45 deletions(-) diff --git a/app.js b/app.js index 9b99a99..243248a 100644 --- a/app.js +++ b/app.js @@ -532,7 +532,7 @@ function stripQuotes(s) { /* ─── Instances — Load ───────────────────────────────────────── */ async function instancesLoadRecords() { const tbody = document.getElementById("inst-table-body"); - tbody.innerHTML = `

Loading…

`; + tbody.innerHTML = `

Loading…

`; try { const res = await apiFetch(apiUrl(ROUTES.instances), { headers: apiHeaders(), @@ -566,12 +566,10 @@ function instancesRender() { const filtered = instancesRecords.filter((r) => { if (!search) return true; return ( - stripQuotes(r.uuid).toLowerCase().includes(search) || - stripQuotes(r.agent).toLowerCase().includes(search) || - stripQuotes(r.domain).toLowerCase().includes(search) || - stripQuotes(r.server ?? "") - .toLowerCase() - .includes(search) + r.uuid?.toLowerCase().includes(search) || + r.agent?.toLowerCase().includes(search) || + r.email?.toLowerCase().includes(search) || + (r.server ?? "").toLowerCase().includes(search) ); }); @@ -582,7 +580,7 @@ function instancesRender() { const tbody = document.getElementById("inst-table-body"); if (filtered.length === 0) { - tbody.innerHTML = `
+ tbody.innerHTML = `
@@ -595,42 +593,27 @@ function instancesRender() { tbody.innerHTML = filtered .map((r) => { const uuid = escHtml(r.uuid); - const agent = escHtml(stripQuotes(r.agent)); - const domain = escHtml(stripQuotes(r.domain)); - const sshPort = escHtml(stripQuotes(r.ssh_port)); - const ram = escHtml(stripQuotes(r.ram)); - const cpu = escHtml(stripQuotes(r.cpu)); - const server = escHtml(stripQuotes(r.server ?? "")); - const created = escHtml(stripQuotes(r.created ?? "")); + const agent = escHtml(r.agent); + const product = escHtml(r.product ?? ""); + const server = escHtml(r.server ?? ""); + const email = escHtml(r.email ?? ""); + const period = escHtml(r.period ?? ""); + const sshStatus = r.SSH ? "✓" : "✗"; + const backupStatus = r.BACKUP ? "B" : ""; + const createdStatus = r.created ? "C" : ""; + const statusParts = [sshStatus, backupStatus, createdStatus].filter( + Boolean, + ); + const status = statusParts.length ? statusParts.join(" ") : "—"; return `
${uuid} ${agent} - ${domain} - ${sshPort} - ${ram} - ${cpu} + ${product} ${server} - ${created} + ${email} + ${period} + ${status} - -