Commit graph

2991 commits

Author SHA1 Message Date
Jo-Philipp Wich
0105851235 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>
(cherry picked from commit 0c479891ae)
2020-07-05 00:53:09 +02:00
Karl Palsson
b573f106a1 luci-base: allow themes to provide sysauth.htm
Support for sysauth_template was (inadvertently) dropped in refactorings
to support the json menu construction.  This does not restore that
functionality, which allowed different templates for every node in the
dispatcher tree, but provides an alternative mechanism that allows a
theme to provide a sysauth.htm template file instead.

Tested-by: Karl Palsson <karlp@etactica.com>
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 8f9433127e)
2020-06-30 18:14:13 +02:00
Hannu Nyman
451313eab2 treewide: i18n - backport translations
Backport translations from master.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2020-06-24 23:26:31 +03:00
Hannu Nyman
87da00ae8a treewide: i18n - backport translations
Backport translations from master.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2020-06-15 20:12:48 +03:00
Jo-Philipp Wich
b894a3b9aa luci-base: form.js: fix handling of array sections in JSONMap forms
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 682f628ea6)
2020-06-14 16:42:17 +02:00
Hannu Nyman
f1eeb85be6 treewide: i18n - backport translations
Backport translations from master.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2020-06-03 17:21:23 +03:00
Jo-Philipp Wich
dd9624d35a luci-base: luci.js: properly skip comments when finding require tokens
Fixes: #4020, #4022, #4111
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 6be8f8dbae)
2020-05-29 10:42:24 +02:00
Hannu Nyman
39d5f2e5a6 treewide: i18n - backport translations from master
Backport translations from master.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2020-05-25 18:04:15 +03:00
Anton Kikin
515bd927da 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>
(cherry picked from commit c00d0d9473)
2020-05-24 18:25:00 +02:00
Jo-Philipp Wich
7fca170275 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>
(cherry picked from commit f6f4005d0b)
2020-05-24 17:33:53 +02:00
Jo-Philipp Wich
ccd9d67598 luci-mod-system: make dropbear pages depend on dropbear executable
Fixes: #4052
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(backported from commit c7686d4b3c)
2020-05-17 19:33:54 +02:00
Jo-Philipp Wich
ba0fb08d6d luci-mod-network: fix reading static route table value
Ref: https://forum.openwrt.org/t/static-route-shows-incorrect-table/63514
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 8747513951)
2020-05-13 17:21:31 +02:00
Hannu Nyman
bcdb9fdc7f treewide: i18n - backport translations from master
Backport translations from master

1) i18n-sync to sync 19.07 itself
2) i18n-merge-master to backport from master
3) i18n-sync to clean-up, as merge-master makes also errors
4) revert luci-app-samba that gets mishandled  (removal from master causes ???)

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2020-05-10 16:19:47 +03:00
Hannu Nyman
07e6cfaa89 timezone data: update to 2020a
Update timezone data to 2020a

http://mm.icann.org/pipermail/tz-announce/2020-April/000058.html

2020a:
    Morocco springs forward on 2020-05-31, not 2020-05-24.
    Canada's Yukon advanced to -07 year-round on 2020-03-08.
    America/Nuuk renamed from America/Godthab.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
