Commit graph

1126 commits

Author SHA1 Message Date
Yurii
8c0e11d968
luci-base: update Ukrainian translation
Corrected typo.

Signed-off-by: Yurii <yuripet@gmail.com>
2019-10-09 21:08:01 +03:00
Yurii
cccd17c998
luci-base: update Ukrainian translation
Updating Ukrainian translation according the latest sync translation. Сorrections and additions.

Signed-off-by: Yurii <yuripet@gmail.com>
2019-10-09 19:36:05 +03:00
Jo-Philipp Wich
f8c6eb67cd luci-base: fix CSRF prevention for arcombine targets
The dispatcher failed to propagate the child target post security
requirements to the arcombine() dispatch target so far - fix this
by recursively testing the post security requirements.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-10-09 09:55:44 +02:00
Martin Schiller
61cce42299 luci-base: fix typo in german translation
Signed-off-by: Martin Schiller <ms@dev.tdt.de>
2019-10-09 09:00:29 +02:00
Franco Castillo
5eb8334953 luci-base: update Spanish translation
Signed-off-by: Franco Castillo <castillofrancodamian@gmail.com>
2019-10-08 16:47:19 -03:00
INAGAKI Hiroshi
96f37f475c luci-base: update Japanese translation
Updated Japanese translations.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2019-10-09 00:31:03 +09:00
INAGAKI Hiroshi
3d23e6d04f i18n: sync translations
Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2019-10-08 23:47:58 +09:00
Jo-Philipp Wich
e7ca163d7c luci-base: form.js: fix anonymous section table titles
When no section title is defined, the table renderer is supposed to use
the uci section id as fallback when the table section is not declared
to be anonymous.

Fixes: #3147
Fixes: a90bf384b ("luci-base: form.js: harmonize title property handling")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-10-07 19:49:58 +02:00
Jo-Philipp Wich
5cfad8d65b luci-base: form.js: treat inactive options as optional
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-10-07 19:44:22 +02:00
Chen Minqiang
29aad47121 luci-mod-system: refine flash reset
We determine flash reset capability by checking overlayfs in /proc/mounts

Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
2019-10-07 23:37:35 +08:00
Jo-Philipp Wich
1d68853cce luci-base: add reboot rpc call
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-10-07 11:53:39 +02:00
Jo-Philipp Wich
f3ef2ca2eb luci-base: ui.js: add pingDevice() and awaitReconnect() functions
Import these functions from the flash.js for use with other views that
might trigger a device reboot.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-10-07 11:53:39 +02:00
Jo-Philipp Wich
df8078d542 luci-base: ui.js: use common fs.js class for filebrowser operations
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-10-07 11:53:39 +02:00
Jo-Philipp Wich
8776e423d9 luci-base: introduce common fs.js helper class
Introduce a new fs.js helper class to gather filesystem related RPC
operations in a single file.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-10-07 11:53:35 +02:00
Jo-Philipp Wich
1154e755f1 luci-base: luci.js: add resolveDefault() helper
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-10-07 11:48:33 +02:00
Zheng Qian
aed5e932e3 luci-base: zh_CN: update Simplified Chinese translation
Signed-off-by: Zheng Qian <sotux82@gmail.com>
2019-10-03 12:46:29 +08:00
Jo-Philipp Wich
020ac1e08d luci-mod-system: flash.js: fix "rootfs_data" partition detection
The `/sys/devices/virtual/mtd/` information is not available on all
devices so rely on the contents of `/proc/mtd` instead to check for
the existence of the `rootfs_data` partition.

Fixes: #3136
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-10-02 13:02:04 +02:00
Rafał Miłecki
7c108683c6 luci-mod-system: use "system" new "validate_firmware_image" ubus method
This new ubus method provides more properly-formatted details about
firmware file. Use it to check if uploaded image is valid.

