Refactor: Code cleanup and localStorage consolidation

This commit includes comprehensive codebase cleanup and refactoring:

## Code Cleanup
- Remove dead TypeScript code (types/monitoring.ts - 194 lines duplicate)
- Remove unused Go functions (GetClusterNodes, MigratePassword, GetClusterHealthInfo)
- Clean up commented-out code blocks across multiple files
- Remove unused TypeScript exports (helpTextClass, private tag color helpers)
- Delete obsolete test files and components

## localStorage Consolidation
- Centralize all storage keys into STORAGE_KEYS constant
- Update 5 files to use centralized keys:
  * utils/apiClient.ts (AUTH, LEGACY_TOKEN)
  * components/Dashboard/Dashboard.tsx (GUEST_METADATA)
  * components/Docker/DockerHosts.tsx (DOCKER_METADATA)
  * App.tsx (PLATFORMS_SEEN)
  * stores/updates.ts (UPDATES)
- Benefits: Single source of truth, prevents typos, better maintainability

## Previous Work Committed
- Docker monitoring improvements and disk metrics
- Security enhancements and setup fixes
- API refactoring and cleanup
- Documentation updates
- Build system improvements

## Testing
- All frontend tests pass (29 tests)
- All Go tests pass (15 packages)
- Production build successful
- Zero breaking changes

Total: 186 files changed, 5825 insertions(+), 11602 deletions(-)
This commit is contained in:
rcourtman 2025-11-04 21:50:46 +00:00
parent 5c4be1921c
commit 6eb1a10d9b
186 changed files with 5829 additions and 11606 deletions

View file

@ -2,7 +2,7 @@
ARG BUILD_AGENT=1
# Build stage for frontend (must be built first for embedding)
FROM node:20-alpine AS frontend-builder
FROM node:20.16.0-alpine3.19 AS frontend-builder
WORKDIR /app/frontend-modern
@ -19,7 +19,7 @@ RUN --mount=type=cache,id=pulse-npm-cache,target=/root/.npm \
npm run build
# Build stage for Go backend
FROM golang:1.24-alpine AS backend-builder
FROM golang:1.24.9-alpine3.19 AS backend-builder
ARG BUILD_AGENT
WORKDIR /app
@ -86,7 +86,7 @@ RUN --mount=type=cache,id=pulse-go-mod,target=/go/pkg/mod \
-o pulse-sensor-proxy ./cmd/pulse-sensor-proxy
# Runtime image for the Docker agent (offered via --target agent_runtime)
FROM alpine:latest AS agent_runtime
FROM alpine:3.19.1 AS agent_runtime
# Use TARGETARCH to select the correct binary for the build platform
ARG TARGETARCH
@ -118,7 +118,7 @@ ENV PULSE_NO_AUTO_UPDATE=true
ENTRYPOINT ["/usr/local/bin/pulse-docker-agent"]
# Final stage (Pulse server runtime)
FROM alpine:latest
FROM alpine:3.19.1
RUN apk --no-cache add ca-certificates tzdata su-exec openssh-client