summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base/htdocs/luci-static/resources/validation.js
AgeCommit message (Collapse)Author
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-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-01-31luci-base: Code quality fixesPaul Donald
reduce backtracking in regex Signed-off-by: Paul Donald <newtwen@gmail.com>
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>
2021-11-18Merge pull request #5442 from lvoegl/validation-error-popup-messageJo-Philipp Wich
luci-base: show validation message in save error
2021-10-28luci-base: add legacy directory, file and device validator JS stubsJo-Philipp Wich
Fixes: #5466 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-07-03luci-base: validation: disallow mutlicast MACs by defaultJo-Philipp Wich
Extend the MAC address validator to disallow multicast MAC addresses and add a new optional validator option to require multicast MACs instead of unicast ones. Fixes: #5166 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-05-31luci-base: fix `network` data type validationJo-Philipp Wich
Fixes: #5085 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-03-01luci-base: validation.js: optionally support negative prefixesJo-Philipp Wich
Support negative prefix length in the `cidr`, `cidr4`, `cidr6`, `ipmask`, `ipmask4` and `ipmask6` data types when an optional truish flag is passed to the datatype name. Ref: #4812 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
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-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-01-31luci-base: validation.js: fix integer and float type validationJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-11-22luci-base: validation.js: fix "unique" validatorJo-Philipp Wich
Previous refactoring renamed the "data-type" attribute of widget markup containers to "data-widget", breaking the "unique" validator as it relies on it to lookup options. Fixes: #3341 Fixes: 13e9e3e9e ("treewide: fix "Unhandled token" errors with Lua CBI maps") Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-11luci-base: validation.js: implement length() datatype validatorJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-11luci-base: validation.js: fix nested function declarationsJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07luci-base: validation.js: rework translation labelsJo-Philipp Wich
Rework validation error translations for compount operators such as list() or neg() to not rely that much on specific native language grammar. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07luci-base: split off CBI validations into separate classJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>