(cherry picked from commit e5fe16c9ea)
2020-05-09 09:48:06 +03:00
Hannu Nyman
5366acbb6d treewide: i18n - backport translations from master
Backport translations from master.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2020-05-07 22:57:19 +03:00
Hannu Nyman
c835abaa40 treewide: sync translations
Sync translations.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2020-05-07 22:52:56 +03:00
Jo-Philipp Wich
74b3715651 luci-base: optimize some PNG files
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit f8cf115d9b)
2020-05-07 20:06:32 +02:00
Jo-Philipp Wich
618a1df922 luci-base: move old cbi icons to luci-compat
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 102124115d)
2020-05-07 19:40:50 +02:00
Jo-Philipp Wich
20acf73b79 luci-base: replace filebrowser icons with SVG variants
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit b34b7fc504)
2020-05-07 19:40:50 +02:00
Jo-Philipp Wich
f3b7f4101f luci-mod-status: convert menu nodes to JSON
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(backported from commit c698cd5ab9)
2020-05-07 19:40:50 +02:00
Jo-Philipp Wich
cde76b0295 luci-base: implement JSON endpoint to fetch menu information
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
[require authentication for 19.07]
(backported from commit e56e442d6a)
2020-05-07 19:40:50 +02:00
Jo-Philipp Wich
9b71880629 luci-base: expose currently dispatched node info to client side JS
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 94a0c57181)
2020-05-07 19:40:50 +02:00
Jo-Philipp Wich
afad3ccf8f luci-base: convert menu nodes to JSON
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 16853bcd2e)
2020-05-07 19:40:50 +02:00
Jo-Philipp Wich
ec50f8a784 luci-base: ui.js: hide unsatisfied firstchild menu nodes
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 7882f3ebdd)
2020-05-07 19:40:50 +02:00
Jo-Philipp Wich
84e7e46353 luci-base: ui.js: add LuCI.ui.menu.flushCache() function
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 90a51ab3b9)
2020-05-07 19:40:50 +02:00
Jo-Philipp Wich
5ce7daacda luci-base: ui.js: add LuCI.ui.menu helper class
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 930f28b606)
2020-05-07 19:40:50 +02:00
Jo-Philipp Wich
8daa236263 luci-base: ui.js: use standard indicator framework to display uci changes
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit b6e93d54a0)
2020-05-07 19:40:50 +02:00
Jo-Philipp Wich
7159857639 luci-base: luci.js: use standard indicator framework for poll status
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 68b2ce84ec)
2020-05-07 19:40:50 +02:00
Jo-Philipp Wich
e4a8f07501 luci-mod-network: dhcp.js: allow lease hostname to be empty
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 57f27cf7f8)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
4083b78fc6 luci-mod-network: dhcp.js: fix validation logic
The `server` option allows plain IPs besides the `/domain/addr` format.

Fixes: #3870
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 137db1c4d1)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
57d3b3b74a luci-base, luci-mod-network: adjust ZoneSelect / NetworkSelect descriptions
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 45a30c925b)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
29ed1f9121 luci-mod-network: dhcp.js: properly validate hostname values
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 98a9d07d89)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
89ca03f3b1 luci-mod-network: diagnostics.css: use .btn CSS class for buttons
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 41b2fe9f6b)
2020-05-07 19:40:49 +02:00
Kevin Darbyshire-Bryant
c52361b226 luci-mod-network: dnsmasq: correct sense & usage of dnsseccheckunsigned
dnsmasq v2.80 made 'dnssec-check-unsigned' the default, reflect this in
the gui.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
(cherry picked from commit c58ae7d3f4)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
200e2e2e7b luci-mod-system: don't make SSH tabs depend on dropbear uci
This prevents a situation where the tabs will be disabled by the dispatcher
once the last config section has been removed. This would allow a user to
disable SSH via the UI but not to reenable it.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(backported from commit baa3bd4aac)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
0c556476f0 luci-mod-system: password.js: make event handler attachment more robust
Do not expect a specific markup structure but use querySelector() to locate
the input element.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 34c06b4704)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
9964141082 luci-mod-system: convert menu controller to declarative JSON
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit ca295b04e7)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
05ff8e0ec5 luci-mod-system: system.js: rework local time widget markup
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 3afe606743)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
9f4b6f7b92 luci-mod-system: use proper CSS class for map description
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 90990df3b6)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
0bcb9109f2 luci-mod-system: use generic .cbi-section-actions style for row actions
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 9706388c42)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
4ee21feef2 luci-mod-status: index.js: skip includes which failed loading
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit a0db2abea3)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
b26dde0a5c luci-mod-status: tag DHCP lease tables with dedicated CSS classes
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit be62595c5b)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
807fa3b487 luci-mod-status: adjust assoclist markup for easier styling
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit e26b6c8c14)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
4eb411757e luci-mod-status: use generic .cbi-section-actions style for row actions
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 4fa409c7c4)
2020-05-07 19:40:49 +02:00
Howard Su
40a4677a25 luci-base: Show used memory instead of Free
This makes sure solid/blue bar shows the used memory.

Signed-off-by: Howard Su <howard0su@gmail.com>
(cherry picked from commit d09f3b64b2)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
561de16a5d 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>
(backported from commit 17ffc84a29)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
6d072352b3 luci-base: uhttpd.lua: expose all CGI variables
Fixes: #3873
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 465891ff02)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
de5578cb5c luci-base: add missing .btn CSS classes to sysauth template
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 9edb9336d3)
2020-05-07 19:40:49 +02:00
Dirk Brenken
c235829326 luci-base: accept alternative logread location
* minimal change to accept the usual logread location
  plus the alternative location (/usr/sbin/logread)
  used by syslog-ng (see openwrt/packages/issues/11535 for reference)

