Commit Graph
12 Commits
Author SHA1 Message Date
Juan DenisandClaude Opus 4.8 ad9acb89e3 refactor(frontend): Phase 5 §8.5 — drop 142 unused React imports (JSX transform)
Per docs/plans/FRONTEND_UX_TAILWIND_CLEANUP_PLAN.md §8.5. React 18's automatic
JSX runtime makes 'import React' unnecessary; removed it from the 142 files
eslint flagged as 'React defined but never used' (named imports like useState
preserved). Driven by an eslint --format json pass so only flagged files were
touched.

Lint warnings: 1603 -> 1461 (0 errors). Verified: npm run build passes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 02:44:16 -04:00
Juan DenisandClaude Opus 4.8 064e00c7f0 refactor(frontend): Phase 3 §6.3 — consolidate byte/relative-time formatters
Per docs/plans/FRONTEND_UX_TAILWIND_CLEANUP_PLAN.md Phase 3 utility consolidation.
Replaces the scattered, drifted-apart local helpers with the canonical utils
added in Phase 1.

formatBytes (was 14 local copies):
- utils/formatBytes.js realigned to the codebase convention (1024 divisor +
  KB/MB/GB labels; `iec` opt switches labels to KiB/MiB). It was unused until
  now, so displayed values are preserved.
- Removed local formatBytes/formatSize/formatMemory from ApplicationDetail,
  Backups, Databases, Monitoring, Terminal, ServerDetail (x2), BackupsTab,
  QuarantineTab, SystemTab, DiskUsageBar, SnapshotTable. Decimals matched per
  call site (e.g. BackupsTab keeps 2 decimals); empty/falsy fallbacks preserved
  via defaultValue. fileTypes.js and logHelpers.js now re-export the canonical
  (their named exports are consumed elsewhere).

