Skip to content

feat: dashboard file-input modal system for WRITE commands #113

@rlaope

Description

@rlaope

Priority: P1

Summary

Extend the web frontend dashboard (argus-frontend) to support commands that require file/parameter input via a reusable modal component system. Currently the dashboard only shows real-time READ metrics. This adds file analysis commands with modal forms, input validation, and result rendering within the dashboard UI.

UX Flow

  1. Dashboard sidebar or bottom panel shows categorized WRITE commands
  2. User clicks a command → modal popup with command-specific input form
  3. Real-time validation (file format, required fields)
  4. On submit → API call to server → results render in dashboard panel

Modal Example (gclogdiff)

┌─ GC Log Diff ─────────────────────────────────┐
│                                                │
│  File 1: [Choose File...] gc-before.log  ✓     │
│  File 2: [Choose File...] gc-after.log   ✓     │
│                                                │
│  Format: auto-detected (JDK 17 Unified)       │
│                                                │
│           [Cancel]         [Analyze]           │
└────────────────────────────────────────────────┘

Command Categories

File Analysis (upload file → analysis results):

Command Inputs Validation
gclog 1 file (.log/.gz) File size limit, GC log format
gclogdiff 2 files (.log/.gz) Both files parseable
jfranalyze 1 file (.jfr) Valid JFR recording
heapanalyze 1 file (.hprof) Valid heap dump

Extraction/Download (PID → output file):

Command Inputs Output
heapdump PID, output path .hprof → browser download
jfr PID, duration .jfr → browser download
profile PID, type, duration profile data → download
flame PID, duration .html → new tab or download
threaddump PID text → copy/save/download

Mutation (requires confirmation dialog):

Command Inputs Safety
gcrun PID Confirmation dialog
vmset PID, flag, value Type validation + confirm

Frontend Component Architecture

FileAnalysisModal (base component)
  ├── SingleFileModal    → gclog, jfranalyze, heapanalyze
  ├── DualFileModal      → gclogdiff
  ├── PidActionModal     → heapdump, jfr, profile, flame, threaddump
  └── PidMutationModal   → gcrun, vmset (with confirmation step)

AnalysisResultPanel (renders command output)
  ├── GcLogResultPanel   → pause stats, timeline, rates, leak
  ├── GcDiffResultPanel  → comparison table with verdict
  └── GenericResultPanel → fallback for other commands

Server-side API

  • POST /api/analyze/gclog — upload file, return JSON analysis
  • POST /api/analyze/gclogdiff — upload 2 files, return comparison JSON
  • POST /api/extract/heapdump — trigger extraction, return download URL
  • POST /api/extract/jfr — start/stop recording, return download URL

Download Behavior (Extraction commands)

  • JFR/heapdump/profile: server extracts → returns download URL → browser downloads
  • Progress indicator during extraction
  • Flame graph: generate HTML → open in new browser tab

Validation Rules

  • File size limit (configurable, default 200MB)
  • File extension check (.log, .jfr, .hprof)
  • Upload progress bar for large files
  • PID validation (process exists, is JVM)

Checklist

  • Base FileAnalysisModal React component with validation framework
  • SingleFileModal for single-file analysis commands
  • DualFileModal for two-file comparison commands
  • PidActionModal for extraction commands with download
  • PidMutationModal for mutation commands with confirmation
  • Command panel in dashboard sidebar
  • Server-side file upload endpoints
  • AnalysisResultPanel for rendering analysis output
  • Download flow for extraction commands
  • Upload progress bar

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions