Commit graph

2260 commits

Author SHA1 Message Date
Anton Kikin
663d772da9 luci-base: update Russian translation
Signed-off-by: Anton Kikin <a.kikin@tano-systems.com>
2019-01-15 06:46:16 +03:00
Sibren Vasse
970fa9a4e0
luci-mod-network: fix extraneous escaping
Signed-off-by: Sibren Vasse <github@sibrenvasse.nl>
2019-01-11 17:10:05 +01:00
Jo-Philipp Wich
47d9205fe9
Merge pull request #2450 from pmelange/fix/luci-mod-freifunk_basics
luci-mod-freifunk: fix the list of community profiles
2019-01-11 16:14:20 +01:00
pmelange
e38e189b35 luci-mod-freifunk: fix the list of community profiles
Signed-off-by: pmelange <isprotejesvalkata@gmail.com>
2019-01-11 13:29:48 +01:00
pmelange
d4562ff544 luci-mod-freifunk: replace calls to get_all() with separate get() calls
The get_all() function has changed and how it was used before no
longer works properly.  These changes not only change to individual
get() calls, but actually adds to the readability of the code and reduces
file size.

Signed-off-by: pmelange <isprotejesvalkata@gmail.com>
2019-01-11 12:57:52 +01:00
Jo-Philipp Wich
e3fa766b58
Merge pull request #2425 from cshoredaniel/pr-fix-ipaddrport-js
luci-base: Fix addr:port validate always fails
2019-01-11 07:19:27 +01:00
Zheng Qian
16c63026e8 luci-base: update Simplified Chinese translation
Signed-off-by: Zheng Qian <sotux82@gmail.com>
2019-01-10 16:12:33 +08:00
Florian Eckert
7383bf054a luci-mod-system: add password strength info
Show password strength info.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2019-01-09 10:25:41 +01:00
Florian Eckert
42ad4977ae luci-mod-system: add pollinterval option
Make pollinterval configurable.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2019-01-09 10:23:57 +01:00
Krystian Kozak
06804ade60 luci-base: update Polish translation
Polish translation has been updated.

Signed-off-by: Krystian Kozak <krystian.kozak20@gmail.com>
2019-01-05 19:33:30 +01:00
Daniel F. Dickinson
f5a871bfe8 luci-base: Fix addr:port validate always fails
In cbi.js there is an error which causes ipaddrport validation to always fail.
JS match() return the entire match as ret[0] and individual matches (for multiple ()) as the
subsequent list members.  So we fix it by just fixing the index in the calls that want the
individual parts.

Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
2019-01-05 00:43:37 -05:00
Jo-Philipp Wich
e847a93f78
Merge pull request #2409 from yousong/install-packages
treewide: fix redirecting to System->Software
2019-01-04 08:59:49 +01:00
Hannu Nyman
c7776c8959 timezone data: update to 2018i
Update timezone data to 2018i

http://mm.icann.org/pipermail/tz-announce/2018-December/000053.html
http://mm.icann.org/pipermail/tz-announce/2018-December/000054.html

2018h:
* Qyzylorda, Kazakhstan moved from +06 to +05 on 2018-12-21.
* New zone Asia/Qostanay because Qostanay, Kazakhstan didn't move.
* Metlakatla, Alaska observes PST this winter only.
* Guess Morocco will continue to adjust clocks around Ramadan.
* Add predictions for Iran from 2038 through 2090.

2018i:
* São Tomé and Príncipe switches from +01 to +00 on 2019-01-01.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2019-01-02 21:32:47 +02:00
Yousong Zhou
7908b2b71c treewide: fix query arguments to admin/system/opkg
Right now the handler only recognizes "query=xx" argument, others will
be ignored.

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2019-01-01 05:04:51 +00:00
Yousong Zhou
85b67625f7 treewide: fix redirecting to System->Software
By replacing url "admin/system/packages" with "admin/system/opkg"

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2019-01-01 05:04:49 +00:00
Yurii
393d414492
luci-base: update Ukrainian translation
Signed-off-by: Yurii yuripet@gmail.com
2018-12-29 23:22:54 +02:00
Jo-Philipp Wich
ed914df3f5 luci-base: rework filebrowser initialization
Do not call cbi_init() from the browser field template but lazily initialize
the field, like it is being done for all other widgets as well.

