Commit graph

12275 commits

Author SHA1 Message Date
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
Chen Minqiang
7a47df9f07 luci-theme-*: set mediaurlbase if it is the first time to be installed
If we build multi-themes into firmware, each of them set itself
to be the default theme, what theme should it be?

To make it clear, we only set mediaurlbase if the theme is the
first time to be installed/built-in.

This resolve the issue that theme always change to somewhat default
after upgrading the firmware even with a config-keep-upgrade

Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
(backported from commit fc150636b9)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
9518d7f8c1 luci-theme-bootstrap: fix dynlist overflows
Fixes: #3795
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(backported from commit 015712bba0)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
7c29f560d5 luci-theme-openwrt: work around cssmin bug breaking the minified CSS.
The cssmin utility incorrectly breaks up calc() expressions when
minifying rules. Avoid the problem by trimming uneeded spaces.

Fixes: #3801
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 63057a08dc)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
d16600ff01 themes: generalize indicator markup and styling
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(backported from commit ccb7e4a4a7)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
f4137a9225 luci-theme-bootstrap: dynamically adjust body margin
Fixes: #3722
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit c99684dff7)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
9988c97812 luci-theme-bootstrap: fixup assoclist styling
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 3b40c582baefcb302fb23ed633ed85ab1ac72a9e)
(cherry picked from commit ca17ec9b4f)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
b26837e462 luci-theme-material: render menu on client side
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 92eecedc8a)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
bf48a64dfd luci-theme-openwrt: render menu on client side
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit ebc99a6ab3)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
212026c76b luci-theme-bootstrap: render menu on client side
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 5db4463ace)
2020-05-07 19:40:49 +02:00
Jo-Philipp Wich
24fcbb3ed4 luci-theme-bootstrap: minor page action alignment fix
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit df38e4505c)
2020-05-07 19:40:49 +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