oweals/luci.git
6 years agoluci-app-opkg: allow presetting filter via query attribute
Jo-Philipp Wich [Thu, 22 Nov 2018 07:57:09 +0000 (08:57 +0100)]
luci-app-opkg: allow presetting filter via query attribute

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoluci-mod-system: move password and sshkey JS code into external files
Jo-Philipp Wich [Wed, 21 Nov 2018 19:04:55 +0000 (20:04 +0100)]
luci-mod-system: move password and sshkey JS code into external files

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoluci-app-opkg: move JS code into external file
Jo-Philipp Wich [Wed, 21 Nov 2018 19:01:54 +0000 (20:01 +0100)]
luci-app-opkg: move JS code into external file

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoluci-base: cbi.js: remove functions moved to luci.js
Jo-Philipp Wich [Wed, 21 Nov 2018 19:27:08 +0000 (20:27 +0100)]
luci-base: cbi.js: remove functions moved to luci.js

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoluci-base: introduce common JavaScript api
Jo-Philipp Wich [Wed, 21 Nov 2018 17:44:59 +0000 (18:44 +0100)]
luci-base: introduce common JavaScript api

Introduce a new script file luci.js which is included by default and
intended to be the common location of functions currently scattered
in cbi.js and xhr.js.

The luci.js file provides a LuCI() class which - among other things -
implements helpers to construct URL paths and making HTTP requests.

A singleton instance of the class is instantiated as window.L upon
load and preset with the necessary environment information.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agobuild: add build option to minify *.js files
Jo-Philipp Wich [Wed, 21 Nov 2018 17:30:14 +0000 (18:30 +0100)]
build: add build option to minify *.js files

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoMerge pull request #2323 from musashino205/l10n/base-upd-ja
Dirk Brenken [Thu, 22 Nov 2018 11:09:52 +0000 (12:09 +0100)]
Merge pull request #2323 from musashino205/l10n/base-upd-ja

luci-base: update Japanese translation

6 years agoMerge pull request #2317 from TDT-AG/pr/20181121-luci-app-openvpn
Dirk Brenken [Thu, 22 Nov 2018 11:09:19 +0000 (12:09 +0100)]
Merge pull request #2317 from TDT-AG/pr/20181121-luci-app-openvpn

luci-app-openvpn: redirect to overview page on save/apply, hide boolean by default and cleanup code

6 years agoluci-app-openvpn: do not show all boolean option by default 2317/head
Florian Eckert [Thu, 22 Nov 2018 09:53:55 +0000 (10:53 +0100)]
luci-app-openvpn: do not show all boolean option by default

If a new instance is edit then all boolean option are shown on the LuCI.
This is confusing. To fix this hide all boolean ellements on the config
page which are not enabled by default. They must be add first.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
6 years agoluci-base: update Japanese translation 2323/head
INAGAKI Hiroshi [Thu, 22 Nov 2018 07:27:00 +0000 (16:27 +0900)]
luci-base: update Japanese translation

Updated Japanese translations.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
6 years agoluci-app-openvpn: On apply/save redirect to OpenVPN overview page
Florian Eckert [Wed, 21 Nov 2018 12:15:29 +0000 (13:15 +0100)]
luci-app-openvpn: On apply/save redirect to OpenVPN overview page

This change will redirect on apply/save to the OpenVPN overview page.
This is the default behaviour on LuCI.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
6 years agoluci-app-openvpn: sync code style with openvpn-advanced
Florian Eckert [Wed, 21 Nov 2018 11:46:29 +0000 (12:46 +0100)]
luci-app-openvpn: sync code style with openvpn-advanced

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
6 years agoluci-app-openvpn: fix whitespaces in openvpn-basic
Florian Eckert [Wed, 21 Nov 2018 11:42:10 +0000 (12:42 +0100)]
luci-app-openvpn: fix whitespaces in openvpn-basic

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
6 years agoluci-app-statistics: update and fix Russian translation
Anton Kikin [Wed, 21 Nov 2018 19:24:00 +0000 (22:24 +0300)]
luci-app-statistics: update and fix Russian translation