Fixes: #2398
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-12-29 14:19:59 +01:00
INAGAKI Hiroshi
e7e8475062 luci-base: fix Japanese translation
Fixed Japanese translation.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2018-12-26 19:49:18 +09:00
Gyrotron
38c03bcbc9 luci-base: fix zh-tw translation
Fixes #1092

Signed-off-by: Simmar Kalsi simmarkalsi@gmail.com
[reword commit message subject]
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2018-12-26 01:32:03 +00:00
Florian Eckert
3b9ba0210e luci-base: use default poll interval
Replace all XHR poll time number with -1 so they will use the default
poll interval time value from "/etc/config/luci". If this is not set then
5 seconds as default is used.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-12-20 10:20:23 +01:00
Florian Eckert
6475221d54 modules: use configurable poll interval
Make poll interval configurable. Use option from

----
config core 'main'
    option pollinterval '5'
---

This will only be used if the interval option is less or equal zero.
If the poll interval is not configured then a default value of 5 seconds
is used.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-12-20 10:19:07 +01:00
INAGAKI Hiroshi
7c9f7bc3eb luci-base: update Japanese translation
Updated Japanese translations.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2018-12-20 03:01:24 +09:00
INAGAKI Hiroshi
37b0211e62 i18n: sync translations
Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2018-12-20 02:21:14 +09:00
Jo-Philipp Wich
e3b91d1a62
Merge pull request #2350 from TDT-AG/pr/20181204-luci-mod-system
luci-mod-system: add translation for led trigger names
2018-12-19 07:49:56 +01:00
Zheng Qian
76f81c262c luci-base: update Simplified Chinese translation
Signed-off-by: Zheng Qian <sotux82@gmail.com>
2018-12-14 10:14:01 +08:00
Jo-Philipp Wich
efb4d7c40a luci-base: fix table compare upon writing ipaddr changes
Fixes: b33192a03 ("luci-base: support cidr list notation for option ipaddr and ip6addr")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-12-13 12:14:37 +01:00
Jo-Philipp Wich
11b271d4a9 luci-base: properly option ipaddr in single cidr string notation as well
When an interface configuration specifies both "option ipaddr 1.2.3.4/24"
and "option netmask", then netifd will ignore the netmask in favor to the
prefix encoded in the cidr string.

Support this variant as well by treating a sole cidr string value as
singöe-item cidr list.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-12-13 11:57:16 +01:00
Jo-Philipp Wich
67c34c5f5f luci-base: fix typo in german translation
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-12-13 11:44:17 +01:00
Jo-Philipp Wich
c50849ddd2 luci-base: update german translation
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-12-13 11:41:24 +01:00
Jo-Philipp Wich
6c76300505 luci-base: resync translation templates
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-12-13 11:36:35 +01:00
Jo-Philipp Wich
b33192a033 luci-base: support cidr list notation for option ipaddr and ip6addr
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-12-13 11:35:38 +01:00
Jo-Philipp Wich
979a478001 luci-base: cbi.js: update deps on dynlist changes, honor placeholder
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-12-13 11:35:38 +01:00
Anton Kikin
43c7cb344c luci-base: fix UCI changelog markup mistake
Signed-off-by: Anton Kikin <a.kikin@tano-systems.com>
2018-12-12 02:05:59 +03:00
Jo-Philipp Wich
62990e2338 luci-base: fix syntax error in map.htm
Fixes #2366.
Fixes: 76e9c0305 ("luci-base: rework ui tabbing code")

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-12-11 06:54:09 +01:00
Anton Kikin
77014af67e luci-mod-status: split status page into a series of partials
Split status page into a series of partials as discussed in PR #2359.