Signed-off-by: Dirk Brenken <dev@brenken.org>
(cherry picked from commit 085f3f7809)
2020-05-07 19:40:49 +02:00
Ansuel Smith
9c5408499a luci-base: fix error 404 on missing relay protocol
Currently relay.js is included in any case even if
the router doesn't have the needed package to use it.
Fix this by checking if the system has this feature.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
(cherry picked from commit 3d70d3e5d7)
2020-05-07 19:40:49 +02:00
Ansuel Smith
de94bfefbd luci-base: add relayd to getFeature list
Add /sbin/block to the generic Feature list to make
it easily accessible by getProtocolHandlers

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
(cherry picked from commit d8e1aef150)
2020-05-07 19:40:49 +02:00
Howard Su
01f0567951 luci-base: Import latest version of jsmin
Signed-off-by: Howard Su <howard0su@gmail.com>
(cherry picked from commit 9935a5c735)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
7de3420215 luci-base: po2lmo: refactor code
Refactor the po2lmo conversion code to be more robust and to properly
handle input files without location comments.

Ref: 9c1bac4168 (commitcomment-37036663)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 2a1245a497)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
8fe8bfcc16 luci-base: add support for plural translations and contexts in Lua api
- Introduce a new luci.template.parser.ntranslate() function which
   takes a count, a singular and a plural translation string as well
   as an optional context argument and returns the appropriate,
   language specific plural translation.

 - Introduce an optional translation context argument in the existing
   luci.template.parser.translate() function

 - Support translation contexts in LuCI template directives.
   Translation messages are split on the first unescaped pipe
   character and the reamining string after the pipe is treated
   as context.

Examples:

 - `string.format(p.ntranslate(n, "1 apple", "%d apples"), n)` will
   return an appropriate plural translation for the given amount.

 - `translate("Load", "The system load")` will return an appropiate
   translation for `Load`, using `The system load` as disambiguation
   context (a `msgctxt` directive in *.po files).

 - Likewise `<%:Load|The system load%>` will translate the word
   `Load` while using the remainder of the string as context.

 - To use pipes in translations strings literally, they must be
   escaped: `<%:Use the "\|" character%>` will translate the literal
   string `Use the "|" character`.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 9939fc5a26)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
af17f7ef09 luci-base: handle more po format features in po2lmo
- Extract and store the plural calculation function in .lmo files
 - Handle plural translation messages
 - Handle translation contexts

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 9c1bac4168)
2020-05-07 19:40:49 +02:00
David Lam
503ea62a24 luci-base: correct rpcd bad access mode
Corrects the bad access mode from a previous commit that did not allow rpcd luci to execute.

Signed-off-by: David Lam <david@thedavid.net>
(cherry picked from commit cbb1c3cf93)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
13237fee1d luci-base: move tools.webadmin to luci-compat
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 09b2d8a8ac)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
8b8eacf2f5 luci-base: drop unused tools.webadmin.proto class
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 6591b48f8e)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
bb19cb048a luci-base: firewall.js: fix Zone.addRule()
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 28cf5cd576)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
49185a3073 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>
(cherry picked from commit a8d85ed71a)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
2d705b273c 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>
(cherry picked from commit 49c6a810e9)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
b3c0560a93 luci-base: network.js: don't fail loading network config on missing wireless
Fixes: #3914
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 0e22d4d87e)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
7fc5c4aca6 luci-base: tools/widgets.js: honour map readonly property too
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit c89fd0a7f3)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
58e2200cd8 luci-base: tools/widgets.js: honour readonly property
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 0f8e5b2536)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
30c1e5b260 luci-base: uci.js: do not issue malformed uci/delete requests
Fixes: #3912
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit ec3a202b69b5bf5785c0785b2ac39efbe5cae2b7)
(cherry picked from commit 6ae1cd8fdb)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
96e3a03d8e luci-base: uci.js: fix variable clash
Don't overwrite the `r` variable which is supposed to refer to the reordered
uci sections with temporary data for collecting uci add parameters.