The old "sysupgrade --test" method is left for now to provide stderr
output.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
[Added missing ACL, add default value for the ubus failure case]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-10-02 09:46:18 +02:00
Jo-Philipp Wich
b2809cebd8 luci-base: luci.js, rpc.js, uci.js, network.js: add JSDoc annotations
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-10-02 08:59:41 +02:00
Florian Eckert
b7ee57adaf
Merge pull request #3131 from tano-systems/pr/luci-base-i18n-ru
luci-base: update Russian translation
2019-09-30 13:05:07 +02:00
Anton Kikin
2b1b8e7e04 luci-base: update Russian translation
Signed-off-by: Anton Kikin <a.kikin@tano-systems.com>
2019-09-30 13:49:39 +03:00
Jo-Philipp Wich
948ca3712f luci-base: network.js: implement getMeshID() getter
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-30 12:39:33 +02:00
Hannu Nyman
cf887ba62f timezone data: update to 2019c
Update timezone data to 2019c

http://mm.icann.org/pipermail/tz-announce/2019-September/000057.html

2019c:
* Fiji observes DST from 2019-11-10 to 2020-01-12.
* Norfolk Island starts observing Australian-style DST.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2019-09-28 21:51:35 +03:00
Yurii
a56e58f32e
luci-base: update Ukrainian translation
Updating Ukrainian translation according the latest sync translation. Сorrections and additions.

Signed-off-by: Yurii <yuripet@gmail.com>
2019-09-25 22:46:59 +03:00
Franco Castillo
cb1189a2fe luci-base: update Spanish translation
Update Spanish translation.

Signed-off-by: Franco Castillo <castillofrancodamian@gmail.com>
2019-09-25 13:35:44 -03:00
Jo-Philipp Wich
66749b4fe3
Merge pull request #2756 from Ansuel/wps
luci-mod-network: permit WPS push-button on WPA3
2019-09-24 19:56:44 +02:00
Ansuel Smith
9f0f6cbd31
luci-base: update translation with changed string
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2019-09-24 19:40:26 +02:00
Ansuel Smith
6bd7295a46
luci-base: adds italian translation for master description
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2019-09-24 19:10:20 +02:00
Ansuel Smith
3444aae69a
luci-base: sync translations
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2019-09-24 19:10:19 +02:00
Jo-Philipp Wich
2a5c5f47f9 luci-mod-system: reimplement flashops as client side view
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-24 14:21:08 +02:00
Jo-Philipp Wich
809f16d4ce luci-base: network.js: fix deleteNetwork() implementation
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-24 08:02:57 +02:00
Jo-Philipp Wich
186ddfa044 luci-base: form.js: do not inherit map tabbing to nested sections
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-24 08:01:04 +02:00
Jo-Philipp Wich
0068c3bd49 luci-base: form.js: allow overriding remove action in Table/GridSections
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-24 07:59:04 +02:00
Jo-Philipp Wich
158515d5bd luci-base: form.js: do not add title attributes for untitled options
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-22 22:26:36 +02:00
Yurii
b958d2298a
luci-base: update Ukrainian translation
Corrected my typo.

Signed-off-by: Yurii <yuripet@gmail.com>
2019-09-21 21:58:26 +03:00
Florian Eckert
8a2119727b
Merge pull request #3042 from muink/patch-1
luci-base: hosts.js: Update chinese translations
2019-09-21 20:53:08 +02:00
Yurii
e5a15928c7
luci-base: update Ukrainian translation
Update Ukrainian translation according the latest translation resync. Сorrections and additions.

Signed-off-by: Yurii <yuripet@gmail.com>
2019-09-21 21:49:11 +03:00
Hannu Nyman
be43a42486
Merge pull request #3093 from castillofrancodamian/master
luci-base: update Spanish translation
2019-09-21 20:47:32 +03:00
Franco Castillo
61cfa9cb85 luci-base: update Spanish translation
Update Spanish translation.

