summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base/htdocs
AgeCommit message (Collapse)Author
2020-08-06luci-base: form.js: implement AbstractSection.getOption() helperJo-Philipp Wich
The `getOption()` function allows to easily obtain a reference to another option object instance within the same section. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
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: network.js: recognize uci declared network devicesJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-08-05luci-base: form.js: add cfgvalue(), formvalue() and getUIElement() helpersJo-Philipp Wich
This commit introduces new per-section cfgvalue(), formvalue() and getUIElement() helper functions which complement the respective per-option functions. Their intent is to simplify querying input data or obtaining UI widget instances from other options within the same section. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-08-05luci-base: form.js: add AbstractValue.onchange propertyJo-Philipp Wich
Introduce a new, widget agnostic onchange property which allows setting custom handler functions to react on element value changes. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-08-05luci-base: form.js: add ability to specify regular expression dependenciesJo-Philipp Wich
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-08-04luci-base: uci.js: fix option deletion quirksJo-Philipp Wich
Since option deletions are sent first, followed by ubus set commands, a call sequence like: uci.set('config', 'section', 'option', ['foo', 'bar']) uci.set('config', 'section', 'option', ['foo']) uci.unset('config', 'section', 'option') ... would result in the option retainining `foo` as value, instead of it getting removed as one would expect. Fix this issue by reverting the internal change state of the option before storing the deletion. While we're at it, also rework the internal tracking of deleted options to not result in duplicate removal requests when the same option is unset several times. Finally change all `undefined` returns to `null` in order to comply with the function documentation. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-07-28luci-base: form.js: add CSS class to invalid option dismiss buttonJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-07-28luci-base: form.js: don't destroy modal form on invalid values when savingJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-07-24luci-base: fix widgets CBIUserSelect appending list on loadHelge Mader
The user list was appended to the dropdown again each time the page is loaded. Signed-off-by: Helge Mader <ma@dev.tdt.de>
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-06-14luci-base: form.js: fix handling of array sections in JSONMap formsJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-05-29luci-base: luci.js: properly skip comments when finding require tokensJo-Philipp Wich
Fixes: #4020, #4022, #4111 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-05-24luci-base: firewall.js: remove further zone network/name fallback logicJo-Philipp Wich
Fixes: #4093 Fixes: 4052436d8 ("luci-base: firewall.js: don't treat zone name as network fallback") 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-19Merge pull request #4053 from TDT-AG/pr/20200515-luci-baseFlorian Eckert
luci-base: fix host validation function
2020-05-19luci-base: fix host validation functionFlorian Eckert
Allow only ipv4 or ipv6 addresses without IP mask. A host IP with mask does not make sense in this context. Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2020-05-17luci-base: validation.js: count byte- instead of character length of stringsJo-Philipp Wich
Fixes: #4055 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-05-07luci-base: optimize some PNG filesJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-05-07luci-base: move old cbi icons to luci-compatJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
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: form.js: forward section ID in CBISectionValue methodsJo-Philipp Wich
This is useful for custom subclasses that want to perform conditional rendering of contents, depending on the parent section ID. 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-04luci-base: firewall.js: fix Zone.addRule()Jo-Philipp Wich
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: form.js: toggle inactive CSS class on unsatisfied field cellsJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-28luci-base: form.js: ListValue: support widget and orientation propertiesJo-Philipp Wich
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-28luci-base: form.js: allow secondary configs to fail loadingJo-Philipp Wich
Ref: https://forum.openwrt.org/t/luci-rpc-error/61760 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-28luci-base: firewall.js: gracefully handle missing uci configurationJo-Philipp Wich
Ref: https://forum.openwrt.org/t/luci-rpc-error/61760 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-26luci-base: luci.js: add LuCI.session.getToken()Jo-Philipp Wich
Since we're already have LuCI.session.getID() we should mirror the same interface for retrieving the session token. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-26luci-base: uci.js: fix section deletion logicJo-Philipp Wich
- Process deletions before additions or changes, allowing user code to remove and recreate a section with the same name. - Only record section deletions when the section to be removed actually existed in the original config or when it was staged for creation earlier. This avoids stray ubus not found exception when saving. 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-19luci-base: form.js: allow to disable descriptions row in TableSectionAnton Kikin
Add 'nodescriptions' property to the TableSection class that allows to disable displaying table header row with descriptions. Signed-off-by: Anton Kikin <a.kikin@tano-systems.com>
2020-04-19luci-base: form.js: fix TableSection descriptions row renderingAnton Kikin
In some cases, a table cell at actions column of a descriptions row may not be rendered. For example, this happens for GridSection when sorting is disabled: s = m.section(form.GridSection, 'section_type'); s.sortable = false; Signed-off-by: Anton Kikin <a.kikin@tano-systems.com>
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: luci.js: get rid of global `L` references in internal classesJo-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-16luci-base: luci.js: disable page action buttons on readonly viewsJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-16luci-base: luci.js: add hasViewPermission() helperJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-16luci-base: luci.js: fix JSdoc markup issuesJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-16luci-base: luci.js: convert various probe* functions to session data apiJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>