Web test check#1539
Conversation
|
|
||
| # The web UI is an optional package (BR2_PACKAGE_WEBUI); minimal | ||
| # builds omit it. Skip rather than fail when it isn't installed. | ||
| tgtssh = env.attach("target", "mgmt", "ssh") |
There was a problem hiding this comment.
Hmm, shouldn't this be a feature on the infix-services yang model and feature in infix? I think this is the way we want to go.
There was a problem hiding this comment.
If it is even possible, previously we have on checked if a module exist.
There was a problem hiding this comment.
Looks like it is a has_feature in transport.py 👍
There was a problem hiding this comment.
Tricky question, previously we've had a simple landing page shown at :80/443 when the web interface was enabled, for both minimal and regular builds. Now that landing page is only shown for minimal builds. So, one approach could be to add a conditional /web/management/ container that is only included when the webui is built. Another could be a take on my earlier proposal to make the minimal build really minimal and make the entire /web section optional, i.e., no nginx or restconf even.
There was a problem hiding this comment.
We could accept this change as-is now, so we fix the test issue of all branches from main, and open a discussion on the services feature as a separate topic?
There was a problem hiding this comment.
Just skipping the UI (management node as you suggest) is enough. Dropping restconf from minimal is still a bad idea I think since we use it for tests. Dropping restconf I feel will be to much loss of test coverage.
There was a problem hiding this comment.
Another approach is that you just can have a feature enabled without limit any containers in the model
There was a problem hiding this comment.
Not sure I follow, what does "have a feature enabled without limit any containers in the model"?
Currently we have a LOT of enabled flags in the /web service tree:
module: infix-services
+--rw web
+--rw certificate? ks:central-asymmetric-key-ref
+--rw enabled? boolean
+--rw console
| +--rw enabled? boolean
+--rw netbrowse
| +--rw enabled? boolean
+--rw restconf
+--rw enabled? boolean
Personally I feel that /web/enabled is the logical knob for users to toggle to enable/disable the webui, adding a /web/management/enabled knob will be confusing for sure.
There was a problem hiding this comment.
Wait, @mattiaswal, is it a YANG feature you're talking about?
Add conditional YANG feature 'web-ui' to infix-services.yang, set when the webui is built. This feature is what the test now looks for to determine if it should be skipped or not. Also, clean up remnant of old test, which was entirely replaced by Mattias' login/csrf test. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Move the per-user shell editor out of the always-visible row into the expanded detail; the summary now reports the shell as plain text. This also fixes the editor showing "bash" for non-bash users: the dropdown matched the module-prefixed option value against the bare stored shell, so it never matched and fell back to the first option. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Adds a button next to "Save to startup" that opens a modal showing a unified diff between startup-config and running-config, so the pending changes can be reviewed before persisting them. The handler fetches both datastores over RESTCONF (same serializer → low-noise diff), writes them to temp files, and runs busybox `diff -u`. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Add a Hash dropdown to the add-user and change-password forms — yescrypt (default), SHA-512, SHA-256, MD5 — passed through to mkpasswd. These are exactly the four hashes the infix-system:crypt-hash YANG type accepts; unknown values fall back to the default. Password inputs switch to the CSS-masked type=text used by keystore secrets, which keeps the browser password manager from offering to save device credentials. Each add-user field gets a YANG description as a hover tooltip. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
These two shortcuts are toggleable in the configuration but were only detected once at login and baked into the session, so disabling them didn't drop the topbar icon / user-menu entry until re-login. Refresh just those two from running-config on full page loads (htmx swaps and pollers, which never re-draw them, are skipped), so toggling takes effect on the next reload without logging out. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
69c8558 to
9413663
Compare
The "unsaved changes" banner was set unconditionally at every site that touches config, so it could appear when running-config actually equals startup — contradicting the "Show diff" modal, which correctly showed nothing. A shared updateCfgUnsaved helper now compares running against startup (the same datastore pair the diff uses) and sets or clears the banner cookie to match: - Apply and restore-to-running clear it when an Apply/restore reverts an out-of-band (e.g. CLI) change back to match startup, instead of always showing it. - The advanced-tree presence toggle writes only the candidate datastore, so it no longer sets the running-vs-startup banner at all (matching the other candidate-only tree handlers). Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
9413663 to
a47e141
Compare
mattiaswal
left a comment
There was a problem hiding this comment.
Great work! Looking forward to do some additions myself.
Description
Minor fixes, and a diff view!
Checklist
Tick relevant boxes, this PR is-a or has-a: