Commit graph

2260 commits

Author SHA1 Message Date
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
Hannu Nyman
35b543e270
Merge pull request #2248 from tano-systems/fstab-translateble-swap
luci-mod-system: fstab: "SWAP" section title is made translatable
2018-10-25 19:51:36 +03:00
Anton Kikin
6958e0d10c luci-mod-system: fstab: "SWAP" section title is made translatable
Signed-off-by: Anton Kikin <a.kikin@tano-systems.com>
2018-10-25 19:40:23 +03:00
Hannu Nyman
b412a4c231
Merge pull request #2247 from tano-systems/luci-base-upd-ru-i18n
luci-base: update and improve Russian translation
2018-10-25 19:35:23 +03:00
Anton Kikin
21370eb1cd luci-base: update and improve Russian translation
Add missing translations and update existing not quite correct translations.
Also removed unnecessary dots at the end of some translations.

Signed-off-by: Anton Kikin <a.kikin@tano-systems.com>
2018-10-25 19:30:54 +03:00
Hannu Nyman
651937c166 timezone data: update to 2018f
Update timezone data to 2018f

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

   Volgograd moves from +03 to +04 on 2018-10-28.
   Fiji ends DST 2019-01-13, not 2019-01-20.
   Most of Chile changes DST dates, effective 2019-04-06.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2018-10-25 18:44:48 +03:00
Hannu Nyman
c74d9c011a
Merge pull request #2227 from YuriPet/master
luci-base: update Ukrainian translation
2018-10-22 20:39:25 +01:00
Jo-Philipp Wich
a2a5110902
Merge pull request #2233 from musashino205/l10n/base-upd-ja
luci-base: update Japanese translation
2018-10-20 18:04:29 +02:00
Jo-Philipp Wich
d9687f016d
Merge pull request #2215 from MonwF/feature_root_redirect_path
luci-base: redirect root path to /cgi-bin/luci/
2018-10-20 18:04:11 +02:00
INAGAKI Hiroshi
86acdb8980 luci-base: update Japanese translation
Added and updated Japanese translations.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2018-10-20 00:57:01 +09:00
Jo-Philipp Wich
9e6949849d luci-base: fix cbi dropdown quirks with MS Edge
On MS Edge, the behaviour of "value" attributes on "li" elements is
unreliable, so use the "data-" prefix to circumvent the problem.

Ref: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/19320991/
Fixes: #2224
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-10-17 08:07:48 +02:00
Yurii
36965f2277
luci-base: update Ukrainian translation
Updated with the latest sync translation, corrections.

Signed-off-by: Yurii yuripet@gmail.com
2018-10-14 18:14:01 +03:00
yangfl
ae8b68cfe8 treewide: Fix typos in UI strings
Signed-off-by: David Yang <mmyangfl@gmail.com>
2018-10-12 22:18:51 +08:00
Hannu Nyman
c9e3e73c8c i18n: sync translations
Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2018-10-11 19:57:32 +03:00
Hannu Nyman
4ab147e602 i18n: fix translations
fix .po files

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2018-10-11 19:55:52 +03:00
Jo-Philipp Wich
c15d2d0474 luci-base: cbi.js: remove dead code
Remove some superfluous code which was added with a previous commit.

Fixes: 8270f10f1 ("luci-base: cbi.js: code cleanups")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-10-11 08:02:38 +02:00
Jo-Philipp Wich
8270f10f16 luci-base: cbi.js: code cleanups
- unify code style
 - add matchesElem() helper
 - replace nodeName checks with selector tests
 - replace className manipulations with classList operations

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-10-11 07:58:51 +02:00
yangfl
74f52f22ff luci-mod-system: block install and search if no package lists
Signed-off-by: David Yang <mmyangfl@gmail.com>
2018-10-11 08:10:31 +08:00
Hannu Nyman
67fd6b6e5e
Merge pull request #2197 from yangfl/master
treewide: Fix typos in comments
2018-10-10 20:25:11 +03:00
Jo-Philipp Wich
a9948891a8 luci-mod-status: fix CDATA marker on iptables status page
Fixes: f6bfac211 ("luci-mod-status: rework iptables status page")
Reported-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-10-10 15:25:10 +02:00
Jo-Philipp Wich
94323a61e1 luci-base: move luci.sys.iptparser into separate package
Since commit f6bfac211 ("luci-mod-status: rework iptables status page"),
nothing in luci-base depends on the iptparser class anymore, so fold it
out into a separate package and let the few apps that require it depend
on the new library package.