Signed-off-by: Anton Kikin <a.kikin@tano-systems.com>
[ Fixed too wide line lengths with i18n-sync.pl ]
Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
6 years agoMerge pull request #2319 from tano-systems/luci-base-upd-rus-i18n
Hannu Nyman [Wed, 21 Nov 2018 17:17:57 +0000 (19:17 +0200)]
Merge pull request #2319 from tano-systems/luci-base-upd-rus-i18n

luci-base: update Russian translation

6 years agoMerge pull request #2307 from dibdot/ovpn
Dirk Brenken [Wed, 21 Nov 2018 14:51:19 +0000 (15:51 +0100)]
Merge pull request #2307 from dibdot/ovpn

luci-app-openvpn: more changes & fixes

6 years agoluci-app-openvpn: more changes & fixes 2307/head
Dirk Brenken [Mon, 19 Nov 2018 20:20:22 +0000 (21:20 +0100)]
luci-app-openvpn: more changes & fixes

* fix possible exception in template based ovpn creation
* remove needless shellquote function in controller,
  the filename will be checked on client side with JS
* enhance FileUpload behaviour in basic/advanced mode:
  - change "auth_user_pass" to FileUpload
  - cfg entries (even with default values) will be shown
  - existing entries are now removable (incl. file unlink),
    simply clear the appropriate textbox
* change "key_direction" option to boolean ListValue
* add "config" option to basic/advanced edit,
  to make it possible to change the upload path in LuCI

Signed-off-by: Dirk Brenken <dev@brenken.org>
6 years agoluci-base: update Russian translation 2319/head
Anton Kikin [Tue, 20 Nov 2018 16:59:48 +0000 (19:59 +0300)]
luci-base: update Russian translation

Signed-off-by: Anton Kikin <a.kikin@tano-systems.com>
6 years agoMerge pull request #2316 from sotux/master-aria2
Jo-Philipp Wich [Wed, 21 Nov 2018 10:21:55 +0000 (11:21 +0100)]
Merge pull request #2316 from sotux/master-aria2

luci-app-aria2: add button for to AriaNg

6 years agoluci-app-aria2: add a button to open ariang 2316/head
Zheng Qian [Wed, 21 Nov 2018 02:48:32 +0000 (10:48 +0800)]
luci-app-aria2: add a button to open ariang

Signed-off-by: Zheng Qian <sotux82@gmail.com>
6 years agoMerge pull request #2313 from sotux/master
Hannu Nyman [Wed, 21 Nov 2018 05:41:19 +0000 (07:41 +0200)]
Merge pull request #2313 from sotux/master

i18n: luci-base: update Simplified Chinese translation

6 years agoMerge pull request #2315 from musashino205/l10n/opkg-upd-ja
Hannu Nyman [Wed, 21 Nov 2018 05:39:45 +0000 (07:39 +0200)]
Merge pull request #2315 from musashino205/l10n/opkg-upd-ja

luci-app-opkg: fix and update Japanese translation

6 years agoluci-app-opkg: fix and update Japanese translation 2314/head 2315/head
INAGAKI Hiroshi [Wed, 21 Nov 2018 03:30:36 +0000 (12:30 +0900)]
luci-app-opkg: fix and update Japanese translation

Fixed and updated Japanese translations.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
6 years agoi18n: luci-base: update Simplified Chinese translation 2313/head
Zheng Qian [Wed, 21 Nov 2018 00:40:52 +0000 (08:40 +0800)]
i18n: luci-base: update Simplified Chinese translation

Signed-off-by: Zheng Qian <sotux82@gmail.com>
6 years agoluci-theme-bootstrap, luci-theme-openwrt: allow dynlist .add-item to expand
Jo-Philipp Wich [Tue, 20 Nov 2018 12:31:58 +0000 (13:31 +0100)]
luci-theme-bootstrap, luci-theme-openwrt: allow dynlist .add-item to expand

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoluci-app-opkg: use a more appropriate german translation for "clear"
Jo-Philipp Wich [Tue, 20 Nov 2018 12:20:52 +0000 (13:20 +0100)]
luci-app-opkg: use a more appropriate german translation for "clear"

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoluci-mod-system: submit password change on enter
Jo-Philipp Wich [Tue, 20 Nov 2018 10:54:22 +0000 (11:54 +0100)]
luci-mod-system: submit password change on enter

