Commit graph

2707 commits

Author SHA1 Message Date
Jo-Philipp Wich
f970c485cf treewide: switch to shared isObject(), toArray() and sortedKeys() helpers
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 20:11:35 +02:00
Jo-Philipp Wich
37ca6fe6d6 luci-base: luci.js: add isObject(), toArray() and sortedKeys() helper
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 20:10:13 +02:00
Jo-Philipp Wich
d6aa68ae0d luci-mod-network: switch route configuration page to client side view
Also implement extended route attributes via modal dialog.

Fixes: #2695
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 19:12:59 +02:00
Jo-Philipp Wich
bce291e6c9 luci-base: form.js: reload map data when saving modal forms
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 19:12:59 +02:00
Jo-Philipp Wich
f8e6caf552 luci-base: widgets.js: add textvalude representation for network select
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 19:12:59 +02:00
Jo-Philipp Wich
1fad6c0eed
Merge pull request #2806 from dibdot/magic
system-wide: fix escaping of magic chars
2019-07-07 15:39:56 +02:00
Jo-Philipp Wich
e13822e709 luci-base: uci.js: track packages affected by reorder operations
This is required to properly reload the configurations after applying uci
changes that solely consist of uci section ordering operations.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:26 +02:00
Jo-Philipp Wich
00a3da1fb3 luci-base: fix regular expression in network.Protocol.getDevices()
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:26 +02:00
Jo-Philipp Wich
a13dba8071 luci-base: add tools.widgets JS library
Add a tools.widgets library which bundles a number of useful, higher
level CBI widgets like firewall zone list or network interface dropdowns

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:26 +02:00
Jo-Philipp Wich
1bd9ee91af luci-base: validation.js: rework translation labels
Rework validation error translations for compount operators such
as list() or neg() to not rely that much on specific native language
grammar.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:26 +02:00
Jo-Philipp Wich
0560858380 luci-base: uci.js: add extended section syntax support, improve loading
Add support for extended section syntax notation in @type[#] format and
refactor the package loading function to not load configurations twice
when a package load operation is already pending and another load request
is made for the same package.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:26 +02:00
Jo-Philipp Wich
dc2b38cb6f luci-base: {ui,form}.js: allow passing additional CSS classes to modals
Add the ability to pass additional CSS classes to modal dialogs and
make use of this facility in form.js to annotate CBI map modals.

This can be used later by themes to apply additional CSS rules.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:26 +02:00
Jo-Philipp Wich
1605f29b6f luci-base: luci.js: don't abort finished xhr objects
Calling abort() on a finished xhr object will clear properties such
as status which can confuse code relying on legacy LuCI request
helper functions.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:26 +02:00
Jo-Philipp Wich
0bcb9f9f1d luci-base: cbi.js: fix number rounding in string.format()
Ensure that patterns like %d, %x, %o or %b properly truncate their
operands to whole integers.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:26 +02:00
Jo-Philipp Wich
0539e7f6b9 luci-base: form.js: support placeholders for DynamicList widgets
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:25 +02:00
Jo-Philipp Wich
1482554de6 luci-base: form.js: fix rendering flag values in modals
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:25 +02:00
Jo-Philipp Wich
ff775a69f7 luci-base: form.js: trigger validation before saving cbi map
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:25 +02:00
Jo-Philipp Wich
bf3bf6a8a9 luci-base: form.js: prevent section creation on modal cbi save failure
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:25 +02:00
Jo-Philipp Wich
4a0f8b5541 luci-base: ui.js: fix rendering of rich dropdown placeholders
Placeholders may be HTML elements instead of plain strings, so do
not use innerHTML to assign them but rely on L.dom.content() instead.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:25 +02:00
Jo-Philipp Wich
2f79aa1c35 luci-base: implement further ubus calls
Implement new ubus rpcd backend calls for later use in the frontend:

 - netdevs: dump information about Linux network devices present
 - boardjson: dump /etc/board.json if present
 - offload_support: query whether netfilter offloading is supported

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:25 +02:00
Jo-Philipp Wich
c5b6f42943 luci-base: fix handling of large ubus HTTP requests
Properly handle ubus POST requests exceeding the default chunk size
and fix a possible nil dereference when rejecting incoming requests
due to bad JSON message framing.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:25 +02:00
Jo-Philipp Wich
79be2d57cd luci-base: add client-side implementation of luci.model.firewall
Introduce firewall.js, a client side reimplementation of the
luci.model.firewall class.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:25 +02:00
Jo-Philipp Wich
eecf859b29 luci-base: add client-side implementation of luci.model.network
Introduce network.js, a client side reimplementation of the
luci.model.network class.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:25 +02:00
Jo-Philipp Wich
928adb6484 luci-base: add client-side prng library
Introduce a new tools.prng JS library which implements the musl libc
srand() and rand() calls to produce identical pseudo random number
sequences in the browser which is needed for the string to color
conversion later on.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:25 +02:00
Jo-Philipp Wich
5950b87dac luci-base: luci.js: make require() failures catcheable
Refactor L.require() to use L.raise() instead of L.error() to signal
class loading failures. This allows callers to handle class loading
errors in a graceful manner.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:25 +02:00
Jo-Philipp Wich
6edc057451 luci-base: split off CBI validations into separate class
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:25 +02:00
Jo-Philipp Wich
8a6b89c671 luci-base: luci.js: rework L.error()
Factor out an L.raise() function out of L.error() which constructs and
throws an exception object.

Rework the remaining L.error() function to internally use L.raise() to
construct exceptionts to render.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:25 +02:00
Jo-Philipp Wich
f302eabd72 luci-base: form.js: default to unlimited dropdown size
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:25 +02:00
Jo-Philipp Wich
c2f8bc90ff luci-base: ui.js: improve dropdown behaviour
- Do not artificially cutoff dropdown items, use all available space
 - Close open dropdown when clicking into the preview area

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:25 +02:00
Jo-Philipp Wich
a96bec68a0 luci-mod-network: replace DHCP & DNS view with client side implementation
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:25 +02:00
Jo-Philipp Wich
bfae09e574 luci-base: implement lease status ubus call
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:25 +02:00
Jo-Philipp Wich
a31dc6f3c1 luci-base: rpc.js: drop batch api
Now that LuCI.Request is transparently coalescing requests, there
is no need for the rather cumbersome batch()/flush() api in rpc.js.

Also refactor the code to get rid of the rpcRequestRegistry indirection
and remove superfluous promises which simplifies the code a lot.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:25 +02:00
Jo-Philipp Wich
5264a943b9 luci-mod-system: rework leds.js and system.js views
- Drop manual RPC batch usage
- Use LuCI.Poll for status updates

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:25 +02:00
Jo-Philipp Wich
b21a2813b4 luci-base: luci.js: auto-coalesce ubus requests
Extend LuCI.Request to automatically coalesce subsequent requests
to ubus resources into single batch requests.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:24 +02:00
Jo-Philipp Wich
90288b2e2c luci-base: rpc.js: make base URL configurable
Implement setters and getters for the base URL prefix used and also
implement a session ID getter while we're at it.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:24 +02:00
Jo-Philipp Wich
eee323cb66 luci-base: luci.js: introduce generic LuCI.Poll
Introduce a new LuCI.Poll class which is able to repeat any
promise based function and not strictly tied to HTTP request
semantics.

Also rework LuCI.Request.Poll and XHR.Poll as well as
LuCI.start(), LuCI.stop(), LuCI.halt() etc. to redirect to
the new api.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:24 +02:00
Jo-Philipp Wich
8a8e8e0aac luci-base: luci.js: enable strict mode
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:24 +02:00
Jo-Philipp Wich
74ccea6fa2 luci-base: luci.js: handle postprocessed sources
- Fix discovering base url if cache buster is appended to luci.js href
 - Fix extracting require tokens in minified sources

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:24 +02:00
Jo-Philipp Wich
675824e377 luci-mod-system: use client side cbi forms for system and led config
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:24 +02:00
Jo-Philipp Wich
c7a9900c87 luci-base: add sys.init.reload() and sys.init.restart() actions
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:24 +02:00
Jo-Philipp Wich
6665a1d78c luci-base: add rpcd backend plugin
Add an rpcd executable plugin containing procedures required by client
side views.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:24 +02:00
Jo-Philipp Wich
3bc73a7d05 luci-base: luci.js: catch base class loading errors
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:24 +02:00
Jo-Philipp Wich
b839ee87f2 luci-base: introduce form.js
Add a new client side form.js library which is a more or less direct
reimplementation of the Lua side cbi.lua in JavaScript.

Due to its client side nature, it supports a number of features which
would be hard to realize on the server side, such as drag&drop sorting,
modal sub-map dialogs, reload-free editing etc.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:24 +02:00
Jo-Philipp Wich
9c7eb1decd luci-base: switch from server side to client side widget markup
Do not render standard widgets like checkboxes, select boxes,
text input fields etc. on the server side anymore but utilize
the ui.js primitives instead.

This avoids logic duplication between server side cbi templates
and JS widgets in the future.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:24 +02:00
Jo-Philipp Wich
808b9f36eb luci-base: cbi.js, ui.js: add custom validation callbacks, new ui widgets
Implement further widget primitives like text inputs or checkboxes and
support custom validation callback functions when instantiating CBI
validators.

Also add support initializing ui.js widgets from the "data-ui-widget"
HTML attribute.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:36:23 +02:00
Jo-Philipp Wich
2beb9fa16f luci-base: add client based view actions
Introduce a new view() target for CBI dispatch nodes, as long with the
required template and plumbing work in luci.js to allow requiring view
classes.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:25:49 +02:00
Jo-Philipp Wich
5b7924c808 luci-base: luci.js: tweak error handling
If the ui class is loaded, use its modalDialog facility to display runtime
errors, alternatively render them into the maincontent area.

Also prevent duplication of stack trace information and throw a low level
error on session expiration to allow higher layers to properly handle it.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:25:49 +02:00
Jo-Philipp Wich
fda4ba598c luci-base: replace uci change pages with client side modal dialog
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:25:49 +02:00
Jo-Philipp Wich
1dd910148e luci-base: add uci.js and rpc.js classes
Add a new rpc.js class which provides low level facilities to exchanges
messages with the ubus rpc endpoint.

Also introduce a new uci.js class which provides client side uci
manipulation routines.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:25:49 +02:00
Jo-Philipp Wich
c89bbd50fd luci-base: add ubus-http gateway
Add an admin/ubus route mimicking the native uhttpd-mod-ubus protocol.

The main difference to the native protocol is that this gateway requires
no additional per-object/procedure ACL setup on the router side and that
it is located under the same prefix as LuCI itself, allowing the reuse
of the session login cookie.

This route is meant to be a transitional mechanism until client side
RPC calls are eventually migrated to uhttpd-mod-ubus completely.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:25:49 +02:00
Jo-Philipp Wich
558f8c3b2a luci-base: move dropdown, combox and dynlist widget code to L.ui
Move the widget code to the ui class and replace it with compatibility
shims in cbi.js

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:25:49 +02:00
Jo-Philipp Wich
e4c29c6db4 luci-base: luci.js: add L.dom.data()
Add a new data() function which allows to attach arbitrary JS data
to DOM elements.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:25:49 +02:00
Jo-Philipp Wich
4a9f784a2a luci-base: cbi.js: support field validation for formless inputs
JS CBI fields have no parent form element anymore.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:25:49 +02:00
Jo-Philipp Wich
6b8701c7bf luci-base: cbi.js: untangle dropdown and dynlists from dependency update
In order to prepare the move of the dynlist and dropdown widgets into
the LuCI ui class, remove the direct calls to cbi_d_update() and replace
them with custom events instead.

Extend cbi_init() to handle these custom events and to invoke
cbi_d_update() when receiving them.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:25:49 +02:00
Jo-Philipp Wich
1b931e0262 luci-base: luci.js: add L.bind() helper
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:25:49 +02:00
Jo-Philipp Wich
ef187d5238 luci-base: luci.js: consolidate error handling
Add a new function L.error() which creates and throws a custom
error object with stack information and given type.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:25:49 +02:00
Jo-Philipp Wich
26e54bb01f luci-base: luci.js: convert LuCI.dom to Class instance
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:25:49 +02:00
Jo-Philipp Wich
344c4c5119 luci-base: luci.js: split ui helper functions into external ui.js
Use the new class loader infrastructure to move gui specific
functionality out of the luci.js core and dispatch a new event
'luci-loaded' which is fired once all external classes have
been fetched.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:25:49 +02:00
Jo-Philipp Wich
ec6d4094b9 luci-base: luci.js: add dynamic class loader
Introduce L.require() to fetch additional JavaScript classes.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:25:49 +02:00
Jo-Philipp Wich
992638947d luci-base: luci.js: convert LuCI to Class instance
Also hijack cbi_init() and call it after the LuCI DOM setup.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:25:49 +02:00
Jo-Philipp Wich
843031f819 luci-base: luci.js: add HTTP request functions
Add a fetch() inspired HTTP request utility class to luci.js and
replace the old xhr.js class with a stub using the new request api.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:25:49 +02:00
Jo-Philipp Wich
fee8c1fc9c luci-base: luci.js: add class construction helper
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:25:49 +02:00
Jo-Philipp Wich
9be6bb0577 luci-base: add ES6 Promise polyfill for IE < Edge
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:25:49 +02:00
Jo-Philipp Wich
53e20c4925 luci-base: luci.js: add Object.assign polyfill
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07 15:25:49 +02:00
Yousong Zhou
3a24c2dbaa luci-base: hide autocomplete-preventing password input with bigger offset
Fixes openwrt/luci#2624

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2019-07-06 22:48:10 +08:00
Yousong Zhou
609f5290c8 luci-base: nowrap for password input and reveal button
Fixes openwrt/luci#2624

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2019-07-06 22:48:10 +08:00
Hannu Nyman
2f769ee087 timezone data: update to 2019b
Update timezone data to 2019b

http://mm.icann.org/pipermail/tz-announce/2018-December/000055.html
http://mm.icann.org/pipermail/tz/2019-July/028249.html

2019a:
* Palestine "springs forward" on 2019-03-30 instead of 2019-03-23.
* Brazil no longer observes DST.

2019b:
* Palestine's 2019 spring-forward transition was on 03-29, not 03-30.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2019-07-05 17:56:04 +03:00
Martin Schiller
cc360b94f8 luci-base: fix typo in german translation
Signed-off-by: Martin Schiller <ms@dev.tdt.de>
2019-07-02 09:13:15 +02:00
Martin Schiller
001dc0664e luci-base: add german translations for led trigger
Signed-off-by: Martin Schiller <ms@dev.tdt.de>
2019-07-01 08:51:17 +02:00
Martin Schiller
19289107dd luci-mod-system: fix flash activity trigger name
The former name "Flashmemory write access" is wrong. The triggers also
indicate read/erase access to the flash memories.

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
2019-07-01 07:02:42 +02:00
Dirk Brenken
f73da9ca82
system-wide: fix escaping of magic chars
* fix escaping of magic lua chars (#2800)
* fix redundant second gsub line in shellstartsqescape function
* fix return value of shellstartsqescape function

Signed-off-by: Dirk Brenken <dev@brenken.org>
2019-06-29 19:26:07 +02:00
Hannu Nyman
1c80eb1962 luci-base: show niced processes on Status/Processes page
Modify the process status filter to allow also the processes
with a nice value to be visible on the Status/Processes page.

Filter out the top process itself.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2019-06-28 18:56:53 +03:00
Martin Schiller
a8f79f12d6 luci-mod-system: fix some led trigger name translations
Signed-off-by: Martin Schiller <ms@dev.tdt.de>
2019-06-28 15:44:26 +02:00
Florian Eckert
977f657791
Merge pull request #2061 from Ansuel/improveconn
luci-mod-admin-full: improve connection page lookup loop
2019-06-28 07:49:37 +02:00
Bjørn Mork
689934196f luci-mod-network: os-release variables have been renamed to OPENWRT_
commit 8a34a54b6aa6 ("base-files: use OPENWRT prefix for os-release
variables") changes the prefix of the os-release variables from LEDE_
to OPENWRT_.  Use the new name.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
2019-06-26 14:54:27 +02:00
Franco Castillo
d3bb50dcd8 luci-base: Update Spanish translation
Update Spanish translation

Signed-off-by: Franco Castillo <castillofrancodamian@gmail.com>
2019-06-22 17:41:17 -03:00
Jo-Philipp Wich
1aa13ed51e luci-mod-system: prevent clearing rc.local on unrelated submit actions
Fixes: #2760
Fixes: 1c09ee5e4 ("luci-mod-system: fix SimpleForm usage on file editing pages")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-06-12 17:47:30 +02:00
Perry Thompson
1818499243 luci-base: update Traditional Chinese translation
Signed-off-by: Perry Thompson <contact@ryper.org>
2019-06-12 20:55:47 +08:00
a962702
b93d66d806 luci-base: update Traditional Chinese translation
update Traditional Chinese translations.

Signed-off-by: Andy Yun <a962702@yahoo.com>
2019-06-11 20:43:33 +08:00
Andy
7e27e3f930 luci-base: update Traditional Chinese translation
update Traditional Chinese translation.
Signed-off-by: Andy Yun <a962702@yahoo.com>
2019-06-11 20:43:33 +08:00
Hannu Nyman
0a5579a631 i18n: sync translations
Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2019-06-09 19:24:00 +03:00
Anton Kikin
886e0b3eff luci-base: update Russian translation
Signed-off-by: Anton Kikin <a.kikin@tano-systems.com>
2019-06-05 21:43:17 +03:00
Jo-Philipp Wich
1c09ee5e42 luci-mod-system: fix SimpleForm usage on file editing pages
When a value identical to the stored one is submitted, the CBI framework
will not emit an option write event and therfore not store the value in
the form data dictionary passed to SimpleForm.handle().

This usage pattern usally works be accident for file editor views such
as admin_system/crontab because \r\n windows style line endings are
substituted with unix \n ones before writing the data, defeating the
equality check in CBI.

When a single line without trailing newline is submitted however, the
CBI will not see a difference to the data stored in the file and clear
out the value on subsequent saves.

This commit alignes the logic used by various SimpleForm views to
behave identically and predictable:

 - File data is handled in the SimpleForm.handle() callback
 - The forcewrite property is used to disable equality checks
 - Submission of an empty string empties the backing file

Fixes: #2737
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-06-05 16:15:40 +02:00
Dirk Brenken
64fb538568
luci-base: fix duid_to_mac reference in status.lua
* fix for openwrt/packages#9148

Signed-off-by: Dirk Brenken <dev@brenken.org>
2019-06-04 16:54:24 +02:00
Ansuel Smith
bb34a31e81
luci-base: handle dhcp lease from odhcpd
Currently only the dnsmasq lease file is read for hostname hint. If someone use only odhcpd as dhcp daemon the hostname resolution on wifi_assoc list is broken.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2019-06-03 12:51:33 +02:00
Ansuel Smith
525d62ff33
luci-base: adds duid_to_mac to sys.lua
Move duid_to_mac function from status.lua to sys.lua.
Implement translation from DUID-LL without header to MAC

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2019-06-03 12:48:48 +02:00
Florian Eckert
889e8eec4f
Merge pull request #2670 from TDT-AG/pr/20190410-luci-mod-network
luci-mod-network: move auto option to general tab
2019-05-29 11:10:19 +02:00
Florian Eckert
d1d5471137
Merge pull request #2174 from rosysong/lease-status
luci-base: drop ipv6 lease status when IPV6 is not support
2019-05-25 21:43:50 +02:00
Lars Kruse
ed6a660261 luci-base: Update German translation
The following changes are included:
* properly handle "Präfix" as neuter
* add missing hyphens to many appearances of "Präfix"
* fix spelling
* add few missing translations

Signed-off-by: Lars Kruse <devel@sumpfralle.de>
2019-05-18 00:26:44 +02:00
Hannu Nyman
a7d35ede73
Merge pull request #2716 from castillofrancodamian/base
luci-base: Update Spanish translation
2019-05-17 16:56:26 +03:00
Zheng Qian
3435c5272d luci-base: zh_CN: update Simplified Chinese translation
Signed-off-by: Zheng Qian <sotux82@gmail.com>
2019-05-17 09:21:46 +08:00
Franco Castillo
7681967fcb luci-base: Update Spanish translation
Update Spanish translation

Signed-off-by: Franco Castillo <castillofrancodamian@gmail.com>
2019-05-16 20:14:14 -03:00
Franco Castillo
1df3fe306d luci-base: Update Spanish translation
Update Spanish translation

Signed-off-by: Franco Castillo <castillofrancodamian@gmail.com>
2019-05-15 00:25:07 -03:00
INAGAKI Hiroshi
fef11c2ac1 luci-base: update Japanese translation
Updated Japanese translations.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2019-05-13 18:58:37 +09:00
INAGAKI Hiroshi
b21a425a2c i18n: sync translations
Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2019-05-13 18:18:52 +09:00
Jo-Philipp Wich
444f06b1b0
Merge pull request #2687 from HenryGiraldo/master
luci-mod-admin-full: add dependency for channel auto
2019-05-09 13:26:10 +02:00
Jo-Philipp Wich
6b7afabcdd luci-mod-admin-network: fix VLAN "add" button for empty switches
Fixes OpenWrt FS#2270.

Ref: https://bugs.openwrt.org/index.php?do=details&task_id=2270
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-05-07 08:55:22 +02:00
Jo-Philipp Wich
0ac85a440a luci-base: remove interface from zone upon deletion
Fixes: #2690
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-05-06 08:22:39 +02:00
Ansuel Smith
e8bce3db42
luci-mod-admin-full: improve connection page lookup loop
Currently the lookup loop is very inefficient. This improve the lookup loop by moving the entities to a separate array and adds them only one time. Every entities is checked 3 times, after that it will be moved to dns cache as a raw addres (not resolved). This also introduce the Type column to identify common packet using the source port.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2019-05-02 12:50:36 +02:00
Enrique Giraldo
4518c06290 luci-mod-admin-full: add dependency for channel auto
Do not show 'auto' channel option if hostapd is
not compiled with CONFIG_ACS

Signed-off-by: Enrique Giraldo <hgiraldos@gmail.com>
2019-05-02 08:47:06 +02:00
Jo-Philipp Wich
e76caf18bf luci-base: luci.model.network: simplify is_auto()
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-04-30 09:06:10 +02:00
Florian Eckert
18cde3535d
Merge pull request #2620 from TDT-AG/pr/20190311-luci-mod-system
luci-mod-system: add button to sync with ntp server
2019-04-30 08:22:50 +02:00
Florian Eckert
2b94060c60 luci-mod-network: add auto start hint
Make the information if the interface is started on boot visible on the
interface overview page.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2019-04-25 10:18:02 +02:00
Florian Eckert
3ff15a22d5 luci-mod-network: add is_auto option to iface_status
Make interface information is_auto available.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2019-04-25 10:16:32 +02:00
Florian Eckert
bea3879009 luci-base: add is_auto function
Add missing is_auto getter function.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2019-04-25 10:15:52 +02:00
Florian Eckert
3ffdf4160f
Merge pull request #2443 from TDT-AG/pr/20190109-luci-mod-system-password
luci-mod-system: add password strength info
2019-04-24 09:40:38 +02:00
Jo-Philipp Wich
3c7b3fa171
Merge pull request #2681 from dibdot/shadowsocks-fix
luci-app-shadowsocks-libev: fix cidr datatype
2019-04-23 17:29:52 +02:00
Dirk Brenken
8fffadecc5
luci-app-shadowsocks-libev: fix cidr datatype
* add a new 'cidr' alias datatype to fix #2671

Signed-off-by: Dirk Brenken <dev@brenken.org>
2019-04-23 16:57:05 +02:00
Franco Castillo
b09ebf4dd5 luci-base: Update Spanish translation
Update Spanish translation

Signed-off-by: Franco Castillo <castillofrancodamian@gmail.com>
2019-04-20 20:04:03 -03:00
Anton Kikin
0c7031bb1f luci-mod-system: add "KiB" to translatable strings
Also changed original "kiB" to "KiB" in accordance with IEEE 1541-2002.

Signed-off-by: Anton Kikin <a.kikin@tano-systems.com>
2019-04-12 19:43:34 +02:00
Florian Eckert
c3f620eb13 luci-mod-network: move auto option to general tab
Since openwrt-18.06 the auto option is set/unset if we press
connect/disconnect on the interface page. So I think we should move this
to the general tab so that we see at once if this is started on boot or
not.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2019-04-10 13:45:27 +02:00
Jo-Philipp Wich
7423bd9aa3 luci-mod-network: fix bad unicode comma in network.js
Fixes: 5624b36fa ("luci-mod-network: fix page refresh after interface reconnect")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-04-08 17:10:09 +02:00
Olli Asikainen
8d839ddfb8 luci-mod-status: Remove port suffix where not applicable
Submitted-by: Olli Asikainen <olli.asikainen@gmail.com>
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-04-08 10:18:59 +02:00
Jo-Philipp Wich
a4f5b40025
Merge pull request #2642 from TDT-AG/pr/20190329-luci-base
luci-base: add cbi tsection error msg option
2019-04-08 09:20:14 +02:00
Claudio Marelli
97da884240 luci-mod-status: convert bytes into KB / MB / GB on progress bar
Currently on the system status page the the memory usage is shown in kB
only. If you have a system with 1 GB of Ram its hard to read the large
numbers. This automatically formats the byte numbers more human readable
into KB / MB / GB.

Submitted-by: Claudio Marelli <camarelli@gmx.net>
[squash commits, rewrap commit message]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-04-08 09:13:50 +02:00
Jo-Philipp Wich
faa5f0eacd luci-base: luasrcdiet: switch to scm clone and fix tarball name
Switch the LuaSrcDiet download to direct cached SCM clones and
fix the tarball name while we're at it.

Supersedes: #2522
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-04-08 09:04:35 +02:00
Jo-Philipp Wich
5624b36fa7 luci-mod-network: fix page refresh after interface reconnect
Submitted-by: "taeasy" <88336@live.com>
[reword commit subject]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-04-08 08:21:30 +02:00
Jo-Philipp Wich
fb453f552e luci-base: increase max size of network dropdowns
Fixes: #2646
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-04-02 08:17:36 +02:00
Florian Eckert
b347bd1462 luci-base: add cbi tsection error msg option
In some situation it is usefull to inform the use that this section
could not get delete, because this config is referenced or is in use.

Example pseudo code:

function s.remove(self, sid)
	<check if secation could get deleted>
	if output == nil then
		self.error_msg = translatef("Unable to remove this section")
		return nil
	end
end

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2019-03-29 09:27:04 +01:00
Franco Castillo
18a51e2aa5 luci-base: Update Spanish translation
Update Spanish translation

Signed-off-by: Franco Castillo <castillofrancodamian@gmail.com>
2019-03-27 14:08:37 -03:00
Florian Eckert
a37296dda8 luci-mod-system: add button to sync with ntp server
Especially for systems without RTC this change has two advantages

* manual time sync with time server during configuration
* test possibility of the time sync over the configured servers

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2019-03-11 16:09:13 +01:00
Hauke Mehrtens
526ac93f54 luci-mod-network: wifi: Add OWE support
This allows to select OWE support in the wireless menu when a capable
hostapd is installed.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2019-03-09 17:08:43 +01:00
Hauke Mehrtens
9627dbd65e luci-mod-network: wifi: Add WPA3 SAE support
This checks if the installed hostapd supports SAE and allows to select
WPA3 Personal SAE in that case.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2019-03-09 17:08:43 +01:00
Franco Castillo
b02c70c4e1 luci-base: Update Spanish translation
Update Spanish translation

Signed-off-by: Franco Castillo <castillofrancodamian@gmail.com>
2019-03-05 20:29:50 -03:00
Franco Castillo
375b213685 luci-base: Update Spanish translation
Update Spanish translation

Signed-off-by: Franco Castillo <castillofrancodamian@gmail.com>
2019-03-01 16:41:26 -03:00
Franco Castillo
76e382cd8f luci-base: Update Spanish translation
Update Spanish translation

Signed-off-by: Franco Castillo <castillofrancodamian@gmail.com>
2019-02-28 14:24:45 -03:00
Hannu Nyman
144511b7c3
Merge pull request #2581 from castillofrancodamian/base
luci-base: Update Spanish translation
2019-02-27 16:50:09 +02:00
Yousong Zhou
e4bbc5970f wifi: add "macaddr" validator to bssid option
Resolves FS#1649

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2019-02-27 07:43:22 +08:00
Franco Castillo
70afc60d41 luci-base: Update Spanish translation
Update Spanish translation

Signed-off-by: Franco Castillo <castillofrancodamian@gmail.com>
2019-02-26 19:13:59 -03:00
Franco Castillo
4528aee9bc luci-base: Update Spanish translation
Update Spanish translation

Signed-off-by: Franco Castillo <castillofrancodamian@gmail.com>
2019-02-21 16:09:56 -03:00
Sven Roederer
4654ba92c3 treewide: move freifunk-related packages to separate repo
Even Freifunk was one of the major factory to create the LuCI-system, it's
now only a very small part of LuCI. LuCI has become a much bigger thing
and it seems that it's time to move the packages only relating to Freifunk
into it's own feed.
On the mailinglist it was discussed [1] and a repo below the general
Freifunk team on github was created.

This commit removes all packages that will be hosted in the new repo [2]

1 - http://lists.freifunk.net/pipermail/wlannews-freifunk.net/2019-February/004818.html
2 - https://github.com/freifunk/openwrt-packages

Signed-off-by: Sven Roederer <freifunk@it-solutions.geroedel.de>
2019-02-13 21:23:34 +01:00
Jo-Philipp Wich
eda8f02dac treewide: avoid double-escaping CBI section labels
Since the section labels are already HTML-escaped implicitely by the
striptags() function, we must not escape them again in attr() or
ifattr().

Fixes: #2524
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-02-12 08:32:02 +01:00
Jo-Philipp Wich
4141243762 luci-base: dispatcher: support raw values in attr() and ifattr()
Extend the attr() and ifattr() template functions to take an optional
further parameter indicating that the passed value should not be escaped.

This is needed for cases where the input already is escaped through
other means, e.g. when the value was previously filtered through the
striptags() template helper.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-02-12 08:31:08 +01:00
Jo-Philipp Wich
83df3eb6c7 luci-mod-status: iptables.js: fix parsing IP addresses in rules
Rework the regexp pattern to allow both IP addresses without mask
and IPv6 addresses with netmask instead of CIDR notation.

Fixes: #2495, #2530
Fixes: f6bfac211 ("luci-mod-status: rework iptables status page")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-02-12 07:57:35 +01:00
Zheng Qian
b7fabbd337 luci-base: update Simplified Chinese translation
Signed-off-by: Zheng Qian <sotux82@gmail.com>
2019-02-11 19:44:52 +08:00
Yurii
36097124e3
luci-base: update Ukrainian translation
Signed-off-by: Yurii yuripet@gmail.com
2019-02-07 19:11:06 +02:00
INAGAKI Hiroshi
e00fec9f31 luci-base: update Japanese translation
Updated Japanese translations.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2019-02-04 22:34:47 +09:00
INAGAKI Hiroshi
ccb762997f i18n: sync translations
Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2019-02-04 21:44:52 +09:00
Jo-Philipp Wich
766643fcf1 luci-mod-rpc: drop "secret" value from rpc session objects
Drop the "secret" value from RPC session objects in order to make them
compatible with ordinary web sessions used by the LuCI web interface.

That secret value was never used for anything and is the only difference
compared to normal LuCI login sessions.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-01-30 16:51:49 +01:00
Jo-Philipp Wich
74e4cf56c6
Merge pull request #2466 from HenryGiraldo/master
luci-mod-network: Add mesh_rssi_threshold and encryption
2019-01-30 08:24:38 +01:00
Jo-Philipp Wich
1828af9827
Merge pull request #2421 from SibrenVasse/ssid_format
SSID escaping
2019-01-30 08:23:53 +01:00
Yurii
147a8888c8
luci-base: update Ukrainian translation
Signed-off-by: Yurii yuripet@gmail.com
2019-01-26 17:11:36 +02:00
Zheng Qian
a0a78baf85 luci-base: update Simplified Chinese translation
Signed-off-by: Zheng Qian <sotux82@gmail.com>
2019-01-25 11:13:57 +08:00
Hannu Nyman
865d0cf9c7 i18n: sync translations
Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2019-01-24 18:43:21 +02:00
Hannu Nyman
d99831e9d0 treewide: cleanup LEDE references
Remove old LEDE references.
Also remove one obviously wrong translation from pt-br

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2019-01-24 18:39:15 +02:00
Jo-Philipp Wich
f73f1106f7
Merge pull request #2442 from TDT-AG/pr/20190109-luci-mod-system-pollinterval
luci-mod-system: add pollinterval option
2019-01-21 20:14:00 +01:00
Enrique Giraldo
69490d628e luci-mod-network: Add mesh_rssi_threshold and encryption
* make mesh_rssi_threshold configurable
* add SAE encryption support

Signed-off-by: Enrique Giraldo <enrique.giraldo@galgus.net>
2019-01-17 14:46:24 +01:00
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
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
Jo-Philipp Wich
b6dd0ecd6c luci-base: rework reveal/hide CBI password template button
Also add a hidden type password field to prevent browser autocompleters
from entering the login passwords into fields liek the wireless WPA key
field.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-23 14:30:03 +02:00
Jo-Philipp Wich
4105c78ff9 luci-mod-admin-full: unify "Alias interface" and "Alias Interface" strings
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-22 18:25:04 +02:00
Jo-Philipp Wich
e987c7e069
Merge pull request #1982 from Rixerx/master
luci-base: update Polish translation
2018-07-22 17:47:01 +02:00
Jo-Philipp Wich
8e0ee137a6 luci-base: add description annotations to tblsection cells
Add a "data-description" attribute to CBI fields which have a description
set, this allows responsive design themes to render a field description
when decomposing the table grid.

Also reuse the precalculated "typename" property if it exists, instead of
deriving it from the template name yet again.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-22 17:45:03 +02:00
Krystian Kozak
a900d61d91 luci-base: update Polish translation
Updated Polish translations.

Signed-off-by: Krystian Kozak <krystian.kozak20@gmail.com>
2018-07-21 21:56:50 +02:00
Jo-Philipp Wich
e4a86478e6 luci-mod-admin-full: fix check for traceroute6
Since busybox has moved traceroute6 from /usr/bin/ to /bin/, we need to
check both locations.

Fixes #1973.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-21 14:19:41 +02:00
Anton Kikin
bf6275c85e luci-base: fix Russian translation
More correct translation of the 'instance'.

Signed-off-by: Anton Kikin <a.kikin@tano-systems.com>
2018-07-21 11:12:17 +03:00
Yurii
4fa9115de6
luci-base: update Ukrainian translation
Updated with the latest resync translation, corrections and additions.

Signed-off-by: Yurii yuripet@gmail.com
2018-07-20 21:31:54 +03:00
Jo-Philipp Wich
3c90289e0f luci-base: fix bad CSS class names in table section template
The previous refactoring of the template caused the row stripying CSS
classes to be interpolated in such a way, that a separating space to
previous CSS classes was missing, leading to not rendered row names
and other side effects.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-20 11:35:09 +02:00
INAGAKI Hiroshi
72517887cb luci-base: update Japanese translation
Updated Japanese translations.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2018-07-20 15:33:19 +09:00
INAGAKI Hiroshi
86660f92d1 i18n: sync translations
Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2018-07-20 15:33:18 +09:00
Anton Kikin
4aad4a75ba luci-base: fix a typo in Russian translation
Signed-off-by: Anton Kikin <a.kikin@tano-systems.com>
2018-07-20 05:08:38 +03:00
Ansuel Smith
39cabc0361 luci-admin-full: add further wifi options
This commit adds option to disable scan for 40mhz channel, permit to tweak
beacon interval and other advanced settings.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
[fix whitespace, add range constraint to dtim_period, add dtim_period
 to local vars, reword commit message]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-18 18:48:37 +02:00
Jo-Philipp Wich
a37c1342f6
Merge pull request #1961 from Ansuel/dnsmasq
luci-admin-full: add dnsmasq allservers option
2018-07-18 18:45:31 +02:00
Ansuel Smith
7ff8d15e24
luci-admin-full: add dnsmasq allservers option
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2018-07-18 18:03:52 +02:00
Jo-Philipp Wich
9b4efaefa1 luci-mod-admin-full: use incremental background scanning for wireless join
The previous approach of synchroneously scanning while building the result
page was suboptimal since it frequently led to connection resets when
accessing LuCI via wireless.

It also exhibited problems when accessed via SSL on recent Firefox versions
where the page were only loaded partially.

Rework the wireless scanning to gather scan results in a background process
and put them into the ubus session data area where they can be readily
accessed without causing network interruptions.

Subsequently rebuild the wireless join page to use XHR polling to
incrementally fetch updated scan results.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-18 14:43:27 +02:00
Jo-Philipp Wich
90f9c59a2d luci-mod-admin-full: properly reset internal device form field
In some cases the hidden internal device field was not reset, e.g. after
aborting a wifi scan and using the browser back buttons to navigate to the
overview page again.

In such a case, the previous device hidden field was still present and a new
one getting created, causing further wireless scan attempts to get invoked
with multiple radio names as parameter which fails.

Fix this issue by using the new generic cbi_submit() helper any by dropping
the faulty wifi_action() function.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-18 12:05:05 +02:00
Jo-Philipp Wich
c09e154560 luci-base: rework CBI footer template
- Make sure that hitting enter in the form hits the CBI save action and not
  apply or cancel
- Hide action panel if no actions are available
- CLeanup code

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-18 12:05:05 +02:00
Jo-Philipp Wich
f1fb7122e3 luci-base: rework tblsection template
- Hide empty title and description rows
- Correct row striping offset
- Cleanup code

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-18 12:05:05 +02:00
Jo-Philipp Wich
bc562294b9 luci-base: rework simpleform template
- Ensure that pressing enter in the form triggers the submit action and
  not a cbi skip or cancel
- Hide page actions when empty
- Cleanup code

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-18 12:05:05 +02:00
Jo-Philipp Wich
7b43e81c9b luci-base: cbi.js: add cbi_submit() helper
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-18 12:05:05 +02:00
Jo-Philipp Wich
9bdd097f53 luci-mod-admin-full: offer "Cancel" button in iface add dialog
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-18 12:05:05 +02:00
Jo-Philipp Wich
92360f2d5b luci-base: remove unused icons
- The wifi_big.png / wifi_big_disabled.png icons were used on the wireless
   overview page which now uses badges with normal sized icons
 - The encryption.png / encryption_disabled.png icons were never used at all

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-17 16:19:00 +02:00
Anton Kikin
de74dcec1b luci-base: update and improve Russian translation
Add missing translations and update existing not quite correct translations.
Replaced hyphens on em dashes where it is required by the Russian rules.

Signed-off-by: Anton Kikin <a.kikin@tano-systems.com>
2018-07-17 14:48:55 +03:00
Anton Kikin
efb38849d9 luci-base: fix Russian translation
Removed redundant <br> tags from translations.

Signed-off-by: Anton Kikin <a.kikin@tano-systems.com>
2018-07-17 04:48:28 +03:00
Jo-Philipp Wich
f4dd2e6dfb
Merge pull request #952 from cshore-history/pull-request-fstab-avoid-block-umount-on-apply
luci-base: Avoid block umount on fstab apply
2018-07-16 22:12:38 +02:00
Jo-Philipp Wich
fcc9cd6a9a luci-base: fix field section add button/input field names
Some CBI map models, mainly the Network -> VLAN page, expect a valid
previous section ID in their Section:create() callback.

Previous refactoring of the tblsection markup broke this behaviour as
the "section" loop variable was accidentally localized, causing it to
be undefined outside of the loop body which caused the section add
button and name input fields to get rendered with a wrong "name"
attribute.

Fix this by moving the "section" variable declaration out of the loop
and by readding references to it in the non-anonymous section add case.

Fixes FS#1657
Fixes 002c4d1d5 ("luci-base: add "Name" label to autogenerated title column")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-16 17:34:26 +02:00
Hannu Nyman
251c5100a9
Merge pull request #1953 from angusding/patch-9
base.po: Update chinese translations.
2018-07-16 16:40:13 +03:00
Yurii
3859d444db
luci-base: update Ukrainian translation
Updated with the latest resync translation, corrections and additions translation.

Signed-off-by: Yurii yuripet@gmail.com
2018-07-16 16:16:56 +03:00
amitabha
92404498a1
base.po: Update chinese translations.
Fix some Chinese translations.
Signed-off-by: Angus Ding <angus.ding@gmail.com>
2018-07-16 15:24:17 +08:00
Hannu Nyman
b9dd1c951c
Merge pull request #1952 from tano-systems/luci-base-fix-russian-translation
luci-base: fix Russian translation
2018-07-15 21:03:57 +03:00
Anton Kikin
6f29acdfb7 luci-base: fix Russian translation
Signed-off-by: Anton Kikin <a.kikin@tano-systems.com>
2018-07-15 19:35:35 +03:00
Jo-Philipp Wich
4f0b755241 luci-mod-admin-full: fix changing alias interface ifnames
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-15 17:29:01 +02:00
Jo-Philipp Wich
ffff1e7c0a luci-base: fix handling alias interfaces in ifacelist widget
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-15 17:28:38 +02:00
Jo-Philipp Wich
37aeb77dda luci-base: luci.model.network: recognize alias interfaces
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-15 17:07:28 +02:00
Jo-Philipp Wich
a48a142599 luci-mod-admin-full: improve interface overview display
Remove the guessing of primary interfaces for now as we cannot yet properly
track parent / child interface relations.

Instead, add tooltips to the interface icons displaying detailed physical
layer information per netdev.

For dynamic or true alias interfaces (using "@" notation), skip the
reporting of MAC and traffic stats.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-15 16:23:19 +02:00
Jo-Philipp Wich
f6ffc3d739 luci-mod-admin-full: fix wifi add and scan actions
Due to conversion to CBI, the inline forms are now nested and thus do not
work anymore.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-15 13:14:24 +02:00
Jo-Philipp Wich
f29b2a2652 luci-base: update german translation
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-15 12:25:53 +02:00
Krystian Kozak
77b8aa50e0 luci-base: update Polish translation
Updated Polish translations.

Signed-off-by: Krystian Kozak <krystian.kozak20@gmail.com>
2018-07-14 21:41:53 +02:00
Jo-Philipp Wich
b38306dcee luci-base: xhr: increase poll request timeout
Some status requests can take quite some time to finish, the LuCI DSL
status information in particular.

Since the polling loop code already takes care of not relaunching
requests which are already running, increase the per iteration timeout
to up to five times the poll interval.

This should be sufficient to let most operations complete.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-13 16:55:47 +02:00
Jo-Philipp Wich
524ce90c4e luci-base: resync base translations
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-13 14:24:27 +02:00
Jo-Philipp Wich
aef1c2fca0 luci-mod-admin-full: differentiate between disabled and not associated wireless
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-13 14:08:38 +02:00
Jo-Philipp Wich
4f0dfb6ab0 luci-mod-admin-full: tweak interface and wireless overview markup
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-13 09:37:53 +02:00
Jo-Philipp Wich
22e4a2420c luci-base: tweak tblsection markup
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-13 09:37:08 +02:00
Jo-Philipp Wich
777ffa9487 luci-mod-admin-full: small wifi overview markup fix
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-12 18:58:11 +02:00
Jo-Philipp Wich
b7bf164fea luci-mod-admin-full: produce valid JSON in status/realtime/connections_status
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-12 18:55:16 +02:00
Jo-Philipp Wich
85bc16605d luci-base: add icons for alias interfaces
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-12 18:10:59 +02:00
Jo-Philipp Wich
c4dca36795 luci-mod-admin-full: rework interface overview page
Convert interface enable, disable and delete actions to proper cbi
operations so that we can benefit from the apply/rollback workflow
when performing critical interface operations.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-12 18:10:10 +02:00
Jo-Philipp Wich
54c9a77bd3 luci-mod-admin-full: expose errors, description and up state in net status
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-12 18:10:10 +02:00
Jo-Philipp Wich
94be4881a0 luci-base: add error reporting and basic support for dynamic interfaces
This allows exposing virtual ubus-based network interfaces in LuCI.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-12 18:10:10 +02:00
Jo-Philipp Wich
be2b83c9f5 luci-mod-admin-full: reimplement wireless overview page as cbi model
This will offer apply/rollback workflow for tasks like deleting or shutting
down wireless networks.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-12 18:10:10 +02:00
Jo-Philipp Wich
d4e52ca03b luci-base: apply_widget: various fixes
- Fix button styles in failure message
 - Pause XHR polling during apply/rollback sessions
 - Throttle confirm requests to 1 request/second

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-12 18:10:10 +02:00
Jo-Philipp Wich
674b090d34 luci-base: xhr.js: use JSON.parse() and pass request duration to callbacks
JSON.parse() is supported on all modern browsers and a far better
solution than the hakish and potentially dangerous eval().

Also calculate the duration of request and pass it as 3rd argument to the
callback function, this makes it easier to calculate request delays or
poll intervals in code using XHR.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-12 18:10:10 +02:00