summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base/luasrc
AgeCommit message (Collapse)Author
2019-07-07Merge pull request #2806 from dibdot/magicJo-Philipp Wich
system-wide: fix escaping of magic chars
2019-07-07luci-base: fix handling of large ubus HTTP requestsJo-Philipp Wich
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-07luci-base: add sys.init.reload() and sys.init.restart() actionsJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07luci-base: switch from server side to client side widget markupJo-Philipp Wich
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-07luci-base: add client based view actionsJo-Philipp Wich
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-07luci-base: replace uci change pages with client side modal dialogJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07luci-base: add ubus-http gatewayJo-Philipp Wich
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-07luci-base: add ES6 Promise polyfill for IE < EdgeJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-06luci-base: hide autocomplete-preventing password input with bigger offsetYousong Zhou
Fixes openwrt/luci#2624 Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2019-07-06luci-base: nowrap for password input and reveal buttonYousong Zhou
Fixes openwrt/luci#2624 Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2019-07-05timezone data: update to 2019bHannu Nyman
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-06-29system-wide: fix escaping of magic charsDirk Brenken
* 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-28luci-base: show niced processes on Status/Processes pageHannu Nyman
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-04luci-base: fix duid_to_mac reference in status.luaDirk Brenken
* fix for openwrt/packages#9148 Signed-off-by: Dirk Brenken <dev@brenken.org>
2019-06-03luci-base: handle dhcp lease from odhcpdAnsuel Smith
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-03luci-base: adds duid_to_mac to sys.luaAnsuel Smith
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-05-25Merge pull request #2174 from rosysong/lease-statusFlorian Eckert
luci-base: drop ipv6 lease status when IPV6 is not support
2019-05-09Merge pull request #2687 from HenryGiraldo/masterJo-Philipp Wich
luci-mod-admin-full: add dependency for channel auto
2019-05-06luci-base: remove interface from zone upon deletionJo-Philipp Wich
Fixes: #2690 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-05-02luci-mod-admin-full: add dependency for channel autoEnrique Giraldo
Do not show 'auto' channel option if hostapd is not compiled with CONFIG_ACS Signed-off-by: Enrique Giraldo <hgiraldos@gmail.com>
2019-04-30luci-base: luci.model.network: simplify is_auto()Jo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-04-25luci-base: add is_auto functionFlorian Eckert
Add missing is_auto getter function. Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2019-04-23luci-app-shadowsocks-libev: fix cidr datatypeDirk Brenken
* add a new 'cidr' alias datatype to fix #2671 Signed-off-by: Dirk Brenken <dev@brenken.org>
2019-04-08Merge pull request #2642 from TDT-AG/pr/20190329-luci-baseJo-Philipp Wich
luci-base: add cbi tsection error msg option
2019-04-02luci-base: increase max size of network dropdownsJo-Philipp Wich
Fixes: #2646 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-03-29luci-base: add cbi tsection error msg optionFlorian Eckert
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-02-12treewide: avoid double-escaping CBI section labelsJo-Philipp Wich
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-12luci-base: dispatcher: support raw values in attr() and ifattr()Jo-Philipp Wich
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-01-02timezone data: update to 2018iHannu Nyman
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>
2018-12-29luci-base: rework filebrowser initializationJo-Philipp Wich
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-20luci-base: use default poll intervalFlorian Eckert
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-20modules: use configurable poll intervalFlorian Eckert
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-13luci-base: fix table compare upon writing ipaddr changesJo-Philipp Wich
Fixes: b33192a03 ("luci-base: support cidr list notation for option ipaddr and ip6addr") Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-12-13luci-base: properly option ipaddr in single cidr string notation as wellJo-Philipp Wich
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-13luci-base: support cidr list notation for option ipaddr and ip6addrJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-12-12luci-base: fix UCI changelog markup mistakeAnton Kikin
Signed-off-by: Anton Kikin <a.kikin@tano-systems.com>
2018-12-11luci-base: fix syntax error in map.htmJo-Philipp Wich
Fixes #2366. Fixes: 76e9c0305 ("luci-base: rework ui tabbing code") Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-12-10luci-base: rework ui tabbing codeJo-Philipp Wich
- 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-11-27luci-base: dispatcher: use consistent orderingJo-Philipp Wich
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-27luci-base: dispatcher: remove tree modifier supportJo-Philipp Wich
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-22luci-base: do not trigger form action when revealing passwordJo-Philipp Wich
Ref: https://github.com/openwrt/luci/issues/2327 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-11-22luci-base: introduce common JavaScript apiJo-Philipp Wich
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-20luci-base: fix apply/rollback stringsJo-Philipp Wich
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-16luci-base: dispatcher: add login indication on 403 errorsJo-Philipp Wich
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-15luci-base: support disconnecting (deauthenticating) wireless clientsWang805447391
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-14luci-base: datatypes: add "unique" dummy validatorJo-Philipp Wich
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-14Merge pull request #2259 from pmelange/luci-app-olsr-new-json-libJo-Philipp Wich
update luci-app-olsr to the new jsoninfo library
2018-11-14Merge pull request #2282 from TDT-AG/pr/20181114-luci-baseJo-Philipp Wich
luci-base: allow optional default value for file browser
2018-11-14luci-lib-ipkg: move out of luci-baseJo-Philipp Wich
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-14luci-base: simplify apply widget codeJo-Philipp Wich
- 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>