Commit graph

12 commits

Author SHA1 Message Date
Jo-Philipp Wich
dece9b063c luci-base: fix network data type validation
Fixes: #5085
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-05-31 11:39:15 +02:00
Jo-Philipp Wich
cd06e708d8 luci-base: validation.js: optionally support negative prefixes
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>
2021-03-01 15:16:14 +01:00
Florian Eckert
aac1a8d512
Merge pull request #4053 from TDT-AG/pr/20200515-luci-base
luci-base: fix host validation function
2020-05-19 14:06:07 +02:00
Florian Eckert
c8d24f04de luci-base: fix host validation function
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-19 14:05:26 +02:00
Jo-Philipp Wich
9a41673488 luci-base: validation.js: count byte- instead of character length of strings
Fixes: #4055
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-05-17 21:40:27 +02:00
Jo-Philipp Wich
711f759278 luci-base: harmonize JS class naming and requesting
- 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-02 21:51:20 +02:00
Jo-Philipp Wich
187bef9f6c luci-base: validation.js: fix integer and float type validation
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-01-31 17:26:57 +01:00
Jo-Philipp Wich
4f0d67a289 luci-base: validation.js: fix "unique" validator
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-11-22 08:42:58 +01:00
Jo-Philipp Wich
c96de72043 luci-base: validation.js: implement length() datatype validator
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-11 12:28:58 +02:00
Jo-Philipp Wich
a7bfaf9b0b luci-base: validation.js: fix nested function declarations
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-11 15:04:54 +02:00
Jo-Philipp Wich
1bd9ee91af luci-base: validation.js: rework translation labels
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-07 15:36:26 +02:00
Jo-Philipp Wich
6edc057451 luci-base: split off CBI validations into separate class
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:25 +02:00