Signed-off-by: Franco Castillo <castillofrancodamian@gmail.com>
2019-09-21 14:29:54 -03:00
Jo-Philipp Wich
71e265a7f0 luci-mod-system: remplement fstab settings as client side view
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-21 18:36:31 +02:00
Jo-Philipp Wich
54cab2f26b luci-base: add rpc methods for mount management
This commit introduces the new methods luci/getBlockDevices,
luci/setBlockDetect, luci/getMountPoints, luci/setUmount in
preparation for the reworked mount point management.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-21 18:30:34 +02:00
Jo-Philipp Wich
6dba41cadc luci-base: tie cached system features to user session
Store the cached system feature flags keyed by the current session id,
this ensures that the features are refreshed on login.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-21 10:55:54 +02:00
Jo-Philipp Wich
119c6319cb luci-base: network.js: don't batch wireless scan requests
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-21 10:23:37 +02:00
Jo-Philipp Wich
21d1266c53 luci-base: rpc.js: increase default timeout to 20s, allow batch prevention
Support a new option "nobatch: true" in rpc.declare() which prevents the
underlying RPC call from being batched with other calls.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-21 10:23:37 +02:00
Jo-Philipp Wich
afeacdc7df luci-base: luci.js: improve XHR issue diagnostics
Differentiate between request timeouts and other error reasons.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-21 10:23:37 +02:00
INAGAKI Hiroshi
2a1e77e8cb luci-base: update Japanese translation
Updated Japanese translations.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2019-09-21 17:13:11 +09:00
INAGAKI Hiroshi
51b46c3299 luci-base: use old translation for "Gateway Ports"
This text is replaced from "Gateway ports" in
f878b21c8c.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2019-09-21 16:59:44 +09:00
INAGAKI Hiroshi
f894c2601e luci-base: sync translations
Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2019-09-21 14:26:49 +09:00
Jo-Philipp Wich
d10575dfee luci-base: form.js: only update option default if cfgvalue is null
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-20 09:58:31 +02:00
Jo-Philipp Wich
25e0b966c7 luci-base: form.js: add support for dynamic default values
Many uci options have different implicit defaults, depending on the
values of other related options. A prominent example is the wireless
ieee80211w option which defaults to 2, 1 or 0 depending on whether
the encryption is set to wpa3-sae, wpa2/wpa2 mixed or any other mode
respectively.

Add the ability to specify a dictionary of default values and their
corresponding dependencies in order to be able to express such
configurations.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-19 15:40:57 +02:00
Jo-Philipp Wich
4dfa657f77 luci-base: ui.js: mark user-changed widgets
Set a `data-changed=true` attribute on the widget element when the user
did any change to the default value.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-19 15:39:46 +02:00
Jo-Philipp Wich
53ac685092 luci-base: form.js: fix default click action of button options
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-18 15:08:19 +02:00
Jo-Philipp Wich
934fa275b2 luci-base: ensure that button labels are properly html escaped
Fixes: #3067
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-18 13:51:16 +02:00
muink
d07a55931d
luci-base: proto_dhcp.lua: Update chinese translations
Signed-off-by: muink <hukk1996@gmail.com>
2019-09-18 19:35:51 +08:00
Hannu Nyman
7dd6fde57e
Merge pull request #3080 from castillofrancodamian/master
luci-base and apps: update Spanish translation
2019-09-18 09:07:33 +03:00
Jo-Philipp Wich
fd9182b21a luci-base: network.js: filter invalid mac addresses
Only consider valid ethernet mac addresses when building the device state
from raw getifaddrs() information.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-18 07:46:33 +02:00
Jo-Philipp Wich
10880b565f luci-base: network.js: get low level device details from getifaddr() info
Fixes: #3078
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-18 07:19:18 +02:00
Franco Castillo
0183eed288 luci-base and apps: update Spanish translation
Update of the Spanish translation of luci-base and some LuCI applications.

* luci-base
* adblock
* advanced-reboot
* aria2
* banip
* ddns
* firewall
* mjpg-streamer
* mwan3
* ntpc
* simple-adblock
* travelmate
* vpnbypass
* wifischedule
* wireguard

