summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base/htdocs
AgeCommit message (Collapse)Author
2020-04-10luci-base: uci.js: let internal RPC functions reject on errorsJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-10luci-base: rpc.js: add ability to reject nonzero ubus statusesJo-Philipp Wich
Add a new declare option `reject` which makes the generated RPC call function reject with an error in case the remote ubus call returned a non-zero status. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-10luci-base: form.js: improve save error handlingJo-Philipp Wich
Fixes: #3552 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-08Merge pull request #3749 from Ansuel/fix_relaydJo-Philipp Wich
luci-base: fix error 404 on missing relay protocol
2020-04-07luci-base: form.js: add documentationJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-06luci-base: reintroduce accidentally lost isCreateable() functionJo-Philipp Wich
Fixes: FS#2976 Fixes: 711f75927 ("luci-base: harmonize JS class naming and requesting") Ref: https://bugs.openwrt.org/index.php?do=details&task_id=2976 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>
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-30luci-base: network.js: fix JSDoc syntax errorJo-Philipp Wich
Fixes: 506dc5a90 ("luci-base: extended network.js for check if new interface is createable") Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-03-26luci-base: firewall.js: fix Firewall.removeZone()Jo-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-23form.js: use CSS .btn class for drag handlesJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-03-23luci-base: luci.js: tweak CSS classesJo-Philipp Wich
- use .btn CSS class for Save & Apply button - use .control-group CSS class for page action buttons Signed-off-by: Jo-Philipp Wich <jo@mein.io>
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-03-12luci-base: fix error 404 on missing relay protocolAnsuel Smith
Currently relay.js is included in any case even if the router doesn't have the needed package to use it. Fix this by checking if the system has this feature. Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2020-03-04Merge pull request #3712 from TDT-AG/pr/20200303-luci-baseJo-Philipp Wich
luci-base: extended network.js for check if new interface is createable
2020-03-03luci-base: network.js: gracefully handle deleteConfiguration() rejectsJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-03-03luci-base: network.js: add Protocol.deleteConfiguration() callbackJo-Philipp Wich
Add a new Protocol.deleteConfiguration() callback function which can be overridden by protocol handler to perform additional cleanup tasks, such as unsetting related uci entries which are not part of the interface configuration itself. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-03-03luci-base: extended network.js for check if new interface is createableHelge Mader
Signed-off-by: Helge Mader <ma@dev.tdt.de>
2020-03-02luci-base: firewall.js: don't treat zone name as network fallbackJo-Philipp Wich
Drop obsolete extra logic which treats the zone name as covered network name in case the network list is unset. This behaviour applied to the pre-fw3 uci firewall, but is not supported since fw3 anymore. Ref: https://forum.openwrt.org/t/luci-zone-creation-bug/55921 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-02-14luci-base: cbi.js: avoid double-initialization of dropdownsJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-02-14luci-base: cbi.js: handle translation contexts in _()Jo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-02-14luci-base: luci.js: L.dom.data(): gracefully handle non-node argumentJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-02-13luci-base: form.js: pass section_id to Button onclick handlerJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-02-13luci-base: form.js: ButtonValue: pass sid as first onclick argumentJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-02-12luci-base: fs.js: exec_direct(): add ability to encode command as latin1Jo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-02-12luci-base: form.js: rendering fixes for grid sectionsJo-Philipp Wich
- Ensure that last header cell is rendered for grid sections without sorting or addremove actions - Don't skip header cells for optional options 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-31luci-base: validation.js: fix integer and float type validationJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-01-30luci-base: fs.js: support Blob/JSON in read_direct() and exec_direct()Jo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-01-30luci-base: luci.js: allow overriding response type for requestsJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-01-28luci-base: add L.media() URL construction helperJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-01-22luci-base: cbi.js: support plural translations and disambiguation contextsJo-Philipp Wich
- Implement `N_(count, "String singular", "String plural" [, "Context"])` plural translation function. - Extend `_()` to optionally accept a second disambiguation context argument. 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: form.js: add a new "contains" dependency modeJo-Philipp Wich
By tagging option dependencies with `!contains`, dependencies are considered satisfied when the value is contained in the value of a related field, instead of being equal to it. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-01-19luci-base: form.js: don't stringify node arguments in CBIValue.value()Jo-Philipp Wich
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: cbi.js: collapse whitespace before language string hashingJo-Philipp Wich
To mirror the behavior of the Lua runtime, we need to collapse whitepace in translation source strings before doing the string table lookup. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-01-16Merge pull request #3511 from Ansuel/no-hardJo-Philipp Wich
luci-base: remove hardcoded cgi-bin path
2020-01-16luci-base: make rpc webserver path configurableAnsuel Smith
Currently the ubus path that provide the webserver is hardcoded to be /ubus. Change this to make it configurable from the luci config file. Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
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>
2020-01-15luci-base: form.js: fix immediate validation of activated optionsJo-Philipp Wich
When form options are activated because their dependencies are satisified, ensure that an immediate validation is triggered to highlight potential errors without having the user to activate another form control first. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-12-30luci-base: form.js: implement AbstractValue.getUIElement()Jo-Philipp Wich
Introduce a new method `getUIElement()` which simplifies obtaining the underlying per-section UI widget class instance for a from option object. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
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>