summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base/htdocs/luci-static/resources/ui.js
AgeCommit message (Collapse)Author
2023-10-19luci-base: ui.js: sorting fixes for tables initialized from markupJo-Philipp Wich
- Populate id option from table id attribute - Update column head sort indicator in UITable.update() - Don't store sort state for tables without id Ref: https://github.com/openwrt/luci/issues/6640 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2023-09-23luci-base: Fix typos in JsDocsSergey Ponomarev
In some places argument name was renamed but in the JsDoc it's remain old. Added more typing for string enum fields like: @param {string} [type=text] replaced with: @param {"blob"|"text"|"blob"} [type=text] Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
2023-06-07luci-base: ui.js: set `autocomplete="new-password"` for password fieldsJo-Philipp Wich
Attempt to prevent Firefox from randomly filling nonesense into arbitrary password fields such as the WireGuard private key field by setting the `autocomplete="new-password"` attribute on any password type fields. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2023-04-28luci-base: ui.js: make upload cancellation message translatableJo-Philipp Wich
Resync base translation templates as well. Fixes: #6364 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2023-02-08Revert "luci-proto-openconnect: fix server url validation"Jo-Philipp Wich
This reverts commit f1312cadc6675fb29d02425775dd8a2a533d7e7c. The commit contained unrelated changes. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2023-02-07luci-proto-openconnect: fix server url validationJo-Philipp Wich
The OpenConnect configuration form incorrectly assumed that the server setting must be hostname while it actually may be a full URL. Fixes: #6184 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2023-02-05luci-base: ui.js: modal dialog tweaksJo-Philipp Wich
- Automatically focus modal dialog frame - Close modal dialog on pressing escape key Fixes: #4609, #6205 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2023-02-05luci-base: ui.js: improve ui.Dropdown event handlingJo-Philipp Wich
Improve overall event and focus handling, avoid registering a global mouseover event listener, stop propagating escape keypress on closing dropdown and avoid `Element.blur()` to prevent de-focusing open modals. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2022-12-27luci-base: ui.js: support div based table markup in UITable.update()Jo-Philipp Wich
Constructing UITable instances from existing, div based markup is supported but the UITable.update() implementation did not account for that, leading to defunct data updates on tables built from div based markup. Fix this issue by extending UITable.update() to consider a div based table structure as well, like we do in UITable.initFromMarkup() already. Fixes: #5713 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2022-11-22luci-base: ui.js: table enhancementsJo-Philipp Wich
- Gracefully handle cells without innerText - Properly handle `DocumentFragment` call values on table update - Introduce ability to fetch actual cell value for sorting purposes from `data-value` attribute Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2022-07-27luci-base: revise array sortingJo-Philipp Wich
Refactor various sort operations throughout luci-base to use the new L.naturalCompare() comparator function. This primarily ensures that embedded numbers are sorted numerically and not in a lexicographical way. It also simplifies some code as a side effect. Ref: #5899 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2022-05-17luci-base: ui.js: add required CSS class to dynlist widgetJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2022-05-16luci-base: ui.js: warn about connectivity loss on changing iface settingsJo-Philipp Wich
If specific settings such as the protocol, IP address or netmask of an interface the user is connected to are changed, the apply/rollback mechanism might interfere. Display an additional warning dialog in this case, instructing the user to manually reconnect and offering to continue with a less safe unchecked apply mechanism. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2022-05-06luci-base: ui.js: make "Apply unchecked" available from the changes dialogJo-Philipp Wich
Previously, "Apply unchecked" was only possible from the save action of CBI maps, allow to invoke it from the configuration change dialog as well. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2022-05-06luci-base: ui.js: gracefully handle failing confirm calls on rollbackJo-Philipp Wich
Do not abort the poll loop if some confirm request attempts fail, which might happen when the device starts rolling back its configuration. Before that fix, the rollback information dialog offering an unchecked apply was not reliably presented in such situations. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2022-04-28luci-base: ui: resolve aliases and rewrites on obtaining menu node childrenJo-Philipp Wich
Extend LuCI.ui.menu.getChildren() to resolve aliases and rewrites prior to returning the menu nodes. This allows aliasing entire menu trees instead of just single pages. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2022-02-27luci-base: ui: fix null access in ui.Table.update()Jo-Philipp Wich
Fixes: #5702 Fixes: e0e6989a4a ("luci-base: introduce new LuCI.ui.Table class") Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2022-02-24luci-base: introduce new LuCI.ui.Table classJo-Philipp Wich
Introduce a new `LuCI.ui.Table` class to simplify generating HTML tables for data output and turn the existing `cbi_update_table()` procedure into a wrapper around this new facility. Tables generated by the new class closely resemble the old markup but provide additional sorting capabilities. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-12-09luci-base: ui.js: avoid error tooltips overlapping dropdownsJo-Philipp Wich
Fixes: #5588 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-10-26luci-base: show validation message in errorLukas Voegl
Signed-off-by: Lukas Voegl <lvoegl@tdt.de>
2021-10-11luci-base: dispatcher: rework dispatching and menu filtering logicJo-Philipp Wich
- Prefer nodes that do not require authentication over nodes that do - Honour ACL dependencies while resolving firstchild nodes - Consider currently active session while scanning menu tree instead of only loading effective ACLs when a login node is encountered - Do not consider nodes for firstchild dispatching which specify a special "firstchild_ineligible" property - Hide menu nodes that have no accessible children Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-06-09luci-base: ui.js: determine dropdown position relative to overflow parentJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-05-04luci-base: change button-text from Dismiss to Close in UCI changes overviewSven Roederer
Change the left button of the UCI Apply-changes overview to the more correct function close. This also avoids confusion between Dismiss and Revert, which translate to the same in german. Signed-off-by: Sven Roederer <devel-sven@geroedel.de>
2021-03-29luci-base: ui.js: fix UICheckbox widget operation when tooltips are setJo-Philipp Wich
When a tooltip is rendered for a checkbox widget, an additional node is placed after the checkbox label element, breaking DOM selectors in bind(), isChecked(), setValue(). Apparently the functionality was never actually tested. Fixes: #4938 Fixes: e951236e3 ("luci-base: add tooltip handling") Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-02-19luci-base: ui.js: resolve parent ul early in UIDropdown.toggleItem()Jo-Philipp Wich
The parent node of the current li might be null after collapsing the dropdown, so resolve the parent ul early to avoid passing null to subsequent calls. Fixes clearing custom input values in DynamicList dropdowns. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-01-13luci-base: make tooltip icon string configurableFlorian Eckert
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2021-01-13luci-base: add tooltip handlingFlorian Eckert
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2020-11-24luci-base: delay cbi-tab-active event on tab initAnsuel Smith
Delay the cbi-tab-active custom event so any eventListner attached to the tab doesn't miss the first event. Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2020-08-06luci-base: ui.js: implement AbstractElement.isChanged()Jo-Philipp Wich
The new `isChanged()` utility functions allows to query the dirty state of an ui input widget. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-08-05luci-base: ui.js: implement AbstractElement.setPlaceholder()Jo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-07-05luci-base: ui.js: order menu entries with the same weight by nameJo-Philipp Wich
The previous server side menu rendering ordered items first by their order weight value, then by their internal name. Do the same for client side menu rendering. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-05-24luci-base: ui.js: fix function declaration in nested statementAnton Kikin
Fix "SyntaxError: Strict mode does not allow function declarations in a lexically nested statement" error that may occur in some old browsers (detected on QtWebKit 5.212). Signed-off-by: Anton Kikin <a.kikin@tano-systems.com>
2020-05-07luci-base: replace filebrowser icons with SVG variantsJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-05-04luci-base: ui.js: fix UITextfield.setValue()Jo-Philipp Wich
Fixes: d02c26772 ("luci-base: ui.js: rework password input handling") Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-05-02luci-base: ui.js: reset scroll position when opening modal overlayJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-05-02luci-base: ui.js: fix input value reading for select widgetsJo-Philipp Wich
Fixes: #3989 Fixes: 81effc111 ("luci-base: ui.js: assume select widget by default for ListValue widget") Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-05-02luci-base: ui.js: rework password input handlingJo-Philipp Wich
- Get rid of dummy element - Render password field as text input initially and later transform it to a password field - Use .control-group markup to allow better styling Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-28luci-base: ui.js: assume select widget by default for ListValue widgetJo-Philipp Wich
Fixes: #3973 Fixes: 2fb55e1ab ("luci-base: ui.js: fixes for radio widget type of select element") Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-28luci-base: ui.js: fixes for radio widget type of select elementJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-20luci-base: ui.js: fix textarea widthJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-18luci-base: ui.js: hide unsatisfied firstchild menu nodesJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-17luci-base: ui.js: order indicators by ID valueJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-16luci-base: ui.js: add LuCI.ui.menu.flushCache() functionJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-16luci-base: ui.js: apply disabled attribute to toplevel dynlist nodeJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-16luci-base: ui.js: add LuCI.ui.menu helper classJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-16luci-base: ui.js: use session data api to persist tab selection stateJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-14luci-base: ui.js: use standard indicator framework to display uci changesJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-14luci-base: ui.js: add disabled property to widgetsJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-03luci-base: ui.js: add instantiateView() helperJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-02luci-base: harmonize JS class naming and requestingJo-Philipp Wich
- Make builtin classes available via `require` to allow view code to request external and internal classes in a consistent manner without having to know which classes are builtin and which not - Make base classes request any used class explicitely instead of relying on implicitly set up L.{dom,view,Poll,Request,Class} aliases - Consistently convert class names to lower case in JSdoc to match the names used in `require` statements - Deprecate L.{dom,view,Poll,Request,Class} aliases Signed-off-by: Jo-Philipp Wich <jo@mein.io>