Signed-off-by: Franco Castillo <castillofrancodamian@gmail.com>
2019-09-17 23:40:37 -03:00
Martin Schiller
2cdcec29ff luci-base: fix german translation for factory reset hint
Signed-off-by: Martin Schiller <ms@dev.tdt.de>
2019-09-16 09:32:25 +02:00
Jo-Philipp Wich
9ae9657a85 luci-mod-system: remplement password change as client side view
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-16 07:54:25 +02:00
Jo-Philipp Wich
a31d1d10e0 luci-mod-system: reimplement SSH key mgmt as client side view
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-15 20:00:36 +02:00
Jo-Philipp Wich
3e1cf14ad1 luci-base: add luci/setPassword rpc method, dropbear feature flag
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-16 07:49:05 +02:00
Jo-Philipp Wich
9ecfe33edd luci-base: luci.js: render view buttons depending on available functions
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-17 07:03:27 +02:00
Jo-Philipp Wich
96fbca76c8 luci-base: form.js: implement JSONMap
Implement a new map type JSONMap which uses a JSON data structure instead
of uci as configuration data backend.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-16 07:55:45 +02:00
INAGAKI Hiroshi
f206c01844 luci-base: update Japanese translation
Updated Japanese translations.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2019-09-15 20:08:14 +09:00
INAGAKI Hiroshi
ec631c4960 i18n: sync translations
Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2019-09-15 19:15:17 +09:00
Jo-Philipp Wich
2e206861ae luci-base: luci.js: append version when dynamically loading classes
This allows for some naive cache busting when the LuCI version changes,
to avoid loading outdated classes from cache.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-14 17:44:32 +02:00
Jo-Philipp Wich
208bf47a33 luci-base: cbi.js: update dependencies after widgets have been rendered
Fixes: #3066
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-14 17:20:41 +02:00
Jo-Philipp Wich
7c9d1a259c luci-base: network.js: register "none" protocol
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-14 17:04:02 +02:00
Jo-Philipp Wich
2dd17fad6c luci-base: network.js: implement Hosts.getMACHints()
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-13 14:18:43 +02:00
Jo-Philipp Wich
3734f88c35 luci-base: fix ip6hint option dependencies and validation
Ref: https://forum.openwrt.org/t/odhcpd-make-lease-file-persistent/44118/8
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-13 12:57:08 +02:00
Jo-Philipp Wich
b384683d14
Merge pull request #3060 from tano-systems/pr/update-ru-i18n
luci-base: Update Russian translation
2019-09-13 11:06:30 +02:00
Anton Kikin
8e171a9f3d luci-base: Update Russian translation
Signed-off-by: Anton Kikin <a.kikin@tano-systems.com>
2019-09-13 00:13:04 +03:00
Franco Castillo
da2ec04075 luci-base: update Spanish translation
Signed-off-by: Franco Castillo <castillofrancodamian@gmail.com>
2019-09-12 16:34:11 -03:00
Franco Castillo
37efc4f918 luci-base: update Spanish translation
Signed-off-by: Franco Castillo <castillofrancodamian@gmail.com>
2019-09-12 16:06:32 -03:00
Jo-Philipp Wich
fad01ae1a4 luci-base: sys.lua: fix init script enable action
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-12 18:56:24 +02:00
Jo-Philipp Wich
0e5be0d68a luci-mod-system: reimplent system/crontab as client side view
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-12 18:48:58 +02:00
Jo-Philipp Wich
8178ac15b6 luci-base: whitelist file/write actions on /etc/rc.local
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-12 14:42:12 +02:00
Jo-Philipp Wich
473bd2741b luci-base: rpc.js: fix list requests, handle aborted http requests
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-12 14:02:06 +02:00
Jo-Philipp Wich
cc81d5a0d4 luci-base: fix list method handling in ubus-rpc protocol proxy
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-12 14:00:47 +02:00
Jo-Philipp Wich
2cc6ff7f6b luci-base: drop unused tools.status.switch_status() call
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-12 11:09:57 +02:00
Jo-Philipp Wich
5fd21bc9ef luci-base: add luci/getSwconfigFeatures and luci/getSwconfigPortState
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-12 11:09:57 +02:00
Jo-Philipp Wich
9be42e29e7 luci-base: form.js: handle non-string values in stripTags()
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-12 11:09:57 +02:00
Jo-Philipp Wich
441bd24d07
Merge pull request #3056 from musashino205/l10n/base-upd-ja
luci-base: update Japanese translation
2019-09-12 10:12:33 +02:00
INAGAKI Hiroshi
3b4c4bf415 luci-base: update Japanese translation
Updated Japanese translations.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2019-09-12 16:55:38 +09:00
Yurii
2faa39cee3
luci-base: update Ukrainian translation
Update Ukrainian translation according the latest translation resync. Сorrections and additions.