Fixes stray uci/get permission errors caused by an attempt to load
nonsensical uci package names.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 55cb5a753b)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
22b3919b05 luci-base: network.js: gracefully handle missing wireless config
Ref: https://github.com/openwrt/luci/issues/3895
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 65d673f467)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
a149076a3d luci-base: rpc.js: add ability to reject nonzero ubus statuses
Add a new declare option `reject` which makes the generated RPC call
function reject with an error in case the remote ubus call returned
a non-zero status.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit bd713f870a)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
0633974a26 luci-base: cbi.js: handle translation contexts in _()
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 5258080ce3)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
c952ef38d2 luci-base: cbi.js: support plural translations and disambiguation contexts
- Implement `N_(count, "String singular", "String plural" [, "Context"])`
   plural translation function.

 - Extend `_()` to optionally accept a second disambiguation context
   argument.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 894752610d)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
f044d2a4a8 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>
(cherry picked from commit f0a0d28fdd)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
750572d630 luci-base: form.js: toggle inactive CSS class on unsatisfied field cells
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 428e3bd6dc)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
dede2a9187 luci-base: form.js: ListValue: support widget and orientation properties
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit daa318c1b2)
2020-05-07 19:40:49 +02:00
Anton Kikin
8c5a3d37bd 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>
(cherry picked from commit 7585e5c95a)
2020-05-07 19:40:49 +02:00
Anton Kikin
09fcfebe70 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>
(cherry picked from commit da0e974db5)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
1c935a9963 luci-base: form.js: implement readonly property for forms and options
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 9279448148)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
4447dea2da luci-base: form.js: improve save error handling
Fixes: #3552
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 2dfcca23e4)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
cd64289554 luci-base: form.js: add documentation
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 698c8ff843)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
581ce6d116 form.js: use CSS .btn class for drag handles
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 5d8970d76c)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
3005b14815 luci-base: form.js: rendering fixes for grid sections
- Ensure that last header cell is rendered for grid sections without
   sorting or addremove actions
 - Don't skip header cells for optional options

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 9bb78b5cd8)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
d51e0d807a luci-base: ui.js: reset scroll position when opening modal overlay
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 4df3a90b3d)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
243c6c525d 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>
(cherry picked from commit e3ef463ccd)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
9be5a3df0b 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>
(cherry picked from commit 81effc1112)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
41d2df511b luci-base: ui.js: fixes for radio widget type of select element
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 2fb55e1ab5)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
e5ebf819da luci-base: ui.js: fix textarea width
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit acae1378a8)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
815824b36b luci-base: ui.js: order indicators by ID value
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 01d8283ece)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
791741f0fb luci-base: ui.js: apply disabled attribute to toplevel dynlist node
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 46d31efc73)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
cd29fdde9e luci-base: ui.js: use session data api to persist tab selection state
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 51186355ea)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
b76269ab8c luci-base: ui.js: add disabled property to widgets
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 86c797041a)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
ac4bb729ab luci-base: ui.js: add generic indicator handling functions
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 4250f99d7f)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
67b2a36e53 luci-base: ui.js: improve mobile dropdown scroll behaviour
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 0fb2f8f1d1)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
ceea8b7d5e luci-base: form.js / ui.js: tie form labels to widgets
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 22ba6fc40933bee02c3ea93bbda952bb44bf3af1)
(cherry picked from commit 82fb5a67d3)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
2c2fdaf6ea luci-base: ui.js: various tweaks
- emit checkbox markup suitable for CSS styling
 - use .btn CSS class where appropriate
 - dispatch events when updating uci change indicator
 - use correct target node when handling events in createHandlerFn()

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 993b4f7950)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
85ac64e08c luci-base: luci.js: get rid of global L references in internal classes
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(backported from commit 616d2a61e4)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
bf4dd8e335 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>
(cherry picked from commit e385640505)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
bef91474bd luci-base: ensure that ubus path uses trailing slash
Without the trailing slash, probing endpoint availability will fail.

Fixes: 529bde440 ("luci-base: make rpc webserver path configurable")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 38289bc975)
2020-05-07 19:40:49 +02:00
Ansuel Smith
14a81ccb63 luci-base: make rpc webserver path configurable
Currently the ubus path that provide the webserver is hardcoded to be /ubus.
Change this to make it configurable from the luci config file.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
(backported from commit 529bde4408)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
e28f94bf01 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>
(cherry picked from commit 551d839f90)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
37d07f52bd luci-base: luci.js: add hasViewPermission() helper
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit b739fc17ea)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
93f9784a04 luci-base: luci.js: fix JSdoc markup issues
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 06af541c37)
2020-05-07 19:40:49 +02:00