Commit graph

455 commits

Author SHA1 Message Date
Ansuel Smith
b5d5e5bf13
luci-base: update luasrcdiet
Tested and works with no problem.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2018-06-27 16:41:02 +02:00
INAGAKI Hiroshi
fe591dd1cc i18n: fix syntax errors in Ukrainian po
"Content-Type: text/plain; charset=UTF-8" was wrote twice in each
of base.po and firewall.po, and one was an incorrect place which
was the cause of the errors.

And, The escape in abbr HTML tag was incorrect, so I fixed it.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2018-06-16 23:36:18 +09:00
Kevin Darbyshire-Bryant
8f67019713 wireguard: update wireguard url
Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
2018-06-11 11:43:39 +01:00
Yurii
0c410c848b
luci-base: update Ukrainian translation
Updated Polish translations.

Signed-off-by: Yurii <yuripet@gmail.com>
2018-06-10 16:56:13 +03:00
Krystian Kozak
ad5f768c40 luci-base: update Polish translation
Updated Polish translations.

Signed-off-by: Krystian Kozak <krystian.kozak20@gmail.com>
2018-06-10 11:25:54 +02:00
Hannu Nyman
fad02ac8d7
Merge pull request #1868 from sotux/master-zh_CN
Update Simplified Chinese translation
2018-06-09 17:53:27 +03:00
Jo-Philipp Wich
e7866c7dcc luci-mod-admin-full: add suggested italian translations
Merge two italian translations suggested in #1870 and add back two missing
dots accidentially removed from the translations in a previous commit.

Fixes: 588c8618b ("luci-mod-admin-full: fix translation interpolation in JS confirm() calls")
Suggested-by: Ansuel Smith <ansuelsmth@gmail.com>
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-06-08 16:05:48 +02:00
Jo-Philipp Wich
0e0ee2fed5 luci-mod-admin-full: git rid of embedded newlines in translation strings
Also switch one usage of raw '<%_ ... %>' interpolation to '<%: ... %>' in
order to avoid issues with translations using apostrophes.

Globally resnyc translations after the fix.

Fixes #1866.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-06-08 13:50:14 +02:00
Zheng Qian
2e7fa89e1a luci-base: update Simplified Chinese translation
Signed-off-by: Zheng Qian <sotux82@gmail.com>
2018-06-08 16:43:40 +08:00
Jo-Philipp Wich
74be6f3974 treewide: switch firewall zone, network and iface lists to dropdown code
Also switch the weekday and monthday lists in the firewall rule details to
cbi dropdowns, vastly uncluttering the form.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-06-08 08:19:20 +02:00
Jo-Philipp Wich
9d48490729 luci-base: add markup, JS and CSS for new dropdown
This commit introduces the required code for a new, markup based dropdown
widget which can be used as a styleable alternative to select boxes or
radio/checkbox button groups.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-06-08 08:14:36 +02:00
Jo-Philipp Wich
4cca96ef09 luci-base: support option aliases in luci.cbi
AbstractValue descendants may now specify a new optional property `alias`
which refers to a uci option to read/write/remove that differs from the
option name itself.

This is mainly useful for widgets that are toggled based on dependencies,
e.g. for alternating between SingleValue and MultiValue, but which are
intented to write into the same uci option.

Such a setup was previously possible already by overriding the .cfgvalue(),
.write() and .remove() callbacks with custom implementations, but that
required a lot of boiler plate code and was rather fragile.

With the `alias` property, CBI now takes care of the details and tracks
aliased fields within a section accordingly.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-06-08 07:25:54 +02:00
Jo-Philipp Wich
7be3f0400c luci-base: fix some minor luci.model.uci issues
- Properly serialize option delete changelogs
 - Do not perform a section create if a nil value is passed to set()

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-06-06 21:45:49 +02:00
Jo-Philipp Wich
2d352a9251 luci-base: cbi: atomically reorder uci sections
Since the switch to ubus uci operations we do not have a local application-
side cursor cache anymore, instead uci operations happen synchronously in
the rpcd backend server.

This may cause cbi section reorder operations involving multiple elements
to fail, because anonymous section hashes may change due to rehashing
between consecutive ubus uci reorder calls.

In order to avoid that problem, use the ubus uci batch reorder extension,
which allows to pass a complete (or partial) list of section ids in the
desired order in one call, bypassing the volatile section id problem.

