Commit graph

2446 commits

Author SHA1 Message Date
Jo-Philipp Wich
dab0a11b73 luci-base: form.js: store pointer to parent map in modal overlay map
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-10 15:28:16 +02:00
Jo-Philipp Wich
03f9528847 luci-base: form.js: pass-through promise in handleAdd
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-10 15:28:16 +02:00
Jo-Philipp Wich
18e6b17911 luci-base: network.js: add getHostHints() api
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-10 15:28:16 +02:00
Jo-Philipp Wich
3f93650901 luci-base: use cgi-io and rpcd-mod-file to handle file upload and browsing
Remove the old server side support for file browsing and file uploading
and switch to a client side widget instead which uses XMLHTTPRequests to
upload files via cgi-io and RPC calls for file listing and status queries.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-10 15:28:16 +02:00
Jo-Philipp Wich
1fcf34510a luci-base: cbi.js: handle ui elements which return a promise in render()
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-10 15:28:16 +02:00
Jo-Philipp Wich
6d9a23af60 luci-base: cbi.js: fix unintended number sign overflow in format
Fixes: #3003
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-10 15:28:16 +02:00
Jo-Philipp Wich
642b8277df luci-base: form.js: use createHandlerFn() for click actions
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-10 15:28:16 +02:00
Jo-Philipp Wich
eac8316e0d luci-base: luci.js: use createHandlerFn() for page actions
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-10 15:28:16 +02:00
Jo-Philipp Wich
e14b884771 luci-base: form.js: do not consider inactive fields for dependency checks
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-10 15:28:16 +02:00
Jo-Philipp Wich
aef4bc3a23 luci-base: rpc.js: add getStatusText() call
The new function allows translating an ubus return code into a human
readable error message.

Also report the called object and method on ubus rpc errors.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-10 15:28:16 +02:00
Jo-Philipp Wich
93af8a3af8 luci-base: network.js: fix, rework and improve wireless state handling
- Use new getWirelessDevices rpc method to optimize data fetching
 - Implement further getters to access iwinfo information
 - Implement assoc- and scan list functions
 - Simplify internal data model

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-10 15:28:16 +02:00
Jo-Philipp Wich
8cd40eb1e6 luci-base: add getWirelessDevices() rpc method
The getWirelessDevices() method merges the results of the
network.wireless/status call with corresponding per-radio and
per-network iwinfo data.

