"""UX-02: the configuration page itself - markup, style and the form's script. ⚠️ WHY THIS IS ITS OWN FILE. `web.py` is the ROUTES: three status handlers and, since this card, five configuration ones. The page is ~500 lines of HTML, CSS and JavaScript, and inlining it there would bury the routing - which is the half a reviewer has to check for "does anything here command an inverter". ⚠️ AND WHAT IS NOT IN THIS FILE, WHICH IS THE POINT OF THE CARD. There is no option key, no label, no unit, no range, no default and NO RULE in the script below. It renders a model the server built out of `GET /addons/self/info` (app/configui.py) and it renders refusals the server got out of `validate_startup_config()` (app/selfconfig.py). Its longest function is the one that decides which HTML input a `type` deserves. That is deliberate and it is checkable: test_selfconfig.py part 5 greps this file for the option keys and for phrases out of validate.py's refusals and asserts it contains none of them, and part 6 adds a NEW rule to a copy of validate.py and watches it appear on the page with this file untouched. ⚠️ EVERY URL IS RELATIVE. Ingress serves the add-on under a generated path prefix (`/api/hassio_ingress//`), so an absolute `/config/model` 404s in the field while working perfectly on a laptop. web.py's own header has said so since the status page shipped; this file has five more chances to get it wrong. ⚠️ AND IT IS BUILT FOR A PHONE FIRST. This is the screen someone stands in front of the inverter with: one column, big touch targets, sections that start collapsed so 72 options do not arrive as one wall, and the refusal block pinned where it cannot be scrolled past. """ CONFIG_PAGE = """ GoodWe - Configuration

GoodWe - Configuration

← Status and controls

This page and the Supervisor's Configuration tab edit the same settings. Both write one options blob. This page is the one that can tell you a setting is wrong before you save it; the Configuration tab cannot, because it only knows types and ranges. If the add-on is not running, the Configuration tab is the only one of the two that still exists - that is what it is for.
Saving does not restart anything, and does not take effect on its own. Stored settings are applied when the add-on next starts. Restarting to apply them costs a short loss of control: the add-on commands 0 W on every inverter as it shuts down, and the battery does nothing until it is back up. That is a separate button, below, with its own confirmation.
loading…

Restart the add-on?

The add-on will command 0 W on every inverter, stop, and start again with the stored settings. Control of the battery is lost for as long as that takes. Nothing else about the inverter is changed, and no latched failsafe is cleared.

"""