Skip to content

Conversation

@mostlygeek
Copy link
Owner

@mostlygeek mostlygeek commented Nov 4, 2025

When requesting / wol-proxy will show a loading page that polls /status every second. When the upstream server is ready the loading page will refresh causing the actual root page to be displayed

Summary by CodeRabbit

  • New Features
    • A loading page now appears when the upstream server is starting up, displaying real-time elapsed time and a visual indicator of connection attempts to keep users informed during the startup process.

When requesting / wol-proxy will show a loading page that polls /status
every second. When the upstream server is ready the loading page will
refresh causing the actual root page to be displayed
@coderabbitai
Copy link

coderabbitai bot commented Nov 4, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Adds a loading/wait screen to the Wol Proxy that displays when the upstream server is not ready. The interface shows elapsed time and an attempts counter, polling the /status endpoint every second and reloading upon readiness. Documentation is updated to clarify test command usage scope.

Changes

Cohort / File(s) Summary
Documentation
CLAUDE.md
Updated Testing section's make test-dev entry with usage constraint specifying it should only be used for changes under the proxy/ directory
Loading page UI
cmd/wol-proxy/index.html
New static HTML file serving as a loading/wait screen with real-time elapsed time counter (100ms updates), dynamic attempts indicator using dots (1s updates), and automatic status polling that reloads on readiness
Go implementation
cmd/wol-proxy/wol-proxy.go
Added embed package and loadingPageHTML package-level string variable populated via //go:embed index.html; modified upstream-not-ready handler to return the loading page HTML with text/html charset for "/" requests instead of existing behavior

Sequence Diagram

sequenceDiagram
    actor User
    participant Browser
    participant WolProxy
    participant UpstreamServer

    User->>Browser: Navigate to /
    Browser->>WolProxy: GET /
    alt Upstream not ready
        WolProxy->>Browser: Return loading page (HTTP 200)
        activate Browser
        loop Every 1 second
            Browser->>WolProxy: GET /status
            WolProxy->>UpstreamServer: Check readiness
            alt Status ready
                UpstreamServer-->>WolProxy: status: ready
                WolProxy-->>Browser: Ready response
                Browser->>Browser: Reload page
            else Not ready
                UpstreamServer-->>WolProxy: Not ready
                WolProxy-->>Browser: Not ready response
                Note over Browser: Display elapsed time<br/>Show attempts counter
            end
        end
        deactivate Browser
    else Upstream ready
        WolProxy->>UpstreamServer: Forward request
        UpstreamServer-->>WolProxy: Response
        WolProxy-->>Browser: Response
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Straightforward addition of a static loading page with basic inline HTML and JavaScript
  • Minimal Go code changes (embedding and conditional response handling)
  • Documentation update is simple and localized

Possibly related PRs

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch wol-tweaks

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b24467a and 1ced925.

📒 Files selected for processing (3)
  • CLAUDE.md (1 hunks)
  • cmd/wol-proxy/index.html (1 hunks)
  • cmd/wol-proxy/wol-proxy.go (3 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mostlygeek mostlygeek merged commit 6aedbe1 into main Nov 4, 2025
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants