summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base/htdocs
AgeCommit message (Collapse)Author
2024-06-06luci-base: clarify apply-settings stringsPaul Donald
Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2024-05-14luci-base: return ipv6 lease time from getExpiry()hitech95
This commit introduces a streamlined method for retrieving lease time information on IPv6 interfaces. While IPv4 interfaces typically have a single lease time (available in the interface data), IPv6 interfaces commonly feature multiple lease times due to factors like delegated prefixes or multiple /64 subnet. Users typically receive only one prefix delegation from their ISP, leading this PR to the retrieval of lease time from the first available prefix or IPv6 address. To enhance usability and provide users with a more comprehensive view of lease time information, however, alternative approaches should be discussed. Suggestions include returning an array of lease times or aggregating the various possible values using methods like min or max. These enhancements aim to improve the clarity the lease time management on IPv6 interfaces. Signed-off-by: hitech95 <nicveronese@gmail.com>
2024-04-09Merge pull request #6553 from stokito/luc-mod-system_filemanagerJo-Philipp Wich
Add File Manager / File Browser based on form.FileUpload
2024-04-09luci-base: ui.js FileUpload: option to enable Download buttonSergey Ponomarev
Allow downloading from a file browser. The Download button is located near to Delete. It's shown only for files: folders or /dev/ devices can't be downloaded. The downloading is made via fs.read_direct() which internally calls cgi-download. Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
2024-03-29luci-base: drive-by fixesPaul Donald
Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2024-03-17Revert "luci-base: force menu to regenerate after uci change"Hannu Nyman
This reverts commit 97ebdcbddb9cad76dc551086fcb887e55886a069. The commit seems to cause errors already before the login screen. Discussion in https://github.com/openwrt/luci/commit/97ebdcbddb9cad76dc551086fcb887e55886a069#commitcomment-139871175 Errors like: In error(), file [C] called from function [anonymous function] (/usr/lib/lua/luci/ucodebridge.lua:23) called from function ((tail call)) In [anonymous function](), file /usr/share/ucode/luci/runtime.uc, line 148, byte 45: called from function build_pagetree (/usr/share/ucode/luci/dispatcher.uc:382:73) called from function menu_json (/usr/share/ucode/luci/dispatcher.uc:439:26) called from function [anonymous function] (/usr/share/ucode/luci/dispatcher.uc:898:24) called from anonymous function (/www/cgi-bin/luci:39:13) ` return lcall.call(modname, method, ...args);` Near here ----------------------------------------^ Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2024-03-17widgets: add a re-useable filtered logread viewKarl Palsson
Multiple apps introduced their own implementation of a syslog view, filtered for just their own application logs. Pull that out as a shared view. Some of these had _minor_ style differences, which has been "standardized" now. A full "widget" conversion would allow more end app tuning of that, but is not implemented. Signed-off-by: Karl Palsson <karlp@etactica.com> app-nextdns: fix Logs title Minor typo, introduced in 625abbf (convert simple controllers to menu.json) Signed-off-by: Karl Palsson <karlp@etactica.com> luci-base: implement shared log reader view Closes #5452 Signed-off-by: Paul Donald <newtwen@gmail.com>
2024-03-17luci-base: force menu to regenerate after uci changeJames Haggerty
Because the menu JSON can have 'depends' in them, uci changes should force the menu to regenerate. Closes #6423 Signed-off-by: James Haggerty <james.haggerty@morsemicro.com> Signed-off-by: Paul Donald <newtwen@gmail.com>
2024-03-17luci-base: ui.js: avoid polling in a tight loop on confirm/rollbackErik Karlsson
The call function was based on the legacy XHR interface and it has not been updated to comply with the new request interface which passes the duration as part of the response object rather than as a separate argument. This resulted in polling in a tight loop in certain cases since the duration was undefined. In addition there is no need to adjust apply_holdoff based on elapsed time as no significant amount of time has elapsed at this point. Signed-off-by: Erik Karlsson <erik.karlsson@genexis.eu>
2024-03-15luci-base: cbi.js: drop CustomEvent polyfillJo-Philipp Wich
All supported browsers natively support this functionality since quite a while already. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2024-03-08luci-base: CBIFileUpload support file browser modeSergey Ponomarev
In the Browser mode the file tree dialog won't be closed when clicking on a file. The mode is used by a File Browser. Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
2024-03-07luci-base: use correct regex for time validationDaniel Nilsson
Before this change, values further in time than 23:59:59 was allowed, such as 24:00:00 and 23:60:00. Leap seconds is accounted for so 60 is allowed in the seconds parameter. Signed-off-by: Daniel Nilsson <daniel.nilsson94@outlook.com>
2024-03-06luci-base: docs house-keepingPaul Donald
Signed-off-by: Paul Donald <newtwen@gmail.com>
2024-02-21luci-base: static.js: fix validation of netmask optionJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2024-02-21luci-base: ui.js: further keyboard navigation improvements for dropdownsJo-Philipp Wich
- Ensure that pressing escape within the custom choice input closes the dropdown list but not the parent modal dialog - Ensure that added custom choice elements are tabbable - Retain focus on dropdown when closing dropdown - Consistently focus input textarea when tabbing into custom choice item Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2024-02-21luci-base: validation.js: add iprange, iprange4 and iprange6 validatorsJo-Philipp Wich
Add datatype validators for IP address ranges which are required for certain firewall inputs. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2024-02-19luci-base: ui.js: rework dropdown focus behaviorJo-Philipp Wich
Drop mouse following focus behavior as it interferes with custom value inputs, rely on CSS based hover effects instead. Also slightly improve keyboard navigation by auto-focussing the custom value input when entering the last dropdown choice via arrow down or tab key, and by allowing to leave the text input again with the arrow up key. Fixes: #6903 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2024-01-31luci-mod-network: add disabled option for interfacePaul Donald
Enabled by default. If the interface is in use, the user will be asked to confirm. Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
2024-01-31luci-base: Code quality fixesPaul Donald
reduce backtracking in regex Signed-off-by: Paul Donald <newtwen@gmail.com>
2024-01-31luci-base: Code quality fixesPaul Donald
handle (possibly incorrect) comment variants <!-- --> <!-- --!> Signed-off-by: Paul Donald <newtwen@gmail.com>
2024-01-25luci-base: fix docs for TableSectionPaul Donald
There are repeated values (TableSection inherits identically named values from TypedSection which do not make sense to recreate). There seemed to be other errors. E.g. TypedSection for FlagValue properties, which mean that TypedSection got tooltip + tooltipicon, and by virtue of the above error, GridSection inherited this too. Signed-off-by: Paul Donald <newtwen@gmail.com>
2024-01-23luci-base: FlagValue fix type of enabled and disabled propertiesSergey Ponomarev
The form.Flag checkbox allows to specify a value for enabled/disabled e.g. for a dropbear: o = s.option(form.Flag, 'PasswordAuth'); o.enabled = 'on'; So the property type should be a string but not just a number. Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
2024-01-23luci-base: JsDoc: exec_direct(): fix "type" enumSergey Ponomarev
The "type" can be "json" Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
2023-12-23luci-base: comment fixes (sp)Paul Donald
Signed-off-by: Paul Donald <newtwen@gmail.com>
2023-12-15luci-base: Use getMode in getActiveModeEvan Benn
Signed-off-by: Evan Benn <evan.benn@morsemicro.com>
2023-12-15luci-base: Replace mode: Master with Access PointEvan Benn
Access Point is the string used on the network wireless setup dialogue. Use Access Point to report the mode on the network wireless and status screens. Signed-off-by: Evan Benn <evan.benn@morsemicro.com>
2023-12-15luci-base: Make uci mode strings match iwinfo mode stringsEvan Benn
uci mesh was being displayed as 'Mesh', while iwinfo mesh was being reported as 'Mesh Point'. Unify those. Update getActiveModeI18n to deal with all the values iwinfo returns. Fix the incorrect 'Mash' translation. Signed-off-by: Evan Benn <evan.benn@morsemicro.com>
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-09-23luci-base: network.js: simplify getWifiNetidBySidSergey Ponomarev
Remove unused variables i and netid and reuse radioname Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
2023-09-23luci-base: "an URL" replace with "a URL"Sergey Ponomarev
This is a correct form Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
2023-09-23luci-base: cbi.js cbi_validate_named_section_add() simplifySergey Ponomarev
Reduce if to a simple boolean evaluation Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
2023-08-11luci-base: grammar fixesPaul Dee
Login (n) -> Log (v) in Logout (n) -> Log (v) out Signed-off-by: Paul Dee <itsascambutmailmeanyway@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-04-03luci-base: validation.js: fix xgettext quirkJo-Philipp Wich
The xgettext utility does not properly discard `/` inside regex character classes, causing a false positive unterminated string error. Avoid the issue by explicitly escaping the embedded slash. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2023-03-15luci-mod-network: add stricter wireless interface name validationGlenn Washburn
Linux wireless interface names have the following restrictions: * It must not be an empty string * It must not be '.' or '..' * It must not contain any /, : or space character ( , \t, \n, ...) * It must be less than 16 chars * It likely must not contain any % either Fixes: 8673aef8db ("luci-mod-network: remove uciname validation from wireless interface") Signed-off-by: Glenn Washburn <development@efficientek.com> [reword validation error messages, remove extended description text as it would be shown as part of the validation errors] 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-07Merge pull request #6104 from dhewg/6gJo-Philipp Wich
luci-mod-network: enable configuring wifi ax networks on the 6G band
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>
2023-02-04luci-base: form.js: reuse JSONMap data provider in GridSection modalsJo-Philipp Wich
Reuse the same data provider as the parent JSONMap instance in order to avoid inadvertently mangling the form data when saving the modal edit dialog. Fixes: bb9ede238a ("luci-base: form.js: reuse JSONMap data provider in GridSection modals") Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2023-02-04luci-base: form.js: fix GridSection modals in JSONMap instancesJo-Philipp Wich
Since grid section edit modals construct a new Map instance internally, we must take care of using the correct map constructor type for the internal copy in order to end up with the correct data provider. Ensure that the extended option modal of GridSection instances uses a JSONMap when the grid section's owner map is a JSONMap to avoid stray uci related errors. Ref: https://forum.openwrt.org/t/luci-save-apply/149658/5 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2023-01-23luci-base: use "hwmodes_text" to describe wireless radiosAndre Heider
This is a preformatted string like "ac/ax/b/g/n" for presentation. Signed-off-by: Andre Heider <a.heider@gmail.com>
2023-01-17luci-base: help-text spell fixPaul Dee
Signed-off-by: Paul Dee <itsascambutmailmeanyway@gmail.com>
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-12-13luci-base: fix button handling for named sectionsFlorian Eckert
If more than one named section is added to the page, it is currently the case, that the first button is always switched on or off during input validation of the uci section name. This is because the usage of the 'document.querySelector' function is to imprecise. Changing the search start to the element to be created, fixes this. Signed-off-by: Florian Eckert <fe@dev.tdt.de>
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-11-09luci-base: cbi.js: await L.ui load before updating tablesJo-Philipp Wich
On legacy views, the `L.ui` JavaScript class is not automatically loaded, so request it before updating tables. Fixes: e0e6989a4a ("luci-base: introduce new LuCI.ui.Table class") Signed-off-by: Jo-Philipp Wich <jo@mein.io>