Allow to submit the password change form by pressing enter in the second
input field.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoluci-base: resync translations
Jo-Philipp Wich [Tue, 20 Nov 2018 10:46:17 +0000 (11:46 +0100)]
luci-base: resync translations

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoluci-app-opkg: resync translations
Jo-Philipp Wich [Tue, 20 Nov 2018 10:45:43 +0000 (11:45 +0100)]
luci-app-opkg: resync translations

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoluci-base: fix apply/rollback strings
Jo-Philipp Wich [Tue, 20 Nov 2018 10:43:20 +0000 (11:43 +0100)]
luci-base: fix apply/rollback strings

Commit 94d8c9a7a accidentally overwrite the rewording of strings made in
an earlier commit.

Fixes: 94d8c9a7a ("luci-base: simplify apply widget code")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoluci-mod-system: restructure administration pages
Jo-Philipp Wich [Tue, 20 Nov 2018 09:50:03 +0000 (10:50 +0100)]
luci-mod-system: restructure administration pages

Split password, dropbear and SSH key configuration into separate pages in
order to improve the form layout and to simplify the code.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoMerge pull request #2308 from YuriPet/master
Jo-Philipp Wich [Tue, 20 Nov 2018 07:18:27 +0000 (08:18 +0100)]
Merge pull request #2308 from YuriPet/master

opkg.po: update Ukrainian translation

6 years agoopkg.po: update Ukrainian translation 2308/head
Yurii [Mon, 19 Nov 2018 22:51:38 +0000 (00:51 +0200)]
opkg.po: update Ukrainian translation

Signed-off-by: Yurii yuripet@gmail.com
6 years agoMerge pull request #2304 from ryu0/master
Dirk Brenken [Mon, 19 Nov 2018 15:51:44 +0000 (16:51 +0100)]
Merge pull request #2304 from ryu0/master

luci-app-lxc: add i686 to target map

6 years agoluci-app-lxc: add i686 to target map 2304/head
James Buren [Sun, 18 Nov 2018 20:57:37 +0000 (14:57 -0600)]
luci-app-lxc: add i686 to target map
Add i686 to target map so i386 container templates are usable.

Signed-off-by: James Buren <ryuo@ryuo.xyz>
6 years agoluci-base: further hash calculation signedness bugfixes
Jo-Philipp Wich [Mon, 19 Nov 2018 12:28:52 +0000 (13:28 +0100)]
luci-base: further hash calculation signedness bugfixes

 - cbi.js: make sure to treat single bytes as signed char when
   handling end cases

 - template_lmo.c: make sure to treat single bytes as signed
   char when handling end cases, avoids hash miscalculations
   on ARM

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoluci-base: cbi.js: fix sfh() signedness bug for strings with 3 trailing bytes
Jo-Philipp Wich [Mon, 19 Nov 2018 10:58:17 +0000 (11:58 +0100)]
luci-base: cbi.js: fix sfh() signedness bug for strings with 3 trailing bytes

Replace a sign-propagating right shift by a zero-filling right shift to avoid
calculating a wrong hash code in the three-trailing-bytes case.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoluci-base: cbi.js: fix sfh() hash calculation over multibyte sequences
Jo-Philipp Wich [Mon, 19 Nov 2018 10:47:18 +0000 (11:47 +0100)]
luci-base: cbi.js: fix sfh() hash calculation over multibyte sequences

The C side implementation of the hash operates on bytes while the JS variant
operated on UTF-16 codepoints, leading to miscalculations on input strings
containing multibyte sequences.

Recode the given string to an internal UTF-8 byte representation and
calculate the hash over that.

Fixes client side mapping of translation strings containing non-ASCII
characters.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoluci-app-opkg: accesibility fixes
Jo-Philipp Wich [Mon, 19 Nov 2018 08:26:27 +0000 (09:26 +0100)]
luci-app-opkg: accesibility fixes

 - Use semantic button markup for buttons
 - Add ARIA labels to page forward/backward buttons

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoMerge pull request #2306 from yglb/master
Jo-Philipp Wich [Mon, 19 Nov 2018 06:51:06 +0000 (07:51 +0100)]
Merge pull request #2306 from yglb/master

