Commit graph

11309 commits

Author SHA1 Message Date
Jo-Philipp Wich
3dcb061dcc luci-base: ui.js: fix UISelect.setValue()
Fixes: #2852
Fixes: ce04d7f ("luci-base: fix label-to-input association in js cbi maps")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-12 09:17:14 +02:00
Jo-Philipp Wich
4b941bce40 luci-base: luci.js: only use overrideMimeType when supported
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-11 15:06:13 +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
43043a46a3 luci-base: ui.js: fix UISelect.getValue()
Fixes: #2852
Fixes: ce04d7f04 ("luci-base: fix label-to-input association in js cbi maps")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-11 14:40:51 +02:00
Dirk Brenken
87ff357d4c
luci-app-wireguard: QR-Code enhancements
* explain the QR-Code 'use case' and the transfered information
* limit the QR-Code information to bare minimum (per interface):
  * [Interface] A random, on the fly generated 'PrivateKey',
                the key will not be saved on the router
  * [Peer] The 'PublicKey' of that wg interface and the
           'AllowedIPs' with the default of '0.0.0.0/0, ::/0'
           to allow sending traffic to any IPv4 and IPv6 address
* the QR-Code logic will be processed only once per page load,
  and not every 5 seconds with the regular XHR refresh

See corresponding forum thread:
https://forum.openwrt.org/t/luci-app-wireguard-qr-code-shows-private-key/38133

Signed-off-by: Dirk Brenken <dev@brenken.org>
2019-07-11 08:11:38 +02:00
Paul Spooren
9aa507790e luci-app-bmx7: transfer from routing
The Makefile is minified as the LuCi build system does most of the job.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2019-07-10 17:44:13 +02:00
Jo-Philipp Wich
69e5488c13 luci-base: luci.js: fix undefined "this" when /ubus/ is unavailable
Fixes: #2850
Fixes: 66dfe64ca ("luci-base: luci.js: cache determined RPC base url in session storage")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-10 13:30:52 +02:00
Florian Eckert
1991b4ae64 luci-app-mwan3: rename ubus values
Update status view because of ubus value rename

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2019-07-10 09:18:32 +02:00
Jo-Philipp Wich
b5895e7c63 luci-mod-status: show all interface addresses on index page
Insteado f displaying only the primary/delegated address, display all
configured IP addresses in the upstream interface boxes, similar to
the interface overview page.

Fixes: #2757
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-10 07:15:02 +02:00
Jo-Philipp Wich
66dfe64ca1 luci-base: luci.js: cache determined RPC base url in session storage
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-10 07:15:02 +02:00
Jo-Philipp Wich
ffdafd4800 luci-base: properly handle getWifiNetidBySid() return value
The getWifiNetidBySid() helper returns an array containing the network id
and the corresponding radio name, not just the id.

Fixes: #2846.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-09 17:50:21 +02:00
Hannu Nyman
e5b233f325
Merge pull request #2839 from stangri/master-luci-app-advanced-reboot
luci-app-advanced-reboot: fix README url in Makefile
2019-07-09 18:25:58 +03:00
Jo-Philipp Wich
ce04d7f040 luci-base: fix label-to-input association in js cbi maps
Fixes: #2845
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-09 14:09:22 +02:00
Florian Eckert
9f1757a8af
Merge pull request #2844 from TDT-AG/pr/20190709-luci-app-statistics
luci-app-statistics: fix collectd config generation
2019-07-09 13:59:24 +02:00
Florian Eckert
0633fb23c8 luci-app-statistics: fix collectd config generation
Fix config generation for the following sections:

* curl
* exec
* network
* iptables

Ref: https://github.com/openwrt/packages/issues/9427
Fixes: c1380ab ("make luci-app-statistics more extensible")

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2019-07-09 13:04:06 +02:00
Stan Grishin
7cf35432f1 luci-app-advanced-reboot: fix README url in Makefile
Signed-off-by: Stan Grishin <stangri@melmac.net>
2019-07-08 14:28:19 -07:00
Paul Spooren
da35bfcf54 build: add circleci
This automatically performs formal checks and also checks and compiles
the packages. The resulting packages are then stored as artifacts and
easily testable on running machines.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2019-07-08 18:55:33 +02:00
Jo-Philipp Wich
006f7c7932 luci-base: use native ubus HTTP gateway if available
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-08 17:39:24 +02:00
Jo-Philipp Wich
acbc031a6d luci-base,luci-mod-system: split ubus localtime into get and set call
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-08 17:07:11 +02:00
Jo-Philipp Wich
abee9138de luci-base: add rpcd ACL rules
Add required ACL rules to allow access to the native ubus HTTP
interface directly.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-08 16:25:30 +02:00
Jo-Philipp Wich
8055ed4c46 Revert "luci-base: luasrcdiet: switch to scm clone and fix tarball name"
This reverts commit faa5f0eacd.