Signed-off-by: Yurii <yuripet@gmail.com>
2019-09-12 02:46:17 +03:00
Jo-Philipp Wich
5e7e9b58cf luci-base: restore some lost translations and update german
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-11 14:03:11 +02:00
Jo-Philipp Wich
16bcd1a364 luci-base: resync translations
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-11 12:58:18 +02:00
Jo-Philipp Wich
34e73fd983 luci-base: widgets.js: fix display quirk in tools.widgets.DeviceSelect
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-11 12:44:34 +02:00
Jo-Philipp Wich
c96de72043 luci-base: validation.js: implement length() datatype validator
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-11 12:28:58 +02:00
Jo-Philipp Wich
34f2c0acdb luci-base: view.htm: catch and render exceptions on view instantiation
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-11 12:21:51 +02:00
Jo-Philipp Wich
a0d1294566 luci-base: luci.js: register rpc interceptor to catch expired sessions
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-11 12:21:24 +02:00
Jo-Philipp Wich
c3ddcbb542 luci-base: luci.js: rework error handling
- Capture stack trace in L.raise() if passed type is not an Error instance
 - Use L.ui.addNotification in L.error() to render the error message
 - Prevent duplicate error reporting in the ui

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-11 12:21:05 +02:00
Jo-Philipp Wich
f141433f5e luci-base: rpc.js: revamp error handling, add interceptor support
Add two new functions L.rpc.addInterceptor() and L.rpc.removeInterceptor()
which allow to register and remove interceptor functions which are invoked
before the rpc reply result promise is fulfilled.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-11 09:25:11 +02:00
Jo-Philipp Wich
94a9f600d3 luci-base: ui.js: implement addNotification() helper
The L.ui.addNotification() function pushes a dismissable banner message to
the top of the view.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-11 09:22:13 +02:00
Jo-Philipp Wich
5dc61be746 luci-base: replace luci/getHostname with generic file/read rpc operation
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-10 15:29:15 +02:00
Jo-Philipp Wich
9cae3b9e67 protocols: replace luci/getTTYDevices calls with generic file/list ones
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-10 15:29:04 +02:00
Jo-Philipp Wich
5697ebbef5 luci-base: add hostapd/wpa_supplicant cli feature flags
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-10 15:28:16 +02:00
Jo-Philipp Wich
963b7636b4 luci-mod-network: switch to client side wifi configuration pages
Rewrite the wireless network management views in client side JS using ubus
rpc calls for the router communication.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-10 15:28:16 +02:00
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
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
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
muink
6221b1bdaa
luci-base: hosts.js: Update chinese translations
Signed-off-by: muink <hukk1996@gmail.com>
2019-09-06 21:33:30 +08: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
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
Jo-Philipp Wich
c2eba00a10 luci-base: ui.js: rework tab state handling
Properly preserve the selection state of nested tabs.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-08-14 22:58:15 +02:00
Jo-Philipp Wich
fb18c278a4 luci-base: form.js: CBISectionValue: properly forward dependency checks
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-08-14 22:58:15 +02:00
Jo-Philipp Wich
43a8c12f04 luci-base: ui.js: UISelect: fix check for empty choices
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-08-14 22:58:15 +02:00
Jo-Philipp Wich
5628329434 luci-base: form.js: allow overriding empty section placeholder rendering
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-08-14 22:58:15 +02:00