feat: add hostname and IP display to Ivanti queue panel
- Add migration to add hostname column to ivanti_todo_queue table - Update POST and batch POST endpoints to accept and store hostname - Pass hostName from findings data when adding items to queue - Display hostname and IP address in CARD queue section - Display hostname and IP address in vendor (FP/Archer) queue sections
This commit is contained in:
56
.kiro/specs/queue-hostname-ip-display/tasks.md
Normal file
56
.kiro/specs/queue-hostname-ip-display/tasks.md
Normal file
@@ -0,0 +1,56 @@
|
||||
# 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
|
||||
|
||||
- [x] 1. Create database migration to add hostname column
|
||||
- Create `backend/migrations/add_todo_queue_hostname.js` following the exact pattern of `add_todo_queue_ip_address.js`
|
||||
- Use `ALTER TABLE ivanti_todo_queue ADD COLUMN hostname TEXT`
|
||||
- Handle `duplicate column name` error for idempotency
|
||||
- Log appropriate messages for success and skip scenarios
|
||||
- _Requirements: 1.1, 1.2, 1.3_
|
||||
|
||||
- [x] 2. Update backend API endpoints to accept and store hostname
|
||||
- [x] 2.1 Update POST `/` (single-item) endpoint in `backend/routes/ivantiTodoQueue.js`
|
||||
- Extract `hostname` from `req.body`
|
||||
- Sanitize: if present and a string, trim and slice to 255 chars; otherwise `null`
|
||||
- Add `hostname` to the INSERT column list and parameter array
|
||||
- _Requirements: 2.1, 2.3_
|
||||
|
||||
- [x] 2.2 Update POST `/batch` endpoint in `backend/routes/ivantiTodoQueue.js`
|
||||
- For each finding, extract `hostname` from `f.hostname`
|
||||
- Apply same sanitization as single-item (trim, slice to 255, or null)
|
||||
- Add `hostname` to the per-row INSERT column list and parameter array
|
||||
- _Requirements: 2.2, 2.3_
|
||||
|
||||
- [x] 3. Checkpoint
|
||||
- Ensure all backend changes are consistent, ask the user if questions arise.
|
||||
|
||||
- [x] 4. Update frontend to pass hostname and display it in the queue panel
|
||||
- [x] 4.1 Update `addToQueue` function in `ReportingPage.js`
|
||||
- Add `hostname: finding.hostName || null` to the POST request body
|
||||
- _Requirements: 3.1_
|
||||
|
||||
- [x] 4.2 Update `submitBatch` function in `ReportingPage.js`
|
||||
- Add `hostname: f.hostName || null` to each finding object in the payload
|
||||
- _Requirements: 3.2_
|
||||
|
||||
- [x] 4.3 Update CARD section rendering in QueuePanel (`ReportingPage.js`)
|
||||
- Display `hostname` below finding_id (when present)
|
||||
- Display `ip_address` below hostname (when present)
|
||||
- Handle all combinations: both present, only hostname, only ip_address, neither
|
||||
- Use monospace styling at `0.68rem` consistent with existing ip_address display
|
||||
- _Requirements: 4.1, 4.2, 4.3, 4.4, 4.5_
|
||||
|
||||
- [x] 4.4 Update vendor section (FP/Archer) rendering in QueuePanel (`ReportingPage.js`)
|
||||
- Display `hostname` below the CVE list (when present)
|
||||
- Display `ip_address` below hostname or below CVE list if no hostname
|
||||
- Handle all combinations: both present, only one, neither
|
||||
- Use monospace styling at `0.62rem` / `0.68rem` with muted colors matching existing design
|
||||
- _Requirements: 5.1, 5.2, 5.3, 5.4_
|
||||
|
||||
- [x] 5. Final checkpoint
|
||||
- Ensure all changes are wired together end-to-end, ask the user if questions arise.
|
||||
Reference in New Issue
Block a user