summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base/luasrc
AgeCommit message (Collapse)Author
2020-04-03luci-base: ui.js: add instantiateView() helperJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-03-26luci-base: add missing .btn CSS classes to sysauth templateJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-03-13luci-base: ensure that ubus path uses trailing slashJo-Philipp Wich
Without the trailing slash, probing endpoint availability will fail. Fixes: 529bde440 ("luci-base: make rpc webserver path configurable") Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-02-18luci-base: Add missed config parameter for cbi when converting to JSONAnton Kikin
The cbi() function has a second argument 'config' in which various configuration parameters can be passed. When converting the lua menu to JSON, we must also convert this parameter. Signed-off-by: Anton Kikin <a.kikin@tano-systems.com>
2020-02-05luci-base: dispatcher.lua: remove redundant check_fs_depends() callJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-01-30luci-base: dispatcher.lua: fix filesystem dependency checksJo-Philipp Wich
A variable clash led to declarative `fs` dependencies being ineffective. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-01-29luci-base: add another magic security attribute to the sysauth cookieJo-Philipp Wich
Fixes: #3585 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-01-28luci-base: add L.media() URL construction helperJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-01-16luci-base: make rpc webserver path configurableAnsuel Smith
Currently the ubus path that provide the webserver is hardcoded to be /ubus. Change this to make it configurable from the luci config file. Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2020-01-10luci-base: dispatcher: remove empty firstchild nodes from menuJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-01-07luci-base: dispatcher: fix rpc controller regressionJo-Philipp Wich
When testing the luci-rpc authnetication, avoid clobbering the HTTP post request body. Fixes: #3470 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-12-30luci-base: move tools.webadmin to luci-compatJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-12-30luci-base: drop unused tools.webadmin.proto classJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-12-16luci-base: convert menu nodes to JSONJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-12-16luci-base: dispatcher.lua: add support for loading JSON menu filesJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-12-16luci-base: dispatcher.lua: refactor dispatch logicJo-Philipp Wich
Refactor the dispatch logic to operate on the internal JSON representation of the menu tree. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-12-16luci-base: dispatcher.lua: factor out template class init into own functionJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-12-16luci-base: dispatcher.lua: factor out language check into own functionJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-12-16luci-base: expose effective dispatched path to client side environmentJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-12-16luci-base: dispatcher.lua: introduce dispatch tree JSON conversionJo-Philipp Wich
Introduce a new method menu_json() which converts the current dispatch tree into JSON structure. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-11-03treewide: move server side CBI support to luci-compatJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-11-03treewide: move templates and libraries not used by the core to luci-compatJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-11-02luci-base: sys.lua: lazy-load luci.model.networkJo-Philipp Wich
This allows using luci.sys without installed luci.model.network class. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-11-01luci-base: dispatcher.lua: support declarative node dependenciesJo-Philipp Wich
Introduce two new properties for page nodes to allow for declaratively specifiying system dependencies which is useful to e.g. make certain views depend on specific uci values or the presence of certain files. The recognized properties are: - `uci_depends` - a nested table in one of the following forms: 1) `{ config = { section = { option = "exact_value" } }` 2) `{ config = { section = { option = true } }` 3) `{ config = { section = "exact_type" } }` 4) `{ config = { section = true } }` 5) `{ config = true }` Depending on the declaration, the uci option or section type must either match the given "exact_value" or "exact_type" values or be a non-nil value in case boolean "true" is specified. - `file_depends` - a flat lists of file paths that must be accessible If a path listed in `file_depends` points to a directory, that directory must be not empty, otherwise it suffices if the path exists. Examples: - Only display the node if an /etc/config/wireless file exists with a "config wifi-device radio0" section. node = page(...) node.uci_depends = { wireless = { radio0 = "wifi-device" } } - Only display the node when swconfig is installed. node = page(...) node.file_depends = { "/sbin/swconfig" } Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-11-01luci-base: remove unused Lua codeJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-10-09luci-base: fix CSRF prevention for arcombine targetsJo-Philipp Wich
The dispatcher failed to propagate the child target post security requirements to the arcombine() dispatch target so far - fix this by recursively testing the post security requirements. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-28timezone data: update to 2019cHannu Nyman
Update timezone data to 2019c http://mm.icann.org/pipermail/tz-announce/2019-September/000057.html 2019c: * Fiji observes DST from 2019-11-10 to 2020-01-12. * Norfolk Island starts observing Australian-style DST. Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2019-09-24luci-mod-system: reimplement flashops as client side viewJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-12luci-base: sys.lua: fix init script enable actionJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-12luci-base: fix list method handling in ubus-rpc protocol proxyJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-12luci-base: drop unused tools.status.switch_status() callJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-11luci-base: view.htm: catch and render exceptions on view instantiationJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-10luci-base: use cgi-io and rpcd-mod-file to handle file upload and browsingJo-Philipp Wich
Remove the old server side support for file browsing and file uploading and switch to a client side widget instead which uses XMLHTTPRequests to upload files via cgi-io and RPC calls for file listing and status queries. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-10protocols: drop server side cbi implementations of protocol handlersJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-08-15luci-base: use native ubus-rpc authorization protocolJo-Philipp Wich
Instead of granting complete ubus access under the active sysauth session, implement the ubus-rpc authorization mechanism and make the ubus proxy endpoint unauthenticated. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-08-06luci-base: add vpn menu sectionFlorian Eckert
There is always more vpn services. To make the LuCI menu look cleaner, a new top level menu "VPN" will be added with this commit. All luci-app-* that have something to do with VPN should move to this new menu entry. Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2019-07-27luci-base: don't treat .rmempty flag as optional for ListValue widgetsJo-Philipp Wich
Restore the old CBI behaviour of not automatically rendering empty selection choices in ListValue select dropdowns when .rmempty is specified. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-26luci-base: fix multiple parameter in cbi templatesAnton Kikin
In the dc0211803e commit, the parameter "multi" in ui.js is replaced with "multiple" everywhere. Thus, it must also be changed in the cbi templates. Fixes: dc0211803e Signed-off-by: Anton Kikin <a.kikin@tano-systems.com>
2019-07-19luci-base: render default values for all server side cbi map widgetsJo-Philipp Wich
Fixes: 9c7eb1dec ("luci-base: switch from server side to client side widget markup") Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07luci-base: mvalue.htm: fix reading back multi value optionsJo-Philipp Wich
Fixes: 2a229e50c ("luci-base: fix cbi mvalue templates") Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07luci-base: fix cbi mvalue templatesJo-Philipp Wich
Fixes: 9c7eb1dec ("luci-base: switch from server side to client side widget markup") Signed-off-by: Jo-Philipp Wich <jo@mein.io>
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>