Signed-off-by: Anton Kikin <a.kikin@tano-systems.com>
2018-12-10 20:24:33 +03:00
Jo-Philipp Wich
76e9c0305e luci-base: rework ui tabbing code
- Instantiate tab menus on the client side
 - Simplify server side markup generation
 - Show error indicators in cbi tabs

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-12-10 13:41:34 +01:00
Jo-Philipp Wich
a7dcfbe06b luci-base: luci.js: emit custom events for tooltip open/close actions
The new `tooltip-open` and `tooltip-close` events allow other code to hook
into the tooltip div rendering, e.g. to populate it with custom markup.

Also ignore tooltip events originating from descendant elements while
we're at it.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-12-10 13:41:34 +01:00
Jo-Philipp Wich
df9ba6981e luci-mod-status: switch iptables_dump action to luci.sys.process.exec
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-12-10 13:41:34 +01:00
Florian Eckert
a56935c241 luci-mod-system: add translation for trigger names
Not every user knows which trigger does what. To make this clear, the
triggers are now translated with a short help text.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-12-04 12:37:41 +01:00
Jo-Philipp Wich
a92c94df32 luci-mod-system: fix IE10/Edge rendering quirk on SSH keys page
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-12-02 17:10:39 +01:00
Jo-Philipp Wich
be506665df luci-base: fix ReferenceError
The showTooltip() and hideTooltip() functions have been moved to luci.js

Reported-by: brv phoenix <feixuekaka1@gmail.com>
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-12-02 15:01:58 +01:00
Jo-Philipp Wich
be2d0536f4 luci-mod-status: use -w flag when dumping iptables
Multiple iptables listing commands might be triggered in parallel due
to the XHR polling, so use the -w flag to wait for the lock to become
free.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-12-02 14:30:51 +01:00
Jo-Philipp Wich
5c98bad93b
Merge pull request #2309 from rbalik/patch-1
luci-mod-network: Add DAE settings to security tab
2018-11-27 23:43:23 +01:00
Jo-Philipp Wich
2509b5984d luci-base: dispatcher: use consistent ordering
Use the same ordering logic for building the dispatch tree and for
querying the children of a given node.

Fixes #2338.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-11-27 15:25:05 +01:00
Jo-Philipp Wich
2e36e09303 luci-base: dispatcher: remove tree modifier support
This feature was never used, is hardly documented and appears to be
designed to fiddle with the internal dispatch tree state.

Given that, simply drop the related code to simplify the dispatcher
class somewhat.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-11-27 14:46:55 +01:00
Hannu Nyman
26e903c740 luci-mod-network: adapt to current 802.11r defaults
The default for 802.11r option ft_psk_generate_local
was changed a few months ago by openwrt/openwrt@3cc56a5

That change was a bit awkward, as it made hostapd to
overlook the possibly existing r0kh values by default
unless the user explicitly disables the new default.

Adapt LuCI by changing the default for ft_psk_generate_local
into 'enabled'.

But ensure that LuCI does not delete the existing key values
by not making the r0kh and r1kh fields to depend on this.

Note that this is just a quick fix for the wrong default value
causing problems, but not yet a complete fix for all the options.
In the long run it might be better to make the detail options
to depend on local generation.

Reference also to LuCI PR #2102

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2018-11-25 09:00:35 +02:00
Jo-Philipp Wich
548281773d luci-mod-network: remove debug code from iface_status.js
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-11-24 21:32:33 +01:00
Jo-Philipp Wich
4bd7f4ba42 luci-mod-network: move wifi and iface status JS into external files
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-11-23 15:47:44 +01:00
Jo-Philipp Wich
f73dc51ea1 luci-mod-network: move wifi scan JS into external file
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-11-23 15:44:18 +01:00
Jo-Philipp Wich
1eea921df0 luci-base: modal accessibility fix, wrap XHR.stop()
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-11-23 15:44:18 +01:00
Jo-Philipp Wich
b80cea293e luci-mod-network: wifi scan CSS tweaks
Hide less important fields for mobile views.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-11-23 15:11:28 +01:00
Jo-Philipp Wich
c4fb418b70 luci-mod-system: sshkeys CSS tweak
Overflow pubkey preview to the left, not to the right.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-11-23 15:11:28 +01:00
Anton Kikin
c7a3c5cccc luci-mod-network: fix invalid translate() argument pass
We must pass to the translate() a string without substituted zone name.

