Pulse/internal/api
rcourtman 7936808193 Add custom display name support for Docker hosts
This implements the ability for users to assign custom display names to Docker hosts,
similar to the existing functionality for Proxmox nodes. This addresses the issue where
multiple Docker hosts with identical hostnames but different IPs/domains cannot be
easily distinguished in the UI.

Backend changes:
- Add CustomDisplayName field to DockerHost model (internal/models/models.go:201)
- Update UpsertDockerHost to preserve custom display names across updates (internal/models/models.go:1110-1113)
- Add SetDockerHostCustomDisplayName method to State for updating names (internal/models/models.go:1221-1235)
- Add SetDockerHostCustomDisplayName method to Monitor (internal/monitoring/monitor.go:1070-1088)
- Add HandleSetCustomDisplayName API handler (internal/api/docker_agents.go:385-426)
- Route /api/agents/docker/hosts/{id}/display-name PUT requests (internal/api/docker_agents.go:117-120)

Frontend changes:
- Add customDisplayName field to DockerHost TypeScript interface (frontend-modern/src/types/api.ts:136)
- Add MonitoringAPI.setDockerHostDisplayName method (frontend-modern/src/api/monitoring.ts:151-187)
- Update getDisplayName function to prioritize custom names (frontend-modern/src/components/Settings/DockerAgents.tsx:84-89)
- Add inline editing UI with save/cancel buttons in Docker Agents settings (frontend-modern/src/components/Settings/DockerAgents.tsx:1349-1413)
- Update sorting to use custom display names (frontend-modern/src/components/Docker/DockerHosts.tsx:58-59)
- Update DockerHostSummaryTable to display custom names (frontend-modern/src/components/Docker/DockerHostSummaryTable.tsx:40-42, 87, 120, 254)

Users can now click the edit icon next to any Docker host name in Settings > Docker Agents
to set a custom display name. The custom name will be preserved across agent reconnections
and takes priority over the hostname reported by the agent.

Related to #623
2025-11-05 23:18:03 +00:00
..
alerts.go Implement Pulse tag overrides and alert clear persistence 2025-10-25 14:28:32 +00:00
alerts_test.go Allow printable alert IDs for acknowledgements (#550) 2025-10-14 16:48:22 +00:00
auth.go Refactor: Code cleanup and localStorage consolidation 2025-11-04 21:50:46 +00:00
auth_scope_test.go Add API token scopes and standalone host agent 2025-10-23 11:40:31 +00:00
bootstrap_token.go Refactor: Code cleanup and localStorage consolidation 2025-11-04 21:50:46 +00:00
config_handlers.go Fix temperature monitoring SSH key availability in containerized setup flow 2025-11-05 23:11:45 +00:00
config_handlers_auto_register_test.go Harden setup token flow and enforce encrypted persistence 2025-10-25 16:00:37 +00:00
config_handlers_cluster_test.go Respect custom ports when discovering Proxmox clusters 2025-10-22 17:42:52 +00:00
config_handlers_setup_script_test.go Refactor: Code cleanup and localStorage consolidation 2025-11-04 21:50:46 +00:00
csrf_store.go Refactor: Code cleanup and localStorage consolidation 2025-11-04 21:50:46 +00:00
demo_middleware.go Fix settings security tab navigation 2025-10-11 23:29:47 +00:00
diagnostics.go Refactor: Code cleanup and localStorage consolidation 2025-11-04 21:50:46 +00:00
DO_NOT_EDIT_FRONTEND_HERE.md Fix settings security tab navigation 2025-10-11 23:29:47 +00:00
docker_agents.go Add custom display name support for Docker hosts 2025-11-05 23:18:03 +00:00
docker_metadata.go Consolidate pending changes 2025-10-28 23:20:44 +00:00
frontend_embed.go Refactor: Code cleanup and localStorage consolidation 2025-11-04 21:50:46 +00:00
guest_metadata.go Fix settings security tab navigation 2025-10-11 23:29:47 +00:00
host_agents.go Improve host agent onboarding flow 2025-10-25 09:37:29 +00:00
host_agents_test.go perf: reduce polling allocations and guest metadata load 2025-10-25 13:12:47 +00:00
http_metrics.go feat: comprehensive diagnostics and observability improvements 2025-10-21 12:37:39 +00:00
middleware.go feat: comprehensive diagnostics and observability improvements 2025-10-21 12:37:39 +00:00
notifications.go Harden API auth and token handling 2025-10-25 14:54:03 +00:00
oidc_handlers.go Fix settings security tab navigation 2025-10-11 23:29:47 +00:00
oidc_service.go Fix settings security tab navigation 2025-10-11 23:29:47 +00:00
rate_limit_config.go Refactor: Code cleanup and localStorage consolidation 2025-11-04 21:50:46 +00:00
rate_limit_config_test.go test: add X-RateLimit-Limit header regression test 2025-10-20 15:10:59 +00:00
ratelimit.go Fix settings security tab navigation 2025-10-11 23:29:47 +00:00
README.md Fix settings security tab navigation 2025-10-11 23:29:47 +00:00
recovery_tokens.go perf: reduce polling allocations and guest metadata load 2025-10-25 13:12:47 +00:00
router.go Redirect to login when authentication expires 2025-11-05 19:36:01 +00:00
router_integration_test.go Refactor: Code cleanup and localStorage consolidation 2025-11-04 21:50:46 +00:00
security.go Fix CSRF token validation and improve token management 2025-11-05 09:23:44 +00:00
security_oidc.go feat: add professional logging with runtime configuration and performance optimization 2025-10-20 15:13:38 +00:00
security_setup_fix.go Refactor: Code cleanup and localStorage consolidation 2025-11-04 21:50:46 +00:00
security_setup_fix_test.go Refactor: Code cleanup and localStorage consolidation 2025-11-04 21:50:46 +00:00
security_test.go Refactor: Code cleanup and localStorage consolidation 2025-11-04 21:50:46 +00:00
security_tokens.go Refactor: Code cleanup and localStorage consolidation 2025-11-04 21:50:46 +00:00
security_tokens_test.go Add API token scopes and standalone host agent 2025-10-23 11:40:31 +00:00
session_store.go Refactor: Code cleanup and localStorage consolidation 2025-11-04 21:50:46 +00:00
system_settings.go Fix CSRF token validation and improve token management 2025-11-05 09:23:44 +00:00
types.go Add per-node temperature monitoring and fix critical config update bug 2025-11-05 14:11:53 +00:00
updates.go Fix settings security tab navigation 2025-10-11 23:29:47 +00:00

Internal API Package

This directory contains the API server implementation for Pulse.

Important Note About frontend-modern/

The frontend-modern/ subdirectory that appears here is:

  • AUTO-GENERATED during builds
  • NOT the source code - just a build artifact
  • IN .gitignore - never committed
  • REQUIRED BY GO - The embed directive needs it here

Frontend Development Location

👉 Edit frontend files at: /opt/pulse/frontend-modern/src/

Why This Structure?

Go's //go:embed directive has limitations:

  1. Cannot use ../ paths to access parent directories
  2. Cannot follow symbolic links
  3. Must embed files within the Go module

This is a known Go limitation and our structure works around it.