luci-theme-rosy: Repair form bug

6 years agoluci-theme-luci: Match css to implement related styles 2306/head
Yanlan Shen [Mon, 19 Nov 2018 05:37:36 +0000 (13:37 +0800)]
luci-theme-luci: Match css to implement related styles

Signed-off-by: Yanlan Shen <yanlan.shen.@rosinson.com>
6 years agoluci-theme-rosy: Modifying the form does not fully display the bug of the dropdown box
Yanlan Shen [Mon, 19 Nov 2018 05:34:31 +0000 (13:34 +0800)]
luci-theme-rosy: Modifying the form does not fully display the bug of the dropdown box

Signed-off-by: Yanlan Shen <yanlan.shen.@rosinson.com>
6 years agoMerge pull request #2299 from dibdot/banip
Dirk Brenken [Sat, 17 Nov 2018 15:57:55 +0000 (16:57 +0100)]
Merge pull request #2299 from dibdot/banip

luci-app-banip: sync with update 0.0.6

6 years agoluci-mod-status: fix average calculations
Jo-Philipp Wich [Sat, 17 Nov 2018 13:54:43 +0000 (14:54 +0100)]
luci-mod-status: fix average calculations

Calculate the average over the actual data and not over the entire timeframe.

Fixes #2301
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoMerge pull request #2298 from YuriPet/master
Hannu Nyman [Fri, 16 Nov 2018 21:00:02 +0000 (23:00 +0200)]
Merge pull request #2298 from YuriPet/master

luci-base: update Ukrainian translation

6 years agoMerge pull request #2297 from tano-systems/fix-fstab-mount-table
Jo-Philipp Wich [Fri, 16 Nov 2018 20:37:35 +0000 (21:37 +0100)]
Merge pull request #2297 from tano-systems/fix-fstab-mount-table

luci-mod-system: fstab: fix table cell rendering without unmount button

6 years agoluci-mod-system: fstab: fix table cell rendering without unmount button 2297/head
Anton Kikin [Fri, 16 Nov 2018 18:13:14 +0000 (21:13 +0300)]
luci-mod-system: fstab: fix table cell rendering without unmount button

Signed-off-by: Anton Kikin <a.kikin@tano-systems.com>
6 years agoluci-base: xhr.js: rework class, handle expired session
Jo-Philipp Wich [Fri, 16 Nov 2018 18:31:07 +0000 (19:31 +0100)]
luci-base: xhr.js: rework class, handle expired session

Drop very old IE compat code, restructure class, align code style with
other files and properly handle JSON mimetypes with charset trailer.

Also detect session related 403 errors and show a modal prompting
to re-login.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoluci-base: dispatcher: add login indication on 403 errors
Jo-Philipp Wich [Fri, 16 Nov 2018 18:33:39 +0000 (19:33 +0100)]
luci-base: dispatcher: add login indication on 403 errors

Send a custom LuCI X-Header to indicate that a login is required to access
the requested resource. This is mainly intended for xhr.js to be able to
intercept such responses and popup an authentication dialog.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoluci-theme-bootstrap: remove redundant rules
Jo-Philipp Wich [Fri, 16 Nov 2018 18:29:33 +0000 (19:29 +0100)]
luci-theme-bootstrap: remove redundant rules

Drop rules specific to the old status page progress bars and rework the
cbi element rules to work independently of a parent form tag.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoluci-app-banip: sync with update 0.0.6 2299/head
Dirk Brenken [Fri, 16 Nov 2018 20:09:14 +0000 (21:09 +0100)]
luci-app-banip: sync with update 0.0.6

* add a manual interface selection to support
  multiple WAN interfaces in iptables rules

Signed-off-by: Dirk Brenken <dev@brenken.org>
6 years agoluci-base: update Ukrainian translation 2298/head
Yurii [Fri, 16 Nov 2018 19:59:41 +0000 (21:59 +0200)]
luci-base: update Ukrainian translation