Fixes #1844.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-06-03 20:02:44 +02:00
INAGAKI Hiroshi
f28784b61e luci-base: update Japanese translation
Updated Japanese translations.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2018-06-01 02:45:53 +09:00
INAGAKI Hiroshi
2d196614f4 luci-base: sync translations
Synchronized translations with sources.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2018-06-01 02:20:05 +09:00
Jo-Philipp Wich
29b391d7bc luci-base: use common alert message markup
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-05-31 19:06:48 +02:00
Jo-Philipp Wich
298d164dd7 luci-base: update coxpcall() implementation, fix runtime error reporting
Sync our coxpcall() implementation to the newest upstream version in order to
get access to the inner backtrace information and propagate these traces to
the browser in luci.dispatcher.dispatch().

This should make tracking down runtime errors much easier.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-05-31 17:45:49 +02:00
Jo-Philipp Wich
5427395649 luci-base: add full page overlay during apply
After applying uci configuration, a full map reload is required in many
cases as the anonymous section identifiers might have been rehashed, causing
the rendered map to go out of sync.

To avoid that, add both a full page overlay preventing further page
interaction and let the apply widget forcibly reload the current view once
the operation is complete.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-05-31 15:38:42 +02:00
Jo-Philipp Wich
c3da1fc232 luci-base: cbi.js: remove unused serialize functions
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-05-30 16:04:07 +02:00
Jo-Philipp Wich
d1df5a6b7d luci-base: cbi.js: fix cbi_row_swap() after recent table markup changes
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-05-30 15:59:52 +02:00
Jo-Philipp Wich
067d7dc9f7 treewide: convert HTML tables to div
Mostly convert HTML tables to div based markup to allow for easier styling
in the future. Also change JS accessor code accordingly.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-05-28 15:18:45 +02:00
Jo-Philipp Wich
79c82237e3 luci-base: add element creation helper to cbi.js
Add a new helper function `E()` to cbi.js which can be used to conveniently
build HTML markup.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-05-28 15:18:45 +02:00
Hannu Nyman
6f630b5e66
Merge pull request #1834 from Ansuel/fixpo
luci-base: fix broken translation
2018-05-27 22:07:52 +03:00
Ansuel Smith
c29ffe4dfc
luci-base: fix broken translation
Currently this translation refer to an old string, sync to the new one.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2018-05-27 21:01:33 +02:00
Yusuf Soyipek
2d053d39d0
Update base.po
Some of the shortcomings in Turkish were added.
2018-05-27 16:17:15 +03:00
Hannu Nyman
9de9a71a9f i18n: one more fix for Polish translation
Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2018-05-25 17:11:47 +03:00
Hannu Nyman
36654b7f4d i18n: sync, fix and cleanup translations
* sync translations (aiccu removal)
* remove some other old strings
* fix Polish translation

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2018-05-25 16:44:50 +03:00
Ansuel Smith
da1e655294
luci-base: fix dispacher fail
http.getenv("SCRIPT_NAME") fail if it's not provided. This can happen in the login screen when we don't have any script to load.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2018-05-23 02:52:08 +02:00
INAGAKI Hiroshi
b01471b1fc luci-base: update Japanese translation
Updated Japanese translations.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2018-05-21 01:04:53 +09:00
INAGAKI Hiroshi
b1fd056fa5 i18n: sync translations
Synchronized translations with sources.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2018-05-21 01:04:53 +09:00
Jo-Philipp Wich
64da34b13c luci-base: handle potential crash in luci.model.network.interface.get_i18n()
Should prevent the crash mentioned in #1779.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-05-19 22:11:08 +02:00
Jo-Philipp Wich
9ed48ef2a6 luci-base: break circular luci.config <> luci.model.uci dependency
On certain environments, mainly with the embedded uhttpd interpreter, the
luci.config class cannot be loaded due to a circular dependency with the
luci.model.uci class.

Break up the dependency by deferring the loading of luci.config in
luci.model.uci until it is actually needed.

