summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base/htdocs/luci-static/resources/ui.js
AgeCommit message (Collapse)Author
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>
2020-04-01luci-base: ui.js: properly handle null choices in dropdown constructorJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-03-31luci-base: ui.js: add generic indicator handling functionsJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-03-31luci-base: ui.js: add documentationJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-03-25luci-base: ui.js: improve mobile dropdown scroll behaviourJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-03-24luci-base: form.js / ui.js: tie form labels to widgetsJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io> (cherry picked from commit 22ba6fc40933bee02c3ea93bbda952bb44bf3af1)
2020-03-23luci-base: ui.js: various tweaksJo-Philipp Wich
- emit checkbox markup suitable for CSS styling - use .btn CSS class where appropriate - dispatch events when updating uci change indicator - use correct target node when handling events in createHandlerFn() Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-02-12luci-base: ui.js: dispatch "cbi-tab-active" event when a tab is selectedJo-Philipp Wich
This is useful to lazy-load tab contents. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-01-20luci-base: ui.js: UIFileUpload fixesJo-Philipp Wich
- Introduce a new option `initial_directory` which describes the initial directory to display when nothing is selected, default to the root directory - Prevent stray legacy cbi reloads when deselecting files - Fix within-root-directory-check for initial rendering Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-01-19luci-base: ui.js: support clearChoices()/addChoices() for DynListsJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-01-19luci-base: ui.js: use placeholder as select placeholder in DynListsJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-01-19luci-base: ui.js: properly handle rich choices in Dropdowns, DynListsJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-01-16luci-base: remove hardcoded cgi-bin pathAnsuel Smith
Currently LuCI can be loaded only when placed in the root of the server as the cgi-bin path are hardcoded. Change the index.html to load the cgi-bin path from the current level. Also add a new entry in the env Object to make the cgi_base path easily accessible. This variable will be based on the position of /cgi-bin/luci. Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2019-12-30luci-base: ui.js: implement UIDropdown.{add,clear}Choices()Jo-Philipp Wich
The new `addChoices()` and `clearChoices()` functions allow clearing and adding new options to existing dropdown instances respectively. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-12-30luci-base: ui.js: expose UIElement class as AbstractElementJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-12-16luci-base: ui.js: allow custom validation in Dropdown and DynamicListJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-12-04luci-base: ui.js: ensure that select choice labels are properly escapedJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-12-04luci-base: ui.js: properly escape dynlist items for renderingJo-Philipp Wich
Ref: https://forum.openwrt.org/t/luci-theme-openwrt-reports-error/49736 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-11-15luci-base: Improve change application messageKevin Darbyshire-Bryant
As a native English speaker the luci message displayed when clicking 'Save & Apply' has a somewhat uncomfortable English phrasing of "Waiting for configuration to get applied". It could be improved by replacing 'get' with 'be' but once you've got that far you might as well replace this with the shorter & simpler "Applying configuration changes". This is also technically more correct since luci/openwrt should only be updating/restarting processes that are related to the changed areas, not changing the entire configuration. As a result of that, change both the 'success' and 'rolled back' messages to "Configuration changes have been applied" & "Configuration changes have been rolled back" Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
2019-11-10luci-base: ui.js: show filename after selecting upload fileJo-Philipp Wich
Fixes: #3286 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-11-10luci-base: ui.js: add ComboButton widgetJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-11-01luci-base, luci-mod-system: move file upload handling to ui.jsJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-10-22luci-base: ui.js: prevent race condition in tab initializationJo-Philipp Wich
Fixes: #3150 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-10-07luci-base: ui.js: add pingDevice() and awaitReconnect() functionsJo-Philipp Wich
Import these functions from the flash.js for use with other views that might trigger a device reboot. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-10-07luci-base: ui.js: use common fs.js class for filebrowser operationsJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-19luci-base: ui.js: mark user-changed widgetsJo-Philipp Wich
Set a `data-changed=true` attribute on the widget element when the user did any change to the default value. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-18luci-base: ensure that button labels are properly html escapedJo-Philipp Wich
Fixes: #3067 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-11luci-base: ui.js: implement addNotification() helperJo-Philipp Wich
The L.ui.addNotification() function pushes a dismissable banner message to the top of the view. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-10luci-base: use cgi-io and rpcd-mod-file to handle file upload and browsingJo-Philipp Wich
Remove the old server side support for file browsing and file uploading and switch to a client side widget instead which uses XMLHTTPRequests to upload files via cgi-io and RPC calls for file listing and status queries. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-10luci-base: ui.js: update tabs after initial renderJo-Philipp Wich
This ensures that the error badges are properly set. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-10luci-base: ui.js: also handle failed promises in createHandlerFn()Jo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-10luci-base: ui.js: ignore description when checking for empty tab panesJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-08-19luci-base: ui.js: implement Textarea widgetJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-08-14luci-base: ui.js: add createHandlerFn() helperJo-Philipp Wich
The createHandlerFn() helper function is useful to construct onclick or similar event handling functions. It will add a "spinning" CSS class on the event target element and disable the element, wrap the given function with Promise.resolv() and re-enable the target element once the promise is settled. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-08-14luci-base: ui.js: rework tab state handlingJo-Philipp Wich
Properly preserve the selection state of nested tabs. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-08-14luci-base: ui.js: UISelect: fix check for empty choicesJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-08-14luci-base: ui.js: do not forcibly sort synamic list itemsJo-Philipp Wich
Ref: https://forum.openwrt.org/t/cannot-save-certain-fields/42738/2 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-08-01luci-base: ui.js: tabs: fix empty pane checking, allow alternative query rootJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-08-01luci-base: ui.js: mark widget optional if empty choice is presentJo-Philipp Wich
Fixes: #2943 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-30luci-base: ui.js: do not save invalid dynlist valuesJo-Philipp Wich
Fixes: 3880c3f22 ("luci-base: ui.js: save filled out but not added dynlist items on submit") Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-30luci-base: ui.js: save filled out but not added dynlist items on submitJo-Philipp Wich
Fixes: #2938 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-27luci-base: don't treat .rmempty flag as optional for ListValue widgetsJo-Philipp Wich
Restore the old CBI behaviour of not automatically rendering empty selection choices in ListValue select dropdowns when .rmempty is specified. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-26luci-base: keep polling confirmation endpoint on XHR failuresJo-Philipp Wich
Fixes: #2912 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-26luci-base: ui.js: HTML escape uci changelog valuesJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-26luci-base: ui.js: HTML escape custom dropdown valuesJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-26luci-base: ui.js: fix event binding for UISelectJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-19luci-base: ui.js: fix multi vs. multiple keyword confusionJo-Philipp Wich
The "luci.form" and "luci.tools.widgets" classes use the "multiple" keyword while ui.js uses "multi" internally, leading to single-value dropdowns widget values getting stored as uci lists. Fix the issue by using "multiple" everywhere. Fixes: #2871 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-13luci-base: fix translatable text in ui.jsINAGAKI Hiroshi
Removed unnecessary symbols ("%>") at the end of the text. Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2019-07-12luci-base: ui.js: fix UISelect.setValue()Jo-Philipp Wich
Fixes: #2852 Fixes: ce04d7f ("luci-base: fix label-to-input association in js cbi maps") Signed-off-by: Jo-Philipp Wich <jo@mein.io>