Signed-off-by: Yurii yuripet@gmail.com
6 years agoMerge pull request #2296 from tano-systems/luci-base-upd-rus-i18n
Hannu Nyman [Fri, 16 Nov 2018 16:57:15 +0000 (18:57 +0200)]
Merge pull request #2296 from tano-systems/luci-base-upd-rus-i18n

luci-base: update Russian translation

6 years agoluci-base: update Russian translation 2296/head
Anton Kikin [Fri, 16 Nov 2018 16:50:46 +0000 (19:50 +0300)]
luci-base: update Russian translation

Signed-off-by: Anton Kikin <a.kikin@tano-systems.com>
6 years agoMerge pull request #2293 from musashino205/l10n/opkg-upd-ja
Hannu Nyman [Fri, 16 Nov 2018 16:27:50 +0000 (18:27 +0200)]
Merge pull request #2293 from musashino205/l10n/opkg-upd-ja

luci-app-opkg: update Japanese translation

6 years agoMerge pull request #2295 from musashino205/l10n/base-upd-ja
Jo-Philipp Wich [Fri, 16 Nov 2018 14:17:25 +0000 (15:17 +0100)]
Merge pull request #2295 from musashino205/l10n/base-upd-ja

luci-base: update Japanese translation

6 years agoluci-base: update Japanese translation 2295/head
INAGAKI Hiroshi [Fri, 16 Nov 2018 14:09:24 +0000 (23:09 +0900)]
luci-base: update Japanese translation

Updated Japanese translations.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
6 years agoluci-app-opkg: update Japanese translation 2293/head
INAGAKI Hiroshi [Fri, 16 Nov 2018 10:59:41 +0000 (19:59 +0900)]
luci-app-opkg: update Japanese translation

Updated Japanese translations.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
6 years agoMerge pull request #2292 from dibdot/banip
Dirk Brenken [Fri, 16 Nov 2018 08:07:11 +0000 (09:07 +0100)]
Merge pull request #2292 from dibdot/banip

luci-app-banip: adapt latest css changes

6 years agoMerge pull request #2291 from dibdot/adblock
Dirk Brenken [Fri, 16 Nov 2018 08:06:54 +0000 (09:06 +0100)]
Merge pull request #2291 from dibdot/adblock

luci-app-adblock: adapt latest css changes

6 years agoMerge pull request #2290 from dibdot/travelmate
Dirk Brenken [Fri, 16 Nov 2018 08:06:38 +0000 (09:06 +0100)]
Merge pull request #2290 from dibdot/travelmate

luci-app-travelmate: adapt latest css changes

6 years agoluci-app-travelmate: adapt latest css changes 2290/head
Dirk Brenken [Fri, 16 Nov 2018 08:03:41 +0000 (09:03 +0100)]
luci-app-travelmate: adapt latest css changes

Signed-off-by: Dirk Brenken <dev@brenken.org>
6 years agoluci-app-adblock: adapt latest css changes 2291/head
Dirk Brenken [Fri, 16 Nov 2018 07:56:32 +0000 (08:56 +0100)]
luci-app-adblock: adapt latest css changes

Signed-off-by: Dirk Brenken <dev@brenken.org>
6 years agoluci-app-banip: adapt latest css changes 2292/head
Dirk Brenken [Fri, 16 Nov 2018 07:55:46 +0000 (08:55 +0100)]
luci-app-banip: adapt latest css changes

Signed-off-by: Dirk Brenken <dev@brenken.org>
6 years agoluci-theme-openwrt: modal display fixes
Jo-Philipp Wich [Thu, 15 Nov 2018 22:00:34 +0000 (23:00 +0100)]
luci-theme-openwrt: modal display fixes

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoluci-base: rename "Design" to "Theme" in translation files
Angus Ding [Thu, 15 Nov 2018 18:26:12 +0000 (19:26 +0100)]
luci-base: rename "Design" to "Theme" in translation files

Signed-off-by: Angus Ding <angus.ding@gmail.com>
[squash commits, reword commit message, rebase, msgmerge]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoluci-mod-system: rename "Design" to "Theme"
Angus Ding [Mon, 22 Oct 2018 05:40:51 +0000 (13:40 +0800)]
luci-mod-system: rename "Design" to "Theme"

This provides a more accurate description for the theme selection.

