Repository navigation
Conversation
|
Thanks for the pull request. To keep the tracker readable, every item needs an area prefix in the title and the parts of the pull request template filled in. This one is missing:
Edit the pull request (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment Details: CONTRIBUTING.md |
|
Thanks, this follows the format now. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[GUI] Show the server's IP address in About → This PC.
Summary
Adds the PC's real network IP address to the About page's This PC block
(the
#facts-hwdl), alongside GPU, CPU and RAM. This tells the operator — andanyone sharing the screen which device should connect — what address to reach
the server on. The port is intentionally omitted, as it already appears in the
base URLs under Connect your tools.
Motivation
Until now the About page described the model and the hardware but never the
machine's network identity. When the server is reachable from other devices
(issue #26), there was no place on the page to see the address to type in a
browser or API client.
Changes
serve/server.pymachine_ip()helper (next tolan_addresses()): the PC's IPv4addresses on its networks, without loopback or link-local, or
Nonewhenthe machine has none (loopback-only or IPv6-only).
Servicegainsself.server_ip(defaultNone), set once inserve()from
machine_ip()— computed at start, not on every poll, so/metricsstays cheap.
metrics()now includesserver_ipinhardware_staticwhen available.serve/web/app.jsrenderAbout()adds aServerrow to#facts-hw:["Server", st.server_ip || null]. Thefacts()helper already dropsempty rows, so older servers that send nothing show no row.
serve/test_web_monitor_notes.pyrenderAboutpattern: one asserts the IPis shown, the other that the row is absent when
server_ipis missing.Access & privacy
The IP rides on
/metrics, so it inherits that endpoint's existingauthorization: visible to everyone when no API key is configured, and only to
key holders when one is set. No separate gating is added. The page itself
(
index.html/app.js) is still served without authentication; only its datacalls are gated.
Design notes
base URLs, so this avoids duplication.
when the server is bound to loopback. Caveat: when bound to
127.0.0.1, thatLAN address reaches the machine but not this server (use
127.0.0.1forthat); the port is in Connect your tools.
or IPv6-only), the row is simply omitted rather than showing a placeholder.
Testing
python -m unittest test_web_monitor_notes— 5/5 pass, including the two newtests.
test_web_*) — 35 tests pass, no regressions.python -m serve.server --engine mock --port 8095, thenopen http://127.0.0.1:8095/ → About → This PC. The
Serverrow shows themachine's IP (e.g.
192.168.0.120).Screenshots