Signed-off-by: Anton Kikin <a.kikin@tano-systems.com>
2018-11-23 00:46:51 +03:00
Jo-Philipp Wich
db2bfb24ad
Merge pull request #2325 from YuriPet/master
luci-base & luci-app-opkg: update Ukrainian translation
2018-11-22 18:51:12 +01:00
Jo-Philipp Wich
241b90c7f6 luci-base: do not trigger form action when revealing password
Ref: https://github.com/openwrt/luci/issues/2327
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-11-22 14:47:56 +01:00
Yurii
5bc4902811
luci-base: update Ukrainian translation
Signed-off-by: Yurii yuripet@gmail.com
2018-11-22 14:07:45 +02:00
Jo-Philipp Wich
6a0c1d1ab6 luci-mod-status: move index and iptables page JS code into external files
Also adjust the Bootstrap and OpenWrt themes accordingly

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-11-22 13:07:33 +01:00
Jo-Philipp Wich
a03ec60696 luci-mod-network: move wifi overview markup and JS code into external files
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-11-22 12:58:34 +01:00
Jo-Philipp Wich
f598b10c49 luci-mod-network: move interface overview JS into external file
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-11-22 12:58:34 +01:00
Jo-Philipp Wich
7c16decdb4 luci-base: move DOM manipulation functions to luci.js
Introduce a new luci.dom class which groups the DOM manipulation helpers
such as E(), findParent(), matchesElem() etc.

Provide wrappers for the old functions to ease the transition to the new
functions.