Signed-off-by: Angus Ding <angus.ding@gmail.com>
[reword commit message]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agotreewide: resync translation files
Jo-Philipp Wich [Thu, 15 Nov 2018 18:14:56 +0000 (19:14 +0100)]
treewide: resync translation files

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoluci-mod-network: function name mismatch fixed
Darius [Fri, 9 Nov 2018 10:38:33 +0000 (12:38 +0200)]
luci-mod-network: function name mismatch fixed

Signed-off-by: Darius <jok.darius@gmail.com>
6 years agoluci-app-vpnbypass: add german translation
Matthias84 [Sun, 11 Nov 2018 17:30:34 +0000 (18:30 +0100)]
luci-app-vpnbypass: add german translation

Submitted-by: Matthias Meißer <Matthias84@users.noreply.github.com>
[slightly reword subject]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoluci-app-wireguard: add german translation
Matthias84 [Sat, 10 Nov 2018 19:43:04 +0000 (20:43 +0100)]
luci-app-wireguard: add german translation

Submitted-by: Matthias84 <Matthias84@users.noreply.github.com>
[reword commit message]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoluci-base: support disconnecting (deauthenticating) wireless clients
Wang805447391 [Mon, 12 Nov 2018 07:03:31 +0000 (15:03 +0800)]
luci-base: support disconnecting (deauthenticating) wireless clients

Add a button to each row in the wireless assoclist table to allow
disconnecting clients using the ubus del_client method if the underlying
radio interface supports it.

Ref: https://github.com/openwrt/luci/pull/2271
Submitted-by: Wang805447391 <805447391@qq.com>
[move deauth function to luci-base next to the existing assoclist function,
 require post security, fix parameter check condition, hide button if not
 supported by the radio, disable button after call, squash commits, fix
 whitespace, reword subject, add commit message]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoluci-app-https_dns_proxy: fix datatype of subnet address option
alphakk [Thu, 15 Nov 2018 04:06:09 +0000 (12:06 +0800)]
luci-app-https_dns_proxy: fix datatype of subnet address option

The datatype ip4prefix only accept numbers from 0 to 32, not subnet/mask
(i.e. 192.168.1.0/24), this affects option "-e".

https://github.com/openwrt/luci/wiki/Datatypes#ip4prefix the description
is wrong, according to src
http://luci.subsignal.org/trac/browser/luci/branches/luci-0.10/libs/web/luasrc/cbi/datatypes.lua#L76

Submitted-by: alphakk <kkspaces@mail.com>
[slightly reword commit message]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoluci-proto-vpnc: expose defaultroute option in proto_vpnc.lua
Whitronic [Thu, 8 Nov 2018 11:25:43 +0000 (11:25 +0000)]
luci-proto-vpnc: expose defaultroute option in proto_vpnc.lua

Sometimes people only want the VPN connection to be a route to a specific
network, not the default gateway for all traffic.

I've tested this on my router and works fine!

Submitted-by: Whitronic <joao.f.vieira@gmail.com>
[reword commit message]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoMerge pull request #2286 from kevinoid/fix_statistics_filename_quoting
Jo-Philipp Wich [Thu, 15 Nov 2018 06:14:06 +0000 (07:14 +0100)]
Merge pull request #2286 from kevinoid/fix_statistics_filename_quoting

luci-app-statistics: quote : in filenames for DEF

6 years agoluci-app-statistics: quote : in filenames for DEF 2286/head
Kevin Locke [Wed, 14 Nov 2018 23:55:24 +0000 (16:55 -0700)]
luci-app-statistics: quote : in filenames for DEF

: is used to delimit fields in DEF: rrd instructions, so when it appears
in a filename it must be escaped using \.[1]  This commit adds the
escaping.