Fixes: #2834
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 22:03:28 +02:00
Jo-Philipp Wich
f4c87f4dc4 luci-base: mvalue.htm: fix reading back multi value options
Fixes: 2a229e50c ("luci-base: fix cbi mvalue templates")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 21:27:00 +02:00
Jo-Philipp Wich
2a229e50cf luci-base: fix cbi mvalue templates
Fixes: 9c7eb1dec ("luci-base: switch from server side to client side widget markup")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 21:13:02 +02:00
Jo-Philipp Wich
875a96f653 luci-mod-network: switch hostname configuration to client side js
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 20:14:18 +02:00
Jo-Philipp Wich
91afb6fae2 luci-base: network.js: dynamically calculate IPv4 netmasks
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 20:12:42 +02:00
Jo-Philipp Wich
f970c485cf treewide: switch to shared isObject(), toArray() and sortedKeys() helpers
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 20:11:35 +02:00
Jo-Philipp Wich
37ca6fe6d6 luci-base: luci.js: add isObject(), toArray() and sortedKeys() helper
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 20:10:13 +02:00
Jo-Philipp Wich
d6aa68ae0d luci-mod-network: switch route configuration page to client side view
Also implement extended route attributes via modal dialog.

Fixes: #2695
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 19:12:59 +02:00
Jo-Philipp Wich
bce291e6c9 luci-base: form.js: reload map data when saving modal forms
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 19:12:59 +02:00
Jo-Philipp Wich
f8e6caf552 luci-base: widgets.js: add textvalude representation for network select
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 19:12:59 +02:00
Jo-Philipp Wich
1fad6c0eed
Merge pull request #2806 from dibdot/magic
system-wide: fix escaping of magic chars
2019-07-07 15:39:56 +02:00
Jo-Philipp Wich
e13822e709 luci-base: uci.js: track packages affected by reorder operations
This is required to properly reload the configurations after applying uci
changes that solely consist of uci section ordering operations.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:26 +02:00
Jo-Philipp Wich
f743b96882 luci-theme-bootstrap: add CBI order drag/drop styles
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:26 +02:00
Jo-Philipp Wich
c16609b976 luci-theme-bootstrap: add various CSS tweaks
- Apply the same style to <button> and <input type="button"> elements
 - Increase width of modal CBI dialogs

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:26 +02:00
Jo-Philipp Wich
00a3da1fb3 luci-base: fix regular expression in network.Protocol.getDevices()
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:26 +02:00
Jo-Philipp Wich
9c16090780 luci-app-firewall: switch to client side CBI views
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:26 +02:00
Jo-Philipp Wich
a13dba8071 luci-base: add tools.widgets JS library
Add a tools.widgets library which bundles a number of useful, higher
level CBI widgets like firewall zone list or network interface dropdowns

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:26 +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
0560858380 luci-base: uci.js: add extended section syntax support, improve loading
Add support for extended section syntax notation in @type[#] format and
refactor the package loading function to not load configurations twice
when a package load operation is already pending and another load request
is made for the same package.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:26 +02:00
Jo-Philipp Wich
dc2b38cb6f luci-base: {ui,form}.js: allow passing additional CSS classes to modals
Add the ability to pass additional CSS classes to modal dialogs and
make use of this facility in form.js to annotate CBI map modals.

This can be used later by themes to apply additional CSS rules.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:26 +02:00
Jo-Philipp Wich
1605f29b6f luci-base: luci.js: don't abort finished xhr objects
Calling abort() on a finished xhr object will clear properties such
as status which can confuse code relying on legacy LuCI request
helper functions.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:26 +02:00
Jo-Philipp Wich
0bcb9f9f1d luci-base: cbi.js: fix number rounding in string.format()
Ensure that patterns like %d, %x, %o or %b properly truncate their
operands to whole integers.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:26 +02:00
Jo-Philipp Wich
0539e7f6b9 luci-base: form.js: support placeholders for DynamicList widgets
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:25 +02:00
Jo-Philipp Wich
1482554de6 luci-base: form.js: fix rendering flag values in modals
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:25 +02:00
Jo-Philipp Wich
ff775a69f7 luci-base: form.js: trigger validation before saving cbi map
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:25 +02:00
Jo-Philipp Wich
bf3bf6a8a9 luci-base: form.js: prevent section creation on modal cbi save failure
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:25 +02:00
Jo-Philipp Wich
4a0f8b5541 luci-base: ui.js: fix rendering of rich dropdown placeholders
Placeholders may be HTML elements instead of plain strings, so do
not use innerHTML to assign them but rely on L.dom.content() instead.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:25 +02:00
Jo-Philipp Wich
2f79aa1c35 luci-base: implement further ubus calls
Implement new ubus rpcd backend calls for later use in the frontend:

 - netdevs: dump information about Linux network devices present
 - boardjson: dump /etc/board.json if present
 - offload_support: query whether netfilter offloading is supported

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:25 +02:00
Jo-Philipp Wich
c5b6f42943 luci-base: fix handling of large ubus HTTP requests
Properly handle ubus POST requests exceeding the default chunk size
and fix a possible nil dereference when rejecting incoming requests
due to bad JSON message framing.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:25 +02:00
Jo-Philipp Wich
79be2d57cd luci-base: add client-side implementation of luci.model.firewall
Introduce firewall.js, a client side reimplementation of the
luci.model.firewall class.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:25 +02:00