Saves about 10K uncompressed in luci-base while the iptables status
rework enlarged the markup by roughly 5KB, saving roughly 5KB of size
overall.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-10-10 13:19:48 +02:00
Jo-Philipp Wich
f6bfac2117 luci-mod-status: rework iptables status page
- Parse and format iptables listing in client side JS
- Dynamically update packet counters

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-10-10 13:11:01 +02:00
yangfl
401382a459 treewide: Fix typos in comments
Signed-off-by: David Yang <mmyangfl@gmail.com>
2018-10-10 15:00:07 +08:00
Jo-Philipp Wich
24d1e7608b luci-base: show default forwarding policy in zone forwarding list
The zone forwarding list widget misleadingly displays the intra-zone
forwarding policy as default policy action when no forwardings exist
instead of the appropriate global defaults forwarding policy which is
the one applied to inter-zone forwarded traffic.

Fix the issue by displaying the defaults policy and not the per-zone
policy to match what the firewall implementation is actually doing.

Fixes: #2213
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-10-10 08:36:08 +02:00
Jo-Philipp Wich
cb7f9d2ed3 luci-base: validate name in firewall zone selector widget
When creating a new zone through the firewall zone selector widget,
validate the given name before creating new items.

Depends on commit 0b6ae96f2 ("luci-base: cbi.js: recognize invalid
input in dropdown create field").

Fixes: #2211
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-10-10 08:30:13 +02:00
Jo-Philipp Wich
0b6ae96f2d luci-base: cbi.js: recognize invalid input in dropdown create field
This is required to allow for validating the create field values in
later commits.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-10-10 08:29:02 +02:00
yangfl
645a555f39 luci-mod-network: show bridges in ifacelist when the interface itself is not a bridge
It's completely OK to select a bridge as the underlying interface of
other interfaces, say a tunnel or PPPoE. The only case which should be
forbidden is bridge over bridge.

Signed-off-by: David Yang <mmyangfl@gmail.com>
2018-10-10 13:16:57 +08:00
xiongjie
fd3d2b468f luci-base: redirect root path to /cgi-bin/luci/
Fix openwrt/luci#1062
Signed-off-by: MonwF <boluo2@gmail.com>
2018-10-10 13:04:17 +08:00
Hannu Nyman
701f6b0819 timezone data: update to 2018e
Update timezone data to 2018e

http://mm.icann.org/pipermail/tz-announce/2018-May/000050.html

  North Korea switches back to +09 on 2018-05-05.
  The main format uses negative DST again, for Ireland

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2018-10-09 18:19:52 +03:00
Jo-Philipp Wich
280dd33980 luci-base: reword rollback notification dialog
Rename "Apply unchecked" to "Apply anyway" for better clarity and update
the base translation files accordingly.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-10-03 13:25:46 +02:00
Jo-Philipp Wich
229c002272
Merge pull request #2191 from Ansuel/zram
luci-mod-system: add zram options
2018-10-01 14:27:15 +02:00
Ansuel Smith
ff5f68d868
luci-mod-system: add zram options
This adds option to configure zram size and compression algo

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2018-10-01 14:04:18 +02:00
Jo-Philipp Wich
af96d94ad1
Merge pull request #2194 from yangfl/master
i18n: update Chinese translation
2018-10-01 10:53:35 +02:00
yangfl
dc1c69ce4e i18n: update Chinese translation
Signed-off-by: David Yang <mmyangfl@gmail.com>
2018-10-01 11:39:57 +08:00
Rosy Song
258dc1312a luci-mod-system: add id for software/freespace div
Signed-off-by: Rosy Song <rosysong@rosinson.com>
2018-09-30 12:07:45 +08:00
Ansuel Smith
7d09ee81a0
luci-app-network: add rekey option and inactivity tweak
This option is usefull to solve some problems with ath10k-ct and random client disconnect. This also adds some extra option to tune inactivity settings

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2018-09-29 22:10:57 +02:00
Dirk Brenken
32ee1873ac luci-base: fix misleading warning message when adding SSH keys
Prevent an incorrect / misleading "There are no changes to apply" message
from popping up when adding a new SSH key to the text box.

Fixes #2048.
Signed-off-by: Dirk Brenken <dev@brenken.org>
[reword commit message]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-09-29 14:53:29 +02:00
Jo-Philipp Wich
c3f5c01d6a luci-base: corrections to Russian translation
Add grammar corrections suggested in PRs #2114 and #2190.

Suggested-by: Roman <x.wserfer@gmail.com>
[squash #2114 and #2190, reword commit message]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-09-29 14:38:51 +02:00
Jo-Philipp Wich
d79d9874d7 luci-mod-system: correct table cell rendering without umount button
Fixes #2173.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-09-29 14:09:43 +02:00
Darius
e5071c88f0 luci-base: cbi.lua: fix TypedSection.parse()
It's not necessary to execute all code if section already exists.

Signed-off-by: Darius Joksas <jok.darius@gmail.com>
[reword commit message, squash commits, remove stray semicolon]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-09-29 14:01:49 +02:00
Jo-Philipp Wich
a291a999a7
Merge pull request #2184 from kyle30312/logout-cookie-fix
luci-base: fix sysauth cookie not removed on logout
2018-09-27 21:22:32 +02:00
Kyle Rogers
c9e4085c64 luci-base: fix sysauth cookie not removed on logout
Signed-off-by: Kyle Rogers <7157021+kyle30312@users.noreply.github.com>
2018-09-27 10:04:57 -04:00
Martin Schiller
72fb7e39ef luci-base: fix german translations
Signed-off-by: Martin Schiller <ms@dev.tdt.de>
2018-09-27 09:24:45 +02:00
Florian Eckert
99ebb788cf luci-mod-network: disable setup on new wifi-iface add
If we add a new wifi-iface to the config then the iface will start at once.
But normaly we would configure the wireless security in the next step.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-09-24 11:28:51 +02:00
Rosy Song
8c57f886fc luci-base: drop ipv6 lease status when IPV6 is not support
Signed-off-by: Rosy Song <rosysong@rosinson.com>
2018-09-23 15:38:38 +08:00
Luiz Angelo Daros de Luca
728501dd57 i18n: update pt-br translation
Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
2018-09-20 21:58:33 -03:00
Jo-Philipp Wich
be24b7b480
Merge pull request #2167 from YuriPet/master
luci-base: update Ukrainian translation
2018-09-20 09:39:51 +02:00
Jo-Philipp Wich
99265f3f59 luci-mod-status: fix querying IPv6 address
Correct a typo that prevents displaying the interface IPv6 address in
some cases.

Fixes: #2166
Reported-by: Vladislav Grigoryev <20725816+vgaetera@users.noreply.github.com>
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-09-20 08:45:05 +02:00
Yurii
00c7cfe95b
luci-base: update Ukrainian translation
luci-base: corrected and update Ukrainian translation with the latest resync.

Signed-off-by: Yurii yuripet@gmail.com
2018-09-20 03:45:22 +03:00
INAGAKI Hiroshi
f5c60bd716 luci-base: update Japanese translation
Updated Japanese translations.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2018-09-20 05:15:09 +09:00
Hannu Nyman
c5ce34193e i18n: sync translations
Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2018-09-19 21:55:12 +03:00
Jo-Philipp Wich
0f91ef83af luci-base: switch admin category node to firstnode() action
After this change, luci-base will render the first module or application
page installed on the system, instead of rendering a "Component not found"
message when the status category is unavailable.

This allows for single-purpose LuCI installations like e.g. luci-base with
luci-app-travelmate which only presents application specific views without
any of the standard system pages.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-09-19 20:08:19 +02:00
Jo-Philipp Wich
11f7817d33 luci-base: dispatcher: introduce firstnode() dispatching target
The firstnode target will dispatch the request to the first eligible menu
subtree node that is not a redirect to another node, a special action or
post security enabled page.

That action is specifically useful for global category toplevel nodes like
"admin" which are supposed to simply direct access to the first installed
page node without having to hardcode specific choices.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-09-19 20:08:19 +02:00
Daniel F. Dickinson
58d97b5e27 modules: Split luci-mod-full
Move some common elements to luci-base, and otherwise make three
packages out of status, system, and network.  They were mostly
separated already, but there were some shared elements between
status and network that are now in luci-base.

Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
2018-09-19 20:08:19 +02:00
Daniel F. Dickinson
6ec0353201 modules: Make luci-base sufficient to use luci apps
Per the discussion in https://github.com/openwrt/luci/issues/869, make
luci-base sufficient to login, logout, and review and apply or revert
uci changes.  This allows most luci-app-xxx to work without having
luci-mod-admin-full installed.

It has been tested with some apps and not luci-mod-admin-full, as well
as with luci-mod-admin-full (to make sure the usual case doesn't break).

Instead of creating a new module namespace (e.g. 'Base') we reduce the
opportunities for breakage by having luci-base take over the 'shell' of
the 'Administration' (admin/....) namespace.

Since admin is assumed by all current building LuCI components (including
Freifunk), this doesn't introduce the 'Administration' tab into any
situation where it would not already be present (but includes it where it
was before).

We also add a "Component not installed" page to avoid fatal errors and
backtrace when e.g. luci-mod-admin-full is not installed.

Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
2018-09-19 20:08:19 +02:00
Jo-Philipp Wich
1a0316bbba
Merge pull request #2140 from kristrev/multiple-upstream-interfaces-status
luci-base: Show multiple upstream interface
2018-09-19 11:36:30 +02:00
Kristian Evensen
a13748d414 luci-base: Show multiple upstream interface
Several devices have multiple upstream interfaces, for example a fixed
and a mobile broadband connection. Currently, only one upstream
interface is shown per address family in Luci. So in my example, one of
the interfaces would not appear on the Status-page.

This PR introduces support for showing multiple upstream interfaces on
the Status-page. The code is not very complicated. get_status_by_route()
has been extended to return a list of all routes, and
get_wannet()/get_wan6net() now returns all upstream interfaces.

I could not find any other (active) users of these three functions than
calls triggered from the Status-page, so changing the default behavior
should be fine. get_wandev()/get_wan6dev() called get_status_by_route(),
but I could not find any place where those functions were called. I
removed the dev-functions instead of keeping the old
get_status_by_route().

On the status page, the wan/wan6-variables have been replaced with
arrays. When populating the html, we now iterate through these arrays
and create one element for each interface.

I have tested the code with different interface types, v4, v6, as well as
disconnecting and connecting interfaces. The status is updated and the
correct interfaces (or sometimes none at all) are shown.

Signed-off-by: Kristian Evensen <kristian.evensen@gmail.com>
2018-09-19 11:01:38 +02:00
Jo-Philipp Wich
9142a71469 luci-mod-admin-full: fix diagnostic page glitch
Slightly restructure markup to avoid inconsistent button rendering.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-09-18 18:45:19 +02:00
Jo-Philipp Wich
e11980b150
Merge pull request #2121 from jokdarius/feature/0001-performace-fix
luci-mod-admin-full: performance fix
2018-09-18 17:18:23 +02:00
Hannu Nyman
6bea6eebf0
Merge pull request #2122 from rosysong/backup
Backup: add firmware backup for mtdblock devices
2018-09-14 20:05:36 +03:00
Yusuf Soyipek
96c2b30960
luci-base: update Turkish translation
Add missing translations.

Signed-off-by: Yusuf Soyipek <yusuf@soyipek.com>
2018-09-13 23:17:57 +03:00
Martin Schiller
5f7c695848 i18n: sync translations
Signed-off-by: Martin Schiller <ms@dev.tdt.de>
2018-09-12 11:17:30 +02:00
Rosy Song
9840d310e2 modules: add backup module for mtdblock devices
Signed-off-by: Rosy Song <rosysong@rosinson.com>
2018-09-08 15:07:01 +08:00
Anton Kikin
9b4bc1da41 luci-base: fix a typo in Russian translation
Signed-off-by: Anton Kikin <a.kikin@tano-systems.com>
2018-09-06 09:14:31 +08:00
Krystian Kozak
b16a257bd6 luci-base: update Polish translation
Updated Polish translations.

Signed-off-by: Krystian Kozak <krystian.kozak20@gmail.com>
2018-09-02 19:26:26 +02:00
Anton Kikin
961d02103f luci-base: update Russian translation
Add missing translations.

Signed-off-by: Anton Kikin <a.kikin@tano-systems.com>
2018-09-01 16:38:36 +03:00
Yurii
f10818b98a
luci-base: update Ukrainian translation
Updated with the latest sync translation.

Signed-off-by: Yurii yuripet@gmail.com
2018-09-01 00:16:40 +03:00
INAGAKI Hiroshi
6b4e30bd28 luci-base: update Japanese translation
Updated Japanese translations.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2018-09-01 03:30:34 +09:00
INAGAKI Hiroshi
7cafad8b31 i18n: sync translations
Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2018-09-01 02:23:25 +09:00
Darius
7222bdabd4 luci-mod-admin-full: performance fix
*	uci:get replaced with direct access of value (functions has 3x better performance in that way)

Signed-off-by: Darius Joksas <jok.darius@gmail.com>
2018-08-31 10:54:35 +03:00
Dirk Brenken
53b90e3c8c luci-mod-admin-full: fix forced upgrade
* fix logical glitch in forced upgrade logic

Signed-off-by: Dirk Brenken <dev@brenken.org>
2018-08-20 21:36:11 +02:00
Dirk Brenken
89486bd66f luci-mod-admin-full: allow forced upgrade (revised)
* allow 'forced' firmware upgrades, even if the image format check
fails. Useful where flashing back to the OEM versions or switching
between ar71xx and ath79 builds
* option is only visible after first/failed image check
* added warning info (see screenshots below)

Signed-off-by: Dirk Brenken <dev@brenken.org>
2018-08-17 12:52:36 +02:00
Jo-Philipp Wich
8c77975d1b luci-base: remove fake password field from tab order
Set a negative tabindex on the dummy password field to not break the form
tab order flow.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-08-17 06:58:53 +02:00
Jo-Philipp Wich
98d4eb1695 luci-base: mark password template dummy field as hidden
Mark the dummy input field as aria-hidden, should fix #2063.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-08-16 09:36:37 +02:00
hcwhan
93cf4e2a27
Update base.po 2018-08-15 13:43:49 +08:00
Ansuel Smith
442ece768d
luci-mod-admin-full: applyreboot doesn't reload page
The applyreboot page doesn't reload the page onload of the loding gif. This adds the right function.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2018-08-13 10:57:21 +02:00
Jo-Philipp Wich
849d153851 treewide: rework uci change display
- Use native rpcd uci changes format instead of incompletely converting
   back and forth between the old and the new format
 - Rework uci changelog template to print the equivalent uci commands
   for the various changes
 - Rework theme headers to properly count the uncomitted changes
 - Rework theme CSS to properly style new changelog

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-08-13 09:23:22 +02:00
Yurii
75bac85992
Update base.po: corrected translation errors
Signed-off-by: Yurii yuripet@gmail.com
2018-08-10 17:40:44 +03:00
Ansuel Smith
327e284b74
luci-mod-admin-full: fix broken applyreboot page
This improve applyreboot page and fix problem with luci-nginx that doesn't refresh the page when the router reboot.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2018-08-08 10:11:12 +02:00
Gregory L. Dietsche
abfe45ff61 Correct grammar in apply_widget.htm
This patch corrects "to get" to "to be" in apply_widget.htm
This shell command was used to find and make the change in
all impacted files:

find . -type f -exec sed -i 's/Waiting for configuration to get applied/Waiting for configuration to be applied/g' {} +

Signed-off-by: Gregory L. Dietsche <gregory.dietsche@cuw.edu>
2018-08-07 09:20:28 -05:00
yangfl
c51f0d9714 luci-base: update Chinese translation
Signed-off-by: David Yang <mmyangfl@gmail.com>
2018-08-07 15:39:41 +08:00
Krystian Kozak
10f12d7f6a luci-base: update Polish translation
Updated Polish translations.

Signed-off-by: Krystian Kozak <krystian.kozak20@gmail.com>
2018-08-05 14:38:57 +02:00
Alan Swanson
4b3d20cda4 luci-mod-admin-full: Fix DSL Stats display of dB statistics
Line attenuation, signal attenuation, noise margin and aggregate transmit power really need to show
decimal digits. Fixes commit 88713f6 from issue #2003 due to excess changes from %s to %d.
2018-08-04 12:36:49 +01:00
Hannu Nyman
26bbd01f37
Merge pull request #2001 from Rixerx/master
luci-base: update Polish translation
2018-07-30 23:09:01 +03:00
Jo-Philipp Wich
00c95d7906
Merge pull request #2012 from jempatel/master
fix compilation failure when luasrcdiet is being copied to non existing directory
2018-07-30 16:07:00 +02:00
Jaymin Patel
bb336671ff fix compilation failure when luasrcdiet is being copied to non existing directory
Signed-off-by: Jaymin Patel <jem.patel@gmail.com>
2018-07-30 19:32:37 +05:30
Jo-Philipp Wich
88713f6456 luci-mod-admin-full: rework DSL Status display
Fixes #2003.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-29 21:12:30 +02:00
Jo-Philipp Wich
a0b4d2adb6 luci-mod-admin-full: fix style glitch on packages page
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-28 14:41:34 +02:00
Jo-Philipp Wich
63fbf5a805 luci-base: fix luasrcdiet
- Stage required libraries as well
 - Remove not existing make target
 - Override library search path

Fixes: b5d5e5bf1 ("luci-base: update luasrcdiet")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-28 14:21:51 +02:00
Jo-Philipp Wich
350be23eb9 luci-base: fix footer template
Move the apply widget markup before the final </html> tag to avoid XHTML
errors with the OpenWrt theme.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-28 14:21:36 +02:00
Krystian Kozak
6dbdc2cae8 luci-base: update Polish translation
Updated Polish translations.

Signed-off-by: Krystian Kozak <krystian.kozak20@gmail.com>
2018-07-27 23:10:49 +02:00
Jo-Philipp Wich
e5a1ac0228 treewide: rework rollback/apply workflow
Rework the apply confirmation mechanism to be session agnostic in order to
circumvent cross domain restrictions which prevent the JS code from issuing
apply confirm requests in some cases, e.g. when changing the LAN IP.

Confirmation calls may now be done from unauthenticated pages, as long as a
matching confirmation token is sent along with the request.

The reasoning behind this is that there is little security impact in
confirming pending apply sessions, especially since those sessions can only
be initiated while being authenticated.

After this change, LuCI will now launch a confirmation process on every
rendered page when a rollback is pending. The confirmation will happen
regardless of whether the user is logged in or not, or if the current page
is a CBI form or static template.

A confirmation request now also requires a random one-time token which is
rendered along with the confirmation JavaScript code in order to succeed.

This token is not meant to provide security but to ensure that the confirm
was triggered from an interactive browser session and not some background
HTTP requests that happened to end up in the admin ui.

As a consequence, the different apply/confirm/rollback code paths in CBI
maps and the UCI change/revert pages have been consolidated into one common
implementation residing in the common global theme agnostic footer template.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-27 14:07:23 +02:00
Jo-Philipp Wich
98217f8f8d luci-base: xhr.js: decode JSON for POST requests as well
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-27 14:07:23 +02:00
Jo-Philipp Wich
9ead1e29a6 luci-base: utils: support multiple return values in util.ubus()
This is needed to deal with ubus methods that return multiple results,
e.g. session/list

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-27 14:07:23 +02:00
Jo-Philipp Wich
ddf4c2b617
Merge pull request #1993 from sotux/master_zh_CN
luci-base: zh_CN: Update Simplified Chinese translation
2018-07-26 20:24:13 +02:00
Jo-Philipp Wich
8a1bc1814f luci-mod-admin-full: abbreviate "MAC-Address" as "MAC" to align with rest
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-26 19:20:39 +02:00
Jo-Philipp Wich
80706cbafb luci-mod-admin-full: fix wifi overview display when no networks are defined
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-26 19:15:42 +02:00
Zheng Qian
33d3108d95 luci-base: zh_CN: Update Simplified Chinese translation
Signed-off-by: Zheng Qian <sotux82@gmail.com>
2018-07-25 11:24:41 +08:00
Jo-Philipp Wich
c27a77756c luci-base: strip superfluous space in additional field markup
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-23 15:10:55 +02:00
Jo-Philipp Wich
590d1cc74f luci-base: cbi.js: fade to-be-deleted section when hovering delete button
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-23 15:06:26 +02:00
Jo-Philipp Wich
875b561875 luci-base: cbi.js: use adjacent button dynlist add/remove buttons
Change the cbi.js code to create  a div based button element instead of an
image button.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-23 14:31:40 +02:00