Also add a new widget helper function L.itemlist() which consolidates
the item enumeration formatting code found on various pages.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-11-22 12:58:34 +01:00
Jo-Philipp Wich
84d50a6044 luci-mod-system: move password and sshkey JS code into external files
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-11-22 12:49:14 +01:00
Jo-Philipp Wich
05860e31f2 luci-base: cbi.js: remove functions moved to luci.js
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-11-22 12:49:14 +01:00
Jo-Philipp Wich
706c6836e4 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>
2018-11-22 12:49:14 +01:00
Jo-Philipp Wich
17690f2d73 build: add build option to minify *.js files
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-11-22 12:49:14 +01:00
INAGAKI Hiroshi
38f19b4d34 luci-base: update Japanese translation
Updated Japanese translations.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2018-11-22 16:30:52 +09:00
Anton Kikin
73f89ed327 luci-base: update Russian translation
Signed-off-by: Anton Kikin <a.kikin@tano-systems.com>
2018-11-21 17:12:25 +03:00
Zheng Qian
1902816444 i18n: luci-base: update Simplified Chinese translation
Signed-off-by: Zheng Qian <sotux82@gmail.com>
2018-11-21 09:50:07 +08:00
Jo-Philipp Wich
7a32e11e2b 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>
2018-11-20 11:54:22 +01:00
Jo-Philipp Wich
a17c5808f0 luci-base: resync translations
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-11-20 11:46:17 +01:00
Jo-Philipp Wich
50ee130cd8 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>
2018-11-20 11:43:20 +01:00
Jo-Philipp Wich
447f0c8171 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>
2018-11-20 11:01:50 +01:00
Reuben Balik
6f53654a58
luci-mod-network: Add DAE settings to security tab
Signed-off-by: Reuben Balik <rsbalik@gmail.com>
2018-11-19 17:43:10 -06:00
Jo-Philipp Wich
51de74d520 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>
2018-11-19 13:31:43 +01:00
Jo-Philipp Wich
c55436e36f 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>
2018-11-19 11:58:17 +01:00
Jo-Philipp Wich
2babc47ae2 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>
2018-11-19 11:50:25 +01:00
Jo-Philipp Wich
e5f9e3ff25 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>
2018-11-17 14:57:08 +01:00
Hannu Nyman
93fdac8560
Merge pull request #2298 from YuriPet/master
luci-base: update Ukrainian translation
2018-11-16 23:00:02 +02:00
Jo-Philipp Wich
e991e09d47
Merge pull request #2297 from tano-systems/fix-fstab-mount-table
luci-mod-system: fstab: fix table cell rendering without unmount button
2018-11-16 21:37:35 +01:00
Anton Kikin
677765705d luci-mod-system: fstab: fix table cell rendering without unmount button
Signed-off-by: Anton Kikin <a.kikin@tano-systems.com>
2018-11-16 23:20:21 +03:00
Jo-Philipp Wich
a1fff6a9ee 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>
2018-11-16 21:11:34 +01:00
Jo-Philipp Wich
425a02734e 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>
2018-11-16 21:11:34 +01:00
Yurii
827c83f7ae
luci-base: update Ukrainian translation
Signed-off-by: Yurii yuripet@gmail.com
2018-11-16 21:59:41 +02:00
Anton Kikin
c098c2345c luci-base: update Russian translation
Signed-off-by: Anton Kikin <a.kikin@tano-systems.com>
2018-11-16 19:50:46 +03:00
INAGAKI Hiroshi
2d1c0301f8 luci-base: update Japanese translation
Updated Japanese translations.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2018-11-16 23:09:24 +09:00
Angus Ding
fdb7f3ed13 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>
2018-11-15 19:33:09 +01:00
Angus Ding
94ebc49a4c 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>
2018-11-15 19:33:09 +01:00
Jo-Philipp Wich
76bf2ac6ce treewide: resync translation files
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-11-15 19:32:53 +01:00
Darius
7bffa401ff luci-mod-network: function name mismatch fixed
Signed-off-by: Darius <jok.darius@gmail.com>
2018-11-15 08:41:59 +01:00
Wang805447391
09ac96ede9 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>
2018-11-15 08:28:45 +01:00
Jo-Philipp Wich
6bc04b6afb luci-base: fix some long standing german mistranslations
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-11-14 21:03:40 +01:00
Jo-Philipp Wich
f1efd71ba0 luci-mod-network: require unique MACs for DHCP leases
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-11-14 20:59:26 +01:00
Jo-Philipp Wich
7e26fa89e9 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>
2018-11-14 20:58:49 +01:00
Jo-Philipp Wich
ceb342dc8d
Merge pull request #2259 from pmelange/luci-app-olsr-new-json-lib
update luci-app-olsr to the new jsoninfo library
2018-11-14 20:50:03 +01:00
Jo-Philipp Wich
e442bfe0ae
Merge pull request #2282 from TDT-AG/pr/20181114-luci-base
luci-base: allow optional default value for file browser
2018-11-14 20:48:15 +01:00
Jo-Philipp Wich
4bbe32548c 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>
2018-11-14 20:46:04 +01:00
Jo-Philipp Wich
391e82d6a3 luci-mod-system: replace builtin opkg support with luci-app-opkg
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-11-14 20:46:04 +01:00
Jo-Philipp Wich
ff7bcda5bc 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>
2018-11-14 20:46:04 +01:00
Jo-Philipp Wich
6f7736c436 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>
2018-11-14 20:46:04 +01:00
Jo-Philipp Wich
1dcdbb54ac luci-mod-status: use progressbar widgets on main status page
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-11-14 20:46:04 +01:00
Jo-Philipp Wich
94d8c9a7aa 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>
2018-11-14 20:46:04 +01:00
Jo-Philipp Wich
333b7e57d3 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>
2018-11-14 20:46:04 +01:00
Jo-Philipp Wich
6469b65354 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>
2018-11-14 20:46:04 +01:00
Jo-Philipp Wich
4791180eb3 luci-base, themes: dropdown behaviour improvements
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-11-14 20:46:04 +01:00
Jo-Philipp Wich
e35fb36ea5 luci-base: cbi.js: remove dead code in cbi_validate_field()
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-11-14 20:46:04 +01:00
Jo-Philipp Wich
56249c867e 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>
2018-11-14 20:46:04 +01:00
Jo-Philipp Wich
207fc0121e luci-base: cbi.js: set .value property of cbi dropdown elements
In order to make cbi dropdowns usable for validation and other code
expecting native form elements, set the .value DOM property on the
dropdown parent element whenever the selection is changed.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-11-14 20:46:04 +01:00
Jo-Philipp Wich
bbb800556d luci-base: cbi.js: properly handle cbi tooltips on nested elements
Rework the tooltip event delegation logic to prevent hiding the tooltop
when the cursor is moved to a children of the tooltip container element.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-11-14 20:46:04 +01:00
Jo-Philipp Wich
b468e1416d luci-base: cbi.js: avoid using .form property directly
In order to prepare support for calling cbi validation on non-native form
widgets, remove direct usages of the node.form property and lookup the
containing form using findParent() instead.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-11-14 20:46:04 +01:00
Jo-Philipp Wich
a453f2b9d0 luci-base: cbi.js: fix passing multiple dropdown values in change event
Due to a misspelled property name, only the first value was passed in
the event details.