I discovered the issue after configuring collectd-mod-ping to monitor an
IPv6 host (2001:19f0:5:727:5b56:205d:ff55:2208).  Accessing
https://192.168.0.1/cgi-bin/luci/admin/statistics/graph/ping would cause
the following messages to be logged:

    Wed Nov 14 23:04:33 2018 daemon.err uhttpd[30261]: ERROR: can't parse DEF '2ping_avg_raw=/tmp/rrd/openwrthost/ping/ping-2001:19f0:5:727:5b56:205d:ff55:2208.rrd:value:AVERAGE' -2
    Wed Nov 14 23:04:33 2018 daemon.err uhttpd[30261]: ERROR: can't parse DEF '2ping_droprate_avg_raw=/tmp/rrd/openwrthost/ping/ping_droprate-2001:19f0:5:727:5b56:205d:ff55:2208.rrd:value:AVERAGE' -2

and the graphs would not display.  After applying this commit, the
graphs display correctly and no messages are logged.

1.  https://oss.oetiker.ch/rrdtool/doc/rrdgraph_data.en.html#IDEF

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
6 years agoluci-base: fix some long standing german mistranslations
Jo-Philipp Wich [Wed, 14 Nov 2018 20:03:40 +0000 (21:03 +0100)]
luci-base: fix some long standing german mistranslations

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoluci-mod-network: require unique MACs for DHCP leases
Jo-Philipp Wich [Wed, 14 Nov 2018 19:59:26 +0000 (20:59 +0100)]
luci-mod-network: require unique MACs for DHCP leases

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoluci-base: datatypes: add "unique" dummy validator
Jo-Philipp Wich [Wed, 14 Nov 2018 19:58:32 +0000 (20:58 +0100)]
luci-base: datatypes: add "unique" dummy validator

Add a dummy validator for the server side so that we can start using unique
in client side JS code.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoMerge pull request #2259 from pmelange/luci-app-olsr-new-json-lib
Jo-Philipp Wich [Wed, 14 Nov 2018 19:50:03 +0000 (20:50 +0100)]
Merge pull request #2259 from pmelange/luci-app-olsr-new-json-lib

update luci-app-olsr to the new jsoninfo library

6 years agoMerge pull request #2282 from TDT-AG/pr/20181114-luci-base
Jo-Philipp Wich [Wed, 14 Nov 2018 19:48:15 +0000 (20:48 +0100)]
Merge pull request #2282 from TDT-AG/pr/20181114-luci-base

luci-base: allow optional default value for file browser

6 years agoluci-lib-ipkg: move out of luci-base
Jo-Philipp Wich [Wed, 14 Nov 2018 13:35:01 +0000 (14:35 +0100)]
luci-lib-ipkg: move out of luci-base

Move the old luci.model.ipkg utility class into a separate package and
let the components using it depend on the new library package.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoluci-mod-system: replace builtin opkg support with luci-app-opkg
Jo-Philipp Wich [Wed, 14 Nov 2018 13:07:41 +0000 (14:07 +0100)]
luci-mod-system: replace builtin opkg support with luci-app-opkg

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoluci-mod-system: use luci.sys.process.exec() in system controller
Jo-Philipp Wich [Wed, 14 Nov 2018 12:48:59 +0000 (13:48 +0100)]
luci-mod-system: use luci.sys.process.exec() in system controller

Switch the system controller to the common luci.sys.process.exec() function
and drop the local ltn12_popen() and fork_exec() helpers.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoluci-mod-system: prevent comment injection in mtdbackup endpoint
Jo-Philipp Wich [Wed, 14 Nov 2018 12:37:51 +0000 (13:37 +0100)]
luci-mod-system: prevent comment injection in mtdbackup endpoint

Rework the parameter handling to both prevent a crash when no parameter is
given and to prevent root command injection through the mtd index part of
the parameter value.

Fixes: 9840d310e ("modules: add backup module for mtdblock devices")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoapplications: add luci-app-opkg
Jo-Philipp Wich [Wed, 14 Nov 2018 08:53:15 +0000 (09:53 +0100)]
applications: add luci-app-opkg

Add a new luci-app-opkg which is a feature-complete replacement for the
builtin opkg functionality of luci-mod-system using mostly client side
JavaScript to reduce the amount of server side processing.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoluci-app-firewall: remove references to cbi_bind()
Jo-Philipp Wich [Tue, 13 Nov 2018 19:01:32 +0000 (20:01 +0100)]
luci-app-firewall: remove references to cbi_bind()