Fixes #1803, FS#1553.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-05-19 13:07:37 +02:00
Jo-Philipp Wich
828202ef52
Merge pull request #1769 from jow-/master
UCI apply/rollback workflow
2018-05-18 16:44:33 +02:00
Jo-Philipp Wich
80cb4fef8c luci-base: raise maximum POST value size to 100KB
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-05-18 16:43:29 +02:00
Hannu Nyman
521554f4a7
Merge pull request #1748 from hnyman/wifidata
luci-base: show wifi chip identification on overview
2018-05-18 12:51:24 +03:00
Rixerx
3782e74cf8 luci-base: update Polish translation
Signed-off-by: Rixerx <krystian.kozak20@gmail.com>
2018-05-15 11:40:27 +02:00
Yousong Zhou
2f0f456b71 luci-base: harden cookie sysauth=
A simple scan of the code indicates that currently no code in the repo
is accessing the sysauth= cookie

Closes openwrt/luci#1555

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2018-05-13 18:30:47 +08:00
Florian Eckert
6f3007980b luci-base: reload log on uci system change
If log configuration get changed in uci system no new values are applied
until reboot. Add /etc/init.d/log reload to exec option will solve this
issue.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-05-07 14:37:35 +08:00
Florian Eckert
3cb7452eba luci-base: fix i18n de typo for rc.local
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-05-07 13:51:18 +08:00
Jo-Philipp Wich
9f796fad3a luci-base: add transitional /etc/init.d/ucitrack
Ship an /etc/init.d/ucitrack for spawning a virtual service with the sole
purpose to track the configurations and dependencies formerly handled by
luci-reload.

Once all LuCI supported services ship with procd compatible init scripts,
the uci track support can be dropped.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-05-05 23:11:23 +02:00
Jo-Philipp Wich
8deb949551 treewide: rework uci apply workflow
Switch to rpcd based uci apply/rollback workflow which helps to avoid soft-
bricking devices by requiring an explicit confirmation call after config
apply.

When a user now clicks "Save & Apply", LuCI first issues a call to uci apply
which commits and reloads configuration, then goes into a polling countdown
mode where it repeatedly attempts to call uci confirm.

If the committed configuration is sane, the confirm call will go through and
cancel rpcd's pending rollback timer.

If the configuration change leads to a loss of connectivity (e.g. due to bad
firewall rules or similar), the rollback mechanism will kick in after the
timeout and revert configuration files and pending changes to the pre-apply
state.

In order to cover such rare cases where a lost of connectivity is expected
and desired, the user is offered an "unchecked" apply option after timing
out, which allows committing and applying the changes anyway, without the
extra safety checks.

As a consequence of this change, the luci-reload mechanism is now completely
unsused since rpcd uses ubus config reload signals to reload affected
services, which means that only procd-enabled services will receive proper
reload treatment with the new workflow.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-05-05 23:11:23 +02:00
Jo-Philipp Wich
7cca313959 luci-base: enable uci session isolation
Switch to per-session save directories to decouple LuCI configuration changes
from system wide ones.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-05-05 23:11:23 +02:00
Jo-Philipp Wich
34821b15a5 luci-base: xhr.js: fix timeout setting with IE 11
Internet Explorer 11 requires the timeout to be applied after the open()
call, otherwise an invlaid state exception will be raised

Fixes aa6c97154 ("luci-base: extend xhr.js")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-05-05 21:16:53 +02:00
Hannu Nyman
4edc9256fa luci-base: show wifi chip identification on overview
Show the correct wifi chip identification in case iwinfo
recognises the chip.

So far the wifidev.get_i18n function has practically always
returned just "Generic", but use iwinfo.hardware_name to
fetch the name.

In case iwinfo returns the default "Generic MAC80211", there
is a double 80211 in the final string, which is a cosmetic bug.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2018-05-05 21:20:41 +03:00
Jo-Philipp Wich
b0f3946570 luci-base: support hiding the "Back to Overview" button in cbi maps
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-05-03 08:25:26 +02:00
Jo-Philipp Wich
07de9190d8 Revert "luci-base: support hiding the "Back to Overview" button in cbi maps"
This reverts commit 52cf265c9d.

I accidentally committed unrelated changes.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-05-03 08:24:36 +02:00
Jo-Philipp Wich
52cf265c9d luci-base: support hiding the "Back to Overview" button in cbi maps
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-05-03 08:22:55 +02:00
Ricardo Lamego
e55a5fa386 Fixing small typo
indentifies > identifies
2018-05-02 21:01:53 +01:00
INAGAKI Hiroshi
27af493779 luci-base: update Japanese translation
Updated Japanese translations.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2018-05-03 00:25:41 +09:00