2.7 KiB
Implementation Plan: Queue Hostname & IP Display
Overview
Add hostname tracking to the Ivanti todo queue across database, backend API, and frontend display layers. All changes are additive and backward-compatible.
Tasks
-
1. Create database migration to add hostname column
- Create
backend/migrations/add_todo_queue_hostname.jsfollowing the exact pattern ofadd_todo_queue_ip_address.js - Use
ALTER TABLE ivanti_todo_queue ADD COLUMN hostname TEXT - Handle
duplicate column nameerror for idempotency - Log appropriate messages for success and skip scenarios
- Requirements: 1.1, 1.2, 1.3
- Create
-
2. Update backend API endpoints to accept and store hostname
-
2.1 Update POST
/(single-item) endpoint inbackend/routes/ivantiTodoQueue.js- Extract
hostnamefromreq.body - Sanitize: if present and a string, trim and slice to 255 chars; otherwise
null - Add
hostnameto the INSERT column list and parameter array - Requirements: 2.1, 2.3
- Extract
-
2.2 Update POST
/batchendpoint inbackend/routes/ivantiTodoQueue.js- For each finding, extract
hostnamefromf.hostname - Apply same sanitization as single-item (trim, slice to 255, or null)
- Add
hostnameto the per-row INSERT column list and parameter array - Requirements: 2.2, 2.3
- For each finding, extract
-
-
3. Checkpoint
- Ensure all backend changes are consistent, ask the user if questions arise.
-
4. Update frontend to pass hostname and display it in the queue panel
-
4.1 Update
addToQueuefunction inReportingPage.js- Add
hostname: finding.hostName || nullto the POST request body - Requirements: 3.1
- Add
-
4.2 Update
submitBatchfunction inReportingPage.js- Add
hostname: f.hostName || nullto each finding object in the payload - Requirements: 3.2
- Add
-
4.3 Update CARD section rendering in QueuePanel (
ReportingPage.js)- Display
hostnamebelow finding_id (when present) - Display
ip_addressbelow hostname (when present) - Handle all combinations: both present, only hostname, only ip_address, neither
- Use monospace styling at
0.68remconsistent with existing ip_address display - Requirements: 4.1, 4.2, 4.3, 4.4, 4.5
- Display
-
4.4 Update vendor section (FP/Archer) rendering in QueuePanel (
ReportingPage.js)- Display
hostnamebelow the CVE list (when present) - Display
ip_addressbelow hostname or below CVE list if no hostname - Handle all combinations: both present, only one, neither
- Use monospace styling at
0.62rem/0.68remwith muted colors matching existing design - Requirements: 5.1, 5.2, 5.3, 5.4
- Display
-
-
5. Final checkpoint
- Ensure all changes are wired together end-to-end, ask the user if questions arise.