Jo-Philipp Wich
f2965b759a
luci-base: ui.js: implement AbstractElement.setPlaceholder()
...
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-08-05 13:51:16 +02:00
Jo-Philipp Wich
bd5e2edb46
luci-base: uci.js: fix option deletion quirks
...
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-08-04 18:55:21 +02:00
Jo-Philipp Wich
1c92d9f706
luci-base: form.js: add CSS class to invalid option dismiss button
...
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-07-28 20:57:04 +02:00
Jo-Philipp Wich
b0cd7ff705
luci-base: form.js: don't destroy modal form on invalid values when saving
...
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-07-28 20:57:04 +02:00
Helge Mader
95d004fc5d
luci-base: fix widgets CBIUserSelect appending list on load
...
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-24 11:03:40 +02:00
Jo-Philipp Wich
0c479891ae
luci-base: ui.js: order menu entries with the same weight by name
...
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-07-05 00:11:59 +02:00
Jo-Philipp Wich
682f628ea6
luci-base: form.js: fix handling of array sections in JSONMap forms
...
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-06-14 16:41:49 +02:00
Jo-Philipp Wich
6be8f8dbae
luci-base: luci.js: properly skip comments when finding require tokens
...
Fixes : #4020 , #4022 , #4111
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-05-29 09:57:29 +02:00
Jo-Philipp Wich
f6f4005d0b
luci-base: firewall.js: remove further zone network/name fallback logic
...
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-24 17:33:26 +02:00
Anton Kikin
c00d0d9473
luci-base: ui.js: fix function declaration in nested statement
...
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-24 02:12:20 +03: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
f8cf115d9b
luci-base: optimize some PNG files
...
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-05-07 20:05:52 +02:00
Jo-Philipp Wich
102124115d
luci-base: move old cbi icons to luci-compat
...
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-05-07 19:40:29 +02:00
Jo-Philipp Wich
b34b7fc504
luci-base: replace filebrowser icons with SVG variants
...
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-05-07 19:39:32 +02:00
Jo-Philipp Wich
f0a0d28fdd
luci-base: form.js: forward section ID in CBISectionValue methods
...
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-04 21:34:12 +02:00
Jo-Philipp Wich
915e446c07
luci-base: ui.js: fix UITextfield.setValue()
...
Fixes: d02c26772
("luci-base: ui.js: rework password input handling")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-05-04 21:31:38 +02:00
Jo-Philipp Wich
28cf5cd576
luci-base: firewall.js: fix Zone.addRule()
...
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-05-04 21:29:01 +02:00
Jo-Philipp Wich
4df3a90b3d
luci-base: ui.js: reset scroll position when opening modal overlay
...
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-05-02 23:53:03 +02:00
Jo-Philipp Wich
e3ef463ccd
luci-base: ui.js: fix input value reading for select widgets
...
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-02 23:53:03 +02:00
Jo-Philipp Wich
d02c26772b
luci-base: ui.js: rework password input handling
...
- 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-05-02 23:53:02 +02:00
Jo-Philipp Wich
81effc1112
luci-base: ui.js: assume select widget by default for ListValue widget
...
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-28 15:37:02 +02:00
Jo-Philipp Wich
428e3bd6dc
luci-base: form.js: toggle inactive CSS class on unsatisfied field cells
...
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-28 09:51:54 +02:00
Jo-Philipp Wich
daa318c1b2
luci-base: form.js: ListValue: support widget and orientation properties
...
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-28 09:50:28 +02:00
Jo-Philipp Wich
2fb55e1ab5
luci-base: ui.js: fixes for radio widget type of select element
...
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-28 09:48:34 +02:00
Jo-Philipp Wich
17ffc84a29
luci-base: form.js: allow secondary configs to fail loading
...
Ref: https://forum.openwrt.org/t/luci-rpc-error/61760
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-28 09:47:08 +02:00
Jo-Philipp Wich
a8d85ed71a
luci-base: firewall.js: gracefully handle missing uci configuration
...
Ref: https://forum.openwrt.org/t/luci-rpc-error/61760
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-28 09:47:08 +02:00
Jo-Philipp Wich
551d839f90
luci-base: luci.js: add LuCI.session.getToken()
...
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-26 18:45:58 +02:00
Jo-Philipp Wich
49c6a810e9
luci-base: uci.js: fix section deletion logic
...
- 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-26 18:45:58 +02:00
Jo-Philipp Wich
acae1378a8
luci-base: ui.js: fix textarea width
...
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-20 09:44:14 +02:00
Anton Kikin
7585e5c95a
luci-base: form.js: allow to disable descriptions row in TableSection
...
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-19 13:56:24 +03:00
Anton Kikin
da0e974db5
luci-base: form.js: fix TableSection descriptions row rendering
...
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-19 13:56:24 +03:00
Jo-Philipp Wich
7882f3ebdd
luci-base: ui.js: hide unsatisfied firstchild menu nodes
...
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-18 23:25:22 +02:00
Jo-Philipp Wich
01d8283ece
luci-base: ui.js: order indicators by ID value
...
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-17 09:30:54 +02:00
Jo-Philipp Wich
90a51ab3b9
luci-base: ui.js: add LuCI.ui.menu.flushCache() function
...
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-16 15:13:26 +02:00
Jo-Philipp Wich
46d31efc73
luci-base: ui.js: apply disabled attribute to toplevel dynlist node
...
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-16 13:30:35 +02:00
Jo-Philipp Wich
616d2a61e4
luci-base: luci.js: get rid of global L
references in internal classes
...
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-16 13:30:35 +02:00
Jo-Philipp Wich
930f28b606
luci-base: ui.js: add LuCI.ui.menu helper class
...
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-16 13:30:35 +02:00
Jo-Philipp Wich
51186355ea
luci-base: ui.js: use session data api to persist tab selection state
...
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-16 13:30:35 +02:00
Jo-Philipp Wich
adeb0f3aa6
luci-base: luci.js: disable page action buttons on readonly views
...
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-16 13:30:35 +02:00
Jo-Philipp Wich
b739fc17ea
luci-base: luci.js: add hasViewPermission() helper
...
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-16 13:30:35 +02:00
Jo-Philipp Wich
06af541c37
luci-base: luci.js: fix JSdoc markup issues
...
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-16 13:30:35 +02:00
Jo-Philipp Wich
b0c8221926
luci-base: luci.js: convert various probe* functions to session data api
...
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-16 13:30:35 +02:00
Jo-Philipp Wich
ef718246b1
luci-base: luci.js: add LuCI.session class
...
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-16 13:30:35 +02:00
Jo-Philipp Wich
e385640505
luci-base: luci.js: share environment object among LuCI base classes
...
This allows us to get rid of global `L` references in luci.js itself.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-16 10:49:05 +02:00
Jo-Philipp Wich
0e22d4d87e
luci-base: network.js: don't fail loading network config on missing wireless
...
Fixes : #3914
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-15 09:29:29 +02:00
Jo-Philipp Wich
b9dda90716
Revert "build: luci.mk: gracefully handle missing or unversioned po subdirectories"
...
This reverts commit e6f77d5d72
.
Commit contained unrelated changes.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-14 18:42:36 +02:00
Jo-Philipp Wich
e6f77d5d72
build: luci.mk: gracefully handle missing or unversioned po subdirectories
...
Fixes : #3911
Fixes: 9d8e99f9b
build: gracefully handle non-Git source trees
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-14 18:29:13 +02:00
Jo-Philipp Wich
5c22340f43
luci-base: form.js: make map readonly on insufficient uci permissions
...
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-14 17:13:19 +02:00