const fs = require('fs'); let code = fs.readFileSync('public/index.html', 'utf8'); // 1. Update the table header to move Date next to # (Serial No) const oldThead = ` # File Name & Batch (click ✏️ to edit title live) Date File Type Upload Status (live progress & speed) Action `; const newThead = ` # Video Date File Name & Batch (click ✏️ to edit title live) File Type Upload Status (live progress & speed) Action `; if (code.includes(oldThead)) { code = code.replace(oldThead, newThead); console.log('✔ Replaced thead'); } else { console.log('⚠ Could not match oldThead directly'); } // 2. Add Date Analytics & Multi-Date Filter Bar right above the table const oldTableContainerStart = `
`; const newDateFilterBar = `
Upload Date Breakdown & Filters: (Showing all dates)
`; code = code.replace(oldTableContainerStart, newDateFilterBar); console.log('✔ Injected Date Filter Section'); fs.writeFileSync('public/index.html', code);