Use the standard addEventListener() instead. Also remove an old
cbi_validate_field() call referencing a not existing field.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoluci-mod-status: use progressbar widgets on main status page
Jo-Philipp Wich [Tue, 13 Nov 2018 17:42:56 +0000 (18:42 +0100)]
luci-mod-status: use progressbar widgets on main status page

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoluci-base: simplify apply widget code
Jo-Philipp Wich [Tue, 13 Nov 2018 17:32:19 +0000 (18:32 +0100)]
luci-base: simplify apply widget code

 - Drop embedded CSS in favor to new global rules
 - Drop extraneous include of cbi.js
 - Use showModal() facilities
 - Fix a cosmetic bug in countdown timeout handling

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoluci-base: cbi.js: add modal dialog functions
Jo-Philipp Wich [Tue, 13 Nov 2018 15:30:46 +0000 (16:30 +0100)]
luci-base: cbi.js: add modal dialog functions

Add two new functions showModal() and hideModal() which will fade in and
close an open modal respectively.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoluci-theme-bootstrap: add modal/progressbar rules, cleanup
Jo-Philipp Wich [Tue, 13 Nov 2018 15:19:23 +0000 (16:19 +0100)]
luci-theme-bootstrap: add modal/progressbar rules, cleanup

 - Add rules for modal dialogs and progress bar widgets
 - Drop redundant, unused or obsolete rules
 - Add spin utility class

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoluci-theme-openwrt: modal/progressbar rules, mobile improvements
Jo-Philipp Wich [Tue, 13 Nov 2018 15:12:00 +0000 (16:12 +0100)]
luci-theme-openwrt: modal/progressbar rules, mobile improvements

 - Add rules for modal dialogs and progress bar widgets
 - Increase button and input size on mobile devices
 - Convert pt to px units
 - Add label and h5 styles
 - Add common flash and spin utility classes

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoluci-base: add luci.sys.process.exec()
Jo-Philipp Wich [Mon, 12 Nov 2018 09:48:08 +0000 (10:48 +0100)]
luci-base: add luci.sys.process.exec()

The new process.exec() function simplifies spawning external processes
and capturing their stdio.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoapplications: drop luci-app-asterisk
Jo-Philipp Wich [Mon, 12 Nov 2018 09:13:34 +0000 (10:13 +0100)]
applications: drop luci-app-asterisk

This application was never useful to begin with, drop it to avoid
further confusion.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoluci-base, themes: dropdown behaviour improvements
Jo-Philipp Wich [Thu, 8 Nov 2018 12:02:24 +0000 (13:02 +0100)]
luci-base, themes: dropdown behaviour improvements

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoluci-base: cbi.js: remove dead code in cbi_validate_field()
Jo-Philipp Wich [Mon, 5 Nov 2018 17:50:24 +0000 (18:50 +0100)]
luci-base: cbi.js: remove dead code in cbi_validate_field()

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoluci-base: cbi.js: enable validation for dropdown fields
Jo-Philipp Wich [Mon, 5 Nov 2018 17:43:32 +0000 (18:43 +0100)]
luci-base: cbi.js: enable validation for dropdown fields

Directly attach validation handlers to cbi dropdowns as well, this allows
validating dropdown choices made by the user, similar to how plain select
boxes are handled by the cbi JavaScript.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoluci-theme-openwrt: dropdown style tweaks
Jo-Philipp Wich [Mon, 5 Nov 2018 17:38:25 +0000 (18:38 +0100)]
luci-theme-openwrt: dropdown style tweaks

- Remove 2em min height, this looks out of place with the OpenWrt theme
- Only colorize invalid dropdown when not open
- Drop use of image background for invalid fields while we're at it

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoluci-theme-bootstrap: add invalid style for dropdowns
Jo-Philipp Wich [Mon, 5 Nov 2018 17:11:36 +0000 (18:11 +0100)]
luci-theme-bootstrap: add invalid style for dropdowns

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoluci-theme-{freifunk-generic,material,openwrt}: z-index fixes
Jo-Philipp Wich [Mon, 5 Nov 2018 17:10:26 +0000 (18:10 +0100)]
luci-theme-{freifunk-generic,material,openwrt}: z-index fixes

Ensure that open dropdowns cover active tooltips.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>