Skip to content

Commit 72b1d26

Browse files
authored
Update admin.html
1 parent 7f9d6ff commit 72b1d26

1 file changed

Lines changed: 17 additions & 6 deletions

File tree

admin.html

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
<!DOCTYPE html>
32
<html lang="en">
43
<head>
@@ -295,7 +294,6 @@ <h3 style="margin:0 0 12px;">Conversation</h3>
295294

296295
<script>
297296
const SHEET_CSV_URL = "https://docs.google.com/spreadsheets/d/e/2PACX-1vQ7DzUBQu_foss2Q28P_aEEyWHA7k7-dpKOlJtXS-7Sgm0AXlB6zklULk4CXp77CRX1G8IBqTnQ6avP/pub?output=csv";
298-
const ADMIN_REPLY_WEBHOOK_URL = "https://cloud.activepieces.com/api/v1/webhooks/OsdvEzv3yCnuL4Oe7wyZJ";
299297

300298
const ticketList = document.getElementById("ticketList");
301299
const searchInput = document.getElementById("searchInput");
@@ -310,10 +308,6 @@ <h3 style="margin:0 0 12px;">Conversation</h3>
310308
const dCategory = document.getElementById("dCategory");
311309
const dStatus = document.getElementById("dStatus");
312310
const statusSelect = document.getElementById("statusSelect");
313-
const replyText = document.getElementById("replyText");
314-
const sendReplyBtn = document.getElementById("sendReplyBtn");
315-
const refreshBtn = document.getElementById("refreshBtn");
316-
const notice = document.getElementById("notice");
317311

318312
let tickets = [];
319313
let selectedTicket = null;
@@ -459,3 +453,20 @@ <h3>#${esc(t.ticket_id)} — ${esc(t.subject || "No subject")}</h3>
459453
try {
460454
const res = await fetch(SHEET_CSV_URL + "&t=" + Date.now());
461455
const csv = await res.text();
456+
const rows = parseCSV(csv);
457+
if (!rows.length || rows.length < 2) {
458+
ticketList.innerHTML = `<div class="empty">No tickets found.</div>`;
459+
return;
460+
}
461+
tickets = rowsToObjects(rows).filter(t => t.ticket_id);
462+
renderList();
463+
} catch (e) {
464+
ticketList.innerHTML = `<div class="empty">Could not load tickets.</div>`;
465+
}
466+
}
467+
468+
searchInput.addEventListener("input", renderList);
469+
loadTickets();
470+
</script>
471+
</body>
472+
</html>

0 commit comments

Comments
 (0)