Fixes: c2b570998 ("luci-base: cbi.js: rework dropdown implementation")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-11-14 20:46:04 +01:00
Jo-Philipp Wich
10838c3660 luci-base: rework dynamic list template
Commit 7c7821833 ("luci-base, themes: rework dynlist and dropdown widgets")
changed the way we initialize dynamic lists on client side, avoiding the
need for pre-rendering the items on the server side.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-11-14 20:46:04 +01:00
Jo-Philipp Wich
e33a367158 luci-base: add ARIA label to reveal/hide password button
Fixes #2070.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-11-14 20:46:04 +01:00
Jo-Philipp Wich
974f5bc413 luci-base: update german translation
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-11-14 20:46:04 +01:00
Florian Eckert
1a52df6bdb luci-base: allow optional default value for file browser
With this change we could set optional value for the file browser.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-11-14 10:10:56 +01:00
Zheng Qian
e57b4bbf8b i18n: luci-base: update Simplified Chinese translation
Signed-off-by: Zheng Qian <sotux82@gmail.com>
2018-11-14 10:25:28 +08:00
Jo-Philipp Wich
1ca22ec3f0
Merge pull request #2245 from Ansuel/fstab
luci-mod-system: add support for additional filesystem
2018-11-12 19:34:24 +01:00
Ansuel Smith
9f95fb3c08
luci-mod-system: add support for additional filesystem
The filesystem option doesn't include additional filesystem included with /etc/filesystems, this is usefull if someone have ntfs-3g installed and wants to force use the external utility to mount partition instead of the default present in the kernel (if it's supported)

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2018-11-12 19:32:23 +01:00
Kevin Darbyshire-Bryant
2e37a8ba10 luci-mod-admin-full: dnsmasq clarify non-wildcard mode
'non-wildcard' interfaces enables dnsmasq's '--bind-dynamic' mode.
This binds dynamically to interfaces rather than wildcard addresses
*and* keeps track of interface comings/goings via a unique Linux api.

Quoting dnsmasq's author "bind-dynamic (bind individual addresses,
keep up with changes in interface config) ... On linux, there's actually
no sane reason not to use --bind-dynamic, and it's only not the default
for historical reasons."

