From 153f6ab8e799785fb6f2ddae6a0e8d7eef4e230c Mon Sep 17 00:00:00 2001 From: kyle Date: Mon, 5 Oct 2026 03:22:43 +0000 Subject: [PATCH] Delete app/script.js --- app/script.js | 66 --------------------------------------------------- 1 file changed, 66 deletions(-) delete mode 100644 app/script.js diff --git a/app/script.js b/app/script.js deleted file mode 100644 index 81903d9..0000000 --- a/app/script.js +++ /dev/null @@ -1,66 +0,0 @@ -const container = document.getElementById('backup-container'); - -fetch('http://localhost:3000/api/backups') - .then((response) => response.json()) - .then((data) => { - let currentCompany = ''; - let currentProduct = ''; - - data.forEach((item) => { - // Group by company - if (item.company_name !== currentCompany) { - currentCompany = item.company_name; - const companySection = document.createElement('div'); - companySection.className = 'company-section'; - const header = document.createElement('h2'); - header.className = 'company-header'; - header.textContent = currentCompany; - companySection.appendChild(header); - container.appendChild(companySection); - } - - // Group by backup product - if (item.backup_product !== currentProduct) { - currentProduct = item.backup_product; - const productSection = document.createElement('div'); - productSection.className = 'backup-product'; - const productHeader = document.createElement('h3'); - productHeader.textContent = currentProduct; - productSection.appendChild(productHeader); - container.appendChild(productSection); - } - - const jobItem = document.createElement('div'); - jobItem.className = 'job-item'; - jobItem.innerHTML = ` - ${item.job_name} - Last Backup: ${new Date(item.last_backup_time).toLocaleString()} - ${item.status} - `; - - // Click to show error details - const statusPill = jobItem.querySelector('.status-pill'); - statusPill.addEventListener('click', () => { - const detailModal = document.createElement('div'); - detailModal.className = 'detail-modal'; - detailModal.innerHTML = ` - × -

Error Details

-

${item.error_details}

- `; - document.body.appendChild(detailModal); - - const closeModal = detailModal.querySelector('.modal-close'); - closeModal.addEventListener('click', () => { - document.body.removeChild(detailModal); - }); - }); - - const productSection = container.lastElementChild; - productSection.appendChild(jobItem); - }); - }) - .catch((error) => { - console.error('Error fetching data:', error); - container.innerHTML = '

Error loading backup data. Check backend logs.

'; - }); \ No newline at end of file