This allows to simplify the client side network state model
implementation and saves extraneous rpc roundtrips to fetch
iwinfo data after discovering the wireless devices.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-10 15:28:16 +02:00
Jo-Philipp Wich
8481330e42 luci-base: luci.js: support passing FormData as request payload
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-10 15:28:16 +02:00
Jo-Philipp Wich
d5e6688072 luci-base: luci.js: support registering request progress handlers
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-10 15:28:16 +02:00
Jo-Philipp Wich
88969529f1 luci-base: luci.js: fix L.Poll.remove()
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-10 15:28:16 +02:00
Jo-Philipp Wich
14b6ea6ea7 luci-mod-network: slightly improve static lease config
- Autoselect the matching IPv4 address when initially picking a MAC
 - Add hostname hints in the MAC/IP dropdowns

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-10 15:28:16 +02:00
Jo-Philipp Wich
ac56dc057d luci-base: form.js: use createHandlerFn() for modal button actions
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-10 15:28:16 +02:00
Jo-Philipp Wich
c352fbf5e9 luci-base: form.js: disable write/remove actions for DummyValue widgets
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-10 15:28:16 +02:00
Jo-Philipp Wich
06f4feca1d protocols: drop server side cbi implementations of protocol handlers
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-10 15:28:16 +02:00
Jo-Philipp Wich
e4bc192012 luci-mod-network: switch to client side interface configuration pages
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-10 15:28:16 +02:00
Jo-Philipp Wich
6a2a53a829 protocols: add client side protocol handler implementations
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-10 15:28:16 +02:00
Jo-Philipp Wich
0674fc2041 luci-base: rpcd: add getHostname and getTTYDevices calls
Also add IPv6 feature indication.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-10 15:28:16 +02:00
Jo-Philipp Wich
55b1ae6c9b luci-base: network.js: add hacks to enable relay protocol support
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-10 15:28:16 +02:00
Jo-Philipp Wich
d905dacf97 luci-base: ui.js: update tabs after initial render
This ensures that the error badges are properly set.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-10 15:28:16 +02:00
Jo-Philipp Wich
745878d6cd luci-base: form.js: rework section add/remove event handling
- Redraw map even when it could not be saved due to validation errors
 - Use createHandlerFn() for attaching event handlers
 - Convert buttons to <button> element to allow use of spinning class

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-10 15:28:16 +02:00
Jo-Philipp Wich
b0dde567ca luci-base: ui.js: also handle failed promises in createHandlerFn()
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-10 15:28:16 +02:00
Jo-Philipp Wich
3500562d5e luci-base: ui.js: ignore description when checking for empty tab panes
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-10 15:28:16 +02:00
Jo-Philipp Wich
6b1003cd50 luci-base: luci.js: support custom filter function in dom.isEmpty()
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-10 15:28:16 +02:00
Jo-Philipp Wich
f9074ad68b
Merge pull request #3010 from TDT-AG/pr/20190826-dsl-status-FECS
luci-mod-status: xDSL Status: use new var names dsl.errors_fecs_*
2019-09-03 19:28:53 +02:00
Yurii
5f056678a2
luci-base: fix some Ukrainian translations
Signed-off-by: Yurii <yuripet@gmail.com>
2019-08-26 13:26:36 +03:00
Martin Schiller
5c4a5525c5 luci-mod-status: xDSL Status: use new var names dsl.errors_fecs_*
This is part of the FECS counter fix.

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
2019-08-26 12:03:07 +02:00
Martin Schiller
38d2b31b94 luci-base: fix some german translations
Signed-off-by: Martin Schiller <ms@dev.tdt.de>
2019-08-26 09:05:07 +02:00
INAGAKI Hiroshi
a4c95f6647 luci-base: update Japanese translation
Updated Japanese translations.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2019-08-21 23:44:48 +09:00
INAGAKI Hiroshi
4b40b0d6fc i18n: sync translations
Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2019-08-21 23:07:14 +09:00
Jo-Philipp Wich
2aab85814d luci-base: form.js: implement Textfield widget
Port the CBI Textfield (textarea) widget type to client side form.js

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-08-19 15:06:31 +02:00
Jo-Philipp Wich
afd361e368 luci-base: ui.js: implement Textarea widget
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-08-19 15:04:16 +02:00
Jo-Philipp Wich
f3bcb918bf luci-base: network.js: fix inverted logic in registerErrorCode()
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-08-16 12:01:09 +02:00
Jo-Philipp Wich
24aa675a46 luci-base: widgets.js: CBINetworkSelect: honour exclude option
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-08-16 09:49:11 +02:00
Jo-Philipp Wich
acc2c8d277 luci-base: use native ubus-rpc authorization protocol
Instead of granting complete ubus access under the active sysauth session,
implement the ubus-rpc authorization mechanism and make the ubus proxy
endpoint unauthenticated.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-08-15 16:10:42 +02:00
Jo-Philipp Wich
438d4b95c3 luci-base: add rpc feature tests for sysntpd and zram
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-08-15 16:10:42 +02:00
Jo-Philipp Wich
d19e97bcb0 luci-base: widgets.js: support alias interfaces in CBIDeviceSelect
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-08-14 23:02:25 +02:00
Jo-Philipp Wich
7179d2e6dd luci-base: ui.js: add createHandlerFn() helper
The createHandlerFn() helper function is useful to construct onclick
or similar event handling functions. It will add a "spinning" CSS
class on the event target element and disable the element, wrap the
given function with Promise.resolv() and re-enable the target element
once the promise is settled.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-08-14 22:58:15 +02:00
Jo-Philipp Wich
0d0882aea0 luci-base: network.js: overhaul code
- Rework internal state management
 - Implement new utility functions such as getL3Device() or getModemType()
 - Fix bugs in various functions

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-08-14 22:58:15 +02:00
Jo-Philipp Wich
ed8f1c4c1c luci-app-firewall: honour global default policies in per-zone settings
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-08-14 22:58:15 +02:00
Jo-Philipp Wich
7610f1d9cf luci-base: firewall.js: fix addZone()
When checking for an existing zone with the same name internally,
addZone() must use the nonblocking lookupZone() instead of the
promise returning public getZone() call.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-08-14 22:58:15 +02:00
Jo-Philipp Wich
167ad7bb12 luci-base: rpc: drop offload_support call
It is superseded by the more generic getFeatures method.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-08-14 22:58:15 +02:00
Jo-Philipp Wich
a4621c9520 luci-base: luci.js: introduce hasSystemFeature() api
The new function allows querying the presence of certain system features
such as dnsmasq or firewall availability or the compile time features
of hostapd and wpa_supplicant.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-08-14 22:58:15 +02:00
Jo-Philipp Wich
3b335f2764 luci-base: form.js: support passing a callback to Map.save()
The given callback function will be executed after the map is parsed,
but before the uci is saved. This is useful to add further uci changes
before the map is re-rendered.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-08-14 22:58:15 +02:00
Jo-Philipp Wich
082fd9ff10 luci-base: form.js: implement support for tabbed maps
When .tabbed is set to true on a map, all enclosed sections will be
put into separate tabs.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-08-14 22:58:15 +02:00
Jo-Philipp Wich
b391387ce7 luci-base: form.js: improve ui tab interaction
- Delay initialization of tab groups
 - Tag section nodes with IDs to store per-section tab state

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-08-14 22:58:15 +02:00