listen/exclude interfaces may be used independently of bind dynamic mode
so removed the bogus dependency of 'nonwildcard' enabling access to
'listen/exclude' interfaces - they may be used in any mode..  In fact
the dnsmasq init script takes notice of include/exclude interfaces
irrespective of the 'nonwildcard' parameter.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
2018-11-12 15:38:36 +00:00
Jo-Philipp Wich
8e6af11715
Merge pull request #2274 from TDT-AG/pr/20181112-luic-mod-system
luci-mod-system: add user defined interface to netdev trigger
2018-11-12 15:38:27 +01:00
Florian Eckert
27bf7c2876 luci-mod-system: add user defined interface to netdev trigger
Give the user the possibility to define and interface for the netdev
trigger which is not available at the moment. This is usefull if a
interface is not presented on configuration time.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-11-12 15:34:54 +01:00
INAGAKI Hiroshi
db6e5bc8d4 luci-base: update Japanese translation
Updated Japanese translations.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2018-11-11 15:47:49 +09:00
INAGAKI Hiroshi
183faf70a0 luci-base: sync translations
Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2018-11-11 15:35:47 +09:00
INAGAKI Hiroshi
c3225c7012 luci-base: fix translation issues
Fixed several issues for translation.

- add translation markup to "Expecting "
- add missing ")" into "valid time (HH:MM:SS"

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2018-11-11 15:24:18 +09:00
pmelange
4fc3ab4737 luci-base: network.lua add ipv6-prefix-assignment support to get_status_by_address
Signed-off-by: pmelange <isprotejesvalkata@gmail.com>
2018-11-07 18:41:58 +01:00
Hannu Nyman
40de466475 i18n: sync translations, add location annotatations
Thanks to a recent commit, the translation files will now
have info about locations where the string is used. That
can help is deciding the correct translation, as all contexts
are more easily found.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2018-11-07 18:10:59 +02:00
Jo-Philipp Wich
a6d96e0716 luci-mod-network: move AHCP protocol model to AHCP application
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-11-05 11:19:52 +01:00
Jo-Philipp Wich
58fc702805 luci-base: validate DHCP clientid as hexstring
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-11-05 11:19:52 +01:00
Jo-Philipp Wich
9dda4c651c luci-base: cbi.js: add client-side hexstring datatype validator
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-11-05 11:13:39 +01:00
Jo-Philipp Wich
f4c39dd6ff luci-base: cbi.js: add heuristics to attribute handling in E()
If a given attribute value is a function, register it as event listener,
if it is an object, filter it through JSON.stringify(), else set it
as-is.

This helps to reduce some boiler-plate code when building DOM structures.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-11-05 11:11:46 +01:00
Jo-Philipp Wich
7c78218339 luci-base, themes: rework dynlist and dropdown widgets
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-11-05 11:05:12 +01:00
Jo-Philipp Wich
c2b5709988 luci-base: cbi.js: rework dropdown implementation
- Refactor event handler closures into class methods and bind them instead
 - Fix quirk in dropdown placement calculation
 - Different dropdown placement strategy on touch devices
 - Broadcast custom "cbi-dropdown-change" event when value is changed
 - Implement setValues() method to alter dropdown selection
 - Prevent creating empty custom values

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-11-05 11:01:45 +01:00
Jo-Philipp Wich
6b8fc99fd5 luci-base: cbi.js: utilize node.closest() if available
Use node.closest() in findParent() when available since it should be faster
than manaually traversing the ancestor chain.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-11-05 11:01:45 +01:00
Jo-Philipp Wich
911d540cbb luci-base: cbi.js: drop cbi_bind()
Just use node.addEventListener() directly since all reasonably recent
browsers support it nowadays.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-11-05 11:01:45 +01:00
Jo-Philipp Wich
7337872aa1 luci-base: cbi.js: rework client side input validation
- Refactor and fix datatype validation functions
 - Turn the type compilation and validation into a proper class
 - Display tooltip with error hint on invalid inputs

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-11-05 11:01:45 +01:00
Jo-Philipp Wich
51fb04f6e0 luci-base: cbi.js: fix corner case in IPv6() address parser
The implementation allowed a hexadecimal string without any colons.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-11-05 11:01:45 +01:00
Jo-Philipp Wich
7f613be500 luci-base, themes: add tooltip helpers & styles
Add the required JS and CSS infrastructure to support rich hover/focus
tooltips for element.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-11-05 11:01:45 +01:00
Jo-Philipp Wich
31bce2455f luci-base: cbi.js: switch to client side translation
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-11-05 11:01:45 +01:00
Jo-Philipp Wich
ab405edfb6 luci-base: cbi.js: add client side translation infrastructure
Implement the string hash algorithm used by LuCI's translation system in
JavaScript and provide a `_()` translation wrapper function to lookup
messages in the global string table.