formatRelativeTime (was 6 local copies):
- ActivityFeed, PipelineView (x2), Dashboard migrated to utils/time.js.
- serviceTypes.js and logHelpers.js re-export the canonical.
- EnvironmentCard left as-is (intentionally distinct "Today/Yesterday/X days
  ago" vocabulary, not the "Xm ago" format).

Behavioral deltas are cosmetic only: trailing-zero trim ("1.0 GB"->"1 GB"), the
date-fallback threshold normalized to 30d, and sub-hour times now show precise
"Xm ago". Units and numeric values are unchanged.

Verified: npm run build passes; eslint adds no new errors.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 02:17:44 -04:00
Juan Denis 32e6def0e6 Add ClamAV start action and UI posture fixes
Add a POST /security/clamav/start endpoint and SecurityService.start_clamav() to enable+start the ClamAV daemon (tries clamav-daemon and clamd). Add unit tests that mock ServiceControl to verify success/failure and auth. Wire a startClamAV API call into the frontend and extend the Security Overview: richer posture UI, one-click fixes (install, start service, init integrity, update defs), KPIs, icons, and accessibility improvements. Update related styles and file-manager minor styles. This improves operator workflows by allowing a one-click "Start service" posture fix and provides immediate UI feedback when fixes run.
2026-06-21 01:54:51 -04:00
Juan Denis f249fd49f0 Add topbar tab groups with overflow + backups/security tabs
Replace per-page Tabs with a shared PageTopbar tab group that supports overflow and a "More" popover. Adds BACKUP_TABS and SECURITY_TABS components and updates Backups, Security and Git pages to render sections via the topbar tabs (useTabParam routing). Implements responsive/overflow measurement logic in PageTopbar (TopbarTabs) and related styles; removes old page-local tab styles and shadcn Tabs usage. Improves header UX so active tab stays visible when space is limited.
2026-06-20 23:32:27 -04:00
Juan DenisandClaude Opus 4.8 e1a2a68359 redesign(security): fail2ban per-jail KPI cards
Fetch each active jail's status (getFail2banJailStatus) and render a per-jail card grid (Banned / Failed / Total banned) above the banned-IPs table, matching the prototype. Per-jail counts already existed behind the /fail2ban/jails/<jail> endpoint — the tab just never called it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-13 03:12:10 -04:00
Juan DenisandClaude Opus 4.8 b08c7970e3 redesign(security): overview posture gauge + dense integrity table
OverviewTab gains a ScoreGauge posture ring + hardening checklist computed client-side from real signals (ClamAV state, file-integrity baseline, recent integrity changes, notifications) — no invented backend number. IntegrityTab's plain path lists become a dense sk-dtable with change-kind state chips (modified/deleted/new/permission). Fail2ban per-jail cards left out (payload has no per-jail counts).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-13 02:57:47 -04:00
Juan DenisandClaude Fable 5 ff2192cb45 feat(ui): restyle the Security suite (shell + 13 tabs) to the new look
Shell: StatStrip -> MetricCard KPI strip (alerts/malware/ClamAV/scan from
real status), tab strip -> accent wash via scoped SCSS (ids untouched).
Tabs: Overview cards -> Pill + sk-info-row; Scanner/Quarantine/IP-lists/
SSH-keys/fail2ban lists -> dense sk-dtable with mono cells + state chips;
Vulnerability + Audit render their REAL scores via ScoreGauge; Integrity
changes get kind chips + --bg-code file lists; Firewall sub-views -> ds
SegControl with live counts; Events -> ds Feed with tone dots;
AutoUpdates/Config reskinned (Config via SCSS only). All flows kept
(scans, bans, rules, keys, baselines). Geo-blocking/policy toggles/
schedules/sessions deferred (backend gaps).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-11 00:18:28 -04:00
Juan DenisandClaude Opus 4.8 53f440abb0 refactor(ui): security page + overview adopt shared cards
Moves Security page and its Overview tab onto the shared StatCard/card
styles and trims the now-redundant per-page SCSS.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-01 02:50:23 -04:00
Juan Denis 19c727be4c Add Windows service support and new UI components
Agent: factor run logic into agentMainLoop and detect SCM launch; add Windows service dispatcher (service_windows.go) and POSIX stub (service_other.go) to properly handle SCM lifecycle and avoid Windows SCM error 1053. Frontend: add a set of presentational components (DangerZone, InfoList/InfoItem, JournalControls, LogViewer, MetricRow/MetricItem, ProcessTable, ProgressBar, ServiceCard, StatCard) and wire them into multiple pages and security tabs, replacing many ad-hoc info-list blocks. Also add a route for style-guide/:tab and update AgentFleet to use the new StatCard/StatsGrid layout. These changes improve service reliability on Windows and DRY up UI layouts with reusable components.
2026-04-30 23:11:26 -04:00
Juan Denis e734fd6d27 Add setup debug logging & refactor security UI
Add diagnostic setup logging and Windows-friendly error UI, plus a large refactor of security frontend components.

- Agent: introduce openSetupDebugLog, write diagnostics during runSetup, LockOSThread for Windows WebView2, and catch panics to surface failures. Add platform-specific showFatalError implementations (MessageBox on Windows, stderr elsewhere). Update setup UI Run behavior to create the native WebView2 window synchronously and fall back to the browser.
- Frontend: replace raw HTML buttons/badges/inputs/selects/textareas across many security-related components with shared UI primitives (Button, Badge, Input, Label, Select, Textarea) and update modal forms to use them.
- Misc: add /agent/packaging to .gitignore.

These changes improve diagnostics for the setup wizard (especially when launched without a console), provide clearer error surfacing on Windows, and standardize the security UI on the new component library.
2026-04-29 05:08:52 -04:00
Juan Denis 25c625f011 Introduce Modal component and lazy-load pages
Add a reusable Modal component (handles Escape key, focus trap and consistent markup) and refactor many inline modal implementations across the frontend to use it (EnvironmentVariables, LinkAppModal, QueryRunner, security tabs, GitConnectModal, ApiKeyModal, etc.). Implement React.lazy + Suspense for large pages and replace loading placeholders with a shared LoadingState; add route normalizations/redirects and tab-aware routes. Add new UI primitives (EmptyState, StatusBadge), an About settings tab, sidebar presets/appearance links and related sidebar logic, plus new styles. Also add the @rollup/rollup-win32-x64-msvc dependency to package.json.
2026-03-24 04:49:21 -04:00
Juan Denis bd8d2e09f6 Add security, logging, DB hardening & SCSS refactor
Broad refactor and hardening across backend and frontend:

- Standardize API error responses by removing legacy `success` flags and returning concise error payloads.
- Replace inline admin decorators with centralized middleware import (admin_required) in DB and Docker APIs.
- DatabaseService: add safer MySQL execution helpers and secure user-creation flow (hex-encoding, env-pwd usage) and improve pg drop to validate identifiers.
- Models: add eager-loading (subquery) for relationships and add indexes to frequently queried columns to reduce N+1 and improve performance.
- DockerService: add structured logging and error messages for better observability when Docker commands fail.
- Config: tighten ProductionConfig cookie settings (secure, httponly, samesite).
- Frontend: migrate many .less styles to .scss, add new security UI components and API client modules, update package metadata accordingly.
- Misc: add APP_IMPROVEMENTS.md to .gitignore.

These changes improve security, reliability, observability, and frontend styling consistency.
2026-03-23 22:00:36 -04:00