Once client side translation loading is activated in a later commit,
JavaScript code can use the same string translation mechanism as server
side Lua code, e.g. `_("Static Routes")` would yield "Statische Routen"
when the German translation is loaded.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-11-05 11:01:45 +01:00
Jo-Philipp Wich
c916b5ed87 luci-base: expose system translations to JavaScript
Add a new /admin/translations/ endpoint which exposes the loaded system
translations as JavaScript file.

Once referenced by <script>, the endpoint will create a `window.TR` object
containing the entire translation string table for use on the client side.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-11-05 11:01:45 +01:00
Jo-Philipp Wich
8ff68c772b luci-base: remove unused i18n functions
Drop load(), loadc(), string() and stringf() from the luci.i18n class since
these functions are either no longer unused or were never used to begin with.

Also slightly rework the module to only use local symbols and unify the
module require style.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-11-05 11:01:45 +01:00
Jo-Philipp Wich
7a98222106 luci-base: remove references to luci.i18n.loadc()
The i18n.loadc() function has been a no-op since almost six years so it
makes no sense to invoke it anymore.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-11-05 11:01:45 +01:00
Jo-Philipp Wich
a04028037e luci-base: introduce luci.i18n.dump()
Add a new luci.i18n.dump() function which returns all currently loaded
translation strings as Lua table.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-11-05 11:01:45 +01:00
Jo-Philipp Wich
08255e266b luci-base: fix luci.i18n.setlanguage()
Rework the setlanguage() implementation to actually switch catalogues
if another language has been loaded previously and change it to return
the effectively loaded language tag.

Also improve input parameter validation and accept tags in both lower
or upper case.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-11-05 11:01:45 +01:00
Jo-Philipp Wich
62102f4f0e luci-base: template: add translation iterator function
Introduce a new luci.template.parser.get_translations() function which will
iterate all loaded translation entries and pass the to the given callback
function.

This is useful to expose the loaded translations in other formats, e.g. for
wrapping them into JSON feeds.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-11-05 11:01:45 +01:00
Hannu Nyman
982c023deb i18n: sync translations
Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2018-11-04 18:05:01 +02:00
Jo-Philipp Wich
807fc816bb
Merge pull request #2193 from rosysong/freespace
luci-mod-system: add id for software/freespace div
2018-11-02 14:04:31 +01:00
Jo-Philipp Wich
42eb9cf758
Merge pull request #2250 from booo/remove-olsrd-library-version-numbers
get rid of library version numbers in luci olsrd code
2018-11-02 13:53:08 +01:00
Jo-Philipp Wich
d1c24c8972
Merge pull request #2252 from stweil/lgtm
Add missing variable declarations in JavaScript code
2018-11-02 13:52:37 +01:00
Hannu Nyman
111ebe2f62 timezone data: update to 2018g
Update timezone data to 2018g

http://mm.icann.org/pipermail/tz-announce/2018-October/000052.html

 * Morocco switches to permanent +01 on 2018-10-27.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2018-10-30 19:45:50 +02:00
Stefan Weil
ec63339ae5 Add missing variable declarations in JavaScript code
This fixes errors reported by LGTM.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-10-28 22:38:20 +01:00
Philipp Borgers
5f65547dfd get rid of library version numbers in luci olsrd code
Signed-off-by: Philipp Borgers <borgers@mi.fu-berlin.de>
2018-10-25 21:56:06 +02:00