summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base/htdocs/luci-static/resources
AgeCommit message (Collapse)Author
2021-11-16luci-base: luci.js: fix undefined variable access in Request.request()Jo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-11-11luci-base: widget.js: use firewall.getZoneColorStyle() in zone widgetsJo-Philipp Wich
Use the new `firewall.getZoneColorStyle()` helper to apply background color styles. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-11-11luci-base: firewall.js: add getZoneColorStyle() helperJo-Philipp Wich
The getZoneColorStyle() function will produce CSS style properties that describe the color value of the zone. The color declaration is divided into a CSS variable called `--zone-color-rgb` which holds the RGB value of the color and a `background-color` property assigning these values as background property. This allows themes to override the color with derived values, e.g. by applying an alpha channel. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-11-10luci-base: network.js: ignore wireless ifname patterns on retrieving devicesJo-Philipp Wich
Only treat the given identifier as Linux netdev name if we can find a corresponding entry in the device info cache and do not consider strings starting with "wlan", "ath" or "wl" to be existing devices. This fixes incorrectly adding wireless sections as ifnames to network interfaces when the wifi-iface section name begins with one of the `iface_patterns_wireless` patterns. Fixes: #5069 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-11-10luci-base: tools.widgets: adjust zone selector dropdown markupJo-Philipp Wich
No functional changes but required for styling rules. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-10-28luci-base: add legacy directory, file and device validator JS stubsJo-Philipp Wich
Fixes: #5466 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-10-22luci-base: remove further related section types on deleting networkJo-Philipp Wich
When removing a `config interface` section in `/etc/config/network`, drop related `rule` and `rule6` sections too, as well as related `dhcp` sections in `/etc/config/dhcp`. Ref: https://forum.openwrt.org/t/grooming-etc-config/109764/7 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-10-11luci-base: dispatcher: rework dispatching and menu filtering logicJo-Philipp Wich
- Prefer nodes that do not require authentication over nodes that do - Honour ACL dependencies while resolving firstchild nodes - Consider currently active session while scanning menu tree instead of only loading effective ACLs when a login node is encountered - Do not consider nodes for firstchild dispatching which specify a special "firstchild_ineligible" property - Hide menu nodes that have no accessible children Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-10-08luci-base: cbi.js: use IEC 80000-13 units to format base 2 byte valuesJo-Philipp Wich
Fixes: #5354 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-10-08luci-base: form.js: add drag-drop sorting support for mobileJo-Philipp Wich
Fixes: #5416 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-08-15luci-base: support loopback by widgets.NetworkSelectVladislav Grigoryev
Support the "loopback" interface by "widgets.NetworkSelect". Enable the "loopback" option to include this interface. Can be used to configure interface binding for services. Signed-off-by: Vladislav Grigoryev <vg.aetera@gmail.com>
2021-08-11Merge pull request #5239 from aparcar/secondsJo-Philipp Wich
2021-08-11Merge pull request #5154 from TDT-AG/pr/20210628-luci-compatFlorian Eckert
luci-base: prevent empty field for adding new entry
2021-08-11luci-base: prevent empty field for adding new entryHelge Mader
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2021-08-09luci-base: fix request timeout docstringPaul Spooren
The `timeout` is defined in milliseconds, not seconds. Signed-off-by: Paul Spooren <mail@aparcar.org>
2021-07-15luci-base: fix off-by-one in cbi_update_table()Jo-Philipp Wich
Fixes: #5189 Fixes: f919635310 ("luci-base: batch DOM updates to prevent slowdown") Ref: https://github.com/openwrt/luci/commit/f919635310286b3b905aedb716d707da1ea2c811#commitcomment-53495580 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-07-13luci-base: batch DOM updates to prevent slowdownOlli Asikainen
Signed-off-by: Olli Asikainen <olli.asikainen@gmail.com>
2021-07-06luci-base: Fix time display errorDeYu Liu
Signed-off-by: DeYu Liu <vito_sam@outlook.com>
2021-07-03luci-base: validation: disallow mutlicast MACs by defaultJo-Philipp Wich
Extend the MAC address validator to disallow multicast MAC addresses and add a new optional validator option to require multicast MACs instead of unicast ones. Fixes: #5166 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-07-01luci-base: do not add validation for named section if readonly is setFlorian Eckert
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2021-07-01luci-base: prevent empty field for adding new named section in JavaScriptHelge Mader
Suggested-by: Helge Mader <ma@dev.tdt.de> Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2021-07-01luci-base: change css class btn to cbi-buttonFlorian Eckert
The css class btn is only a valid input element on lua rendered pages. Use instead cbi-button for javascript rendered pages. Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2021-07-01luci-base: use button tag instead of input tag on named section addFlorian Eckert
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2021-06-12luci-base: network.js: add link status information accessorsJo-Philipp Wich
Fixes: #5121 Fixes: 8c71b1d01e ("luci-mod-network: add port status to bridge vlan filter matrix") Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-06-09luci-base: ui.js: determine dropdown position relative to overflow parentJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-06-05Merge pull request #5070 from blocktrron/pr-luci-wifi6David Bauer
luci-mod-network: add 802.11ax HE support
2021-06-05luci-base: add 11ax HW / HT modesDavid Bauer
Add the known values returned for 802.11ax HW as well as HT modes to the respective method descriptions. Signed-off-by: David Bauer <mail@david-bauer.net>
2021-06-05luci-mod-network: add 802.11ax HE supportDavid Bauer
This commit adds the ability to configure HE-modes for radios (HE20 / HE40 / HE80 / HE160) as well as HE rate information in the assiciation view. Tested-on: Ubiquiti UniFi 6 Lite / LR Signed-off-by: David Bauer <mail@david-bauer.net>
2021-06-03luci-base: network.js: sorting fixesJo-Philipp Wich
Ensure that sort callbacks consistently return [-N .. 0 .. +N] values instead of just true/false. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-06-03treewide: Update JS using luci-rpc getHostHintsNiels Widger
Update frontend JS code which uses luci-rpc getHostHints to support the new response format which removes the `ipv4` and `ipv6` host hint string fields and replaces them with `ipaddrs` and `ip6addrs` weighted string list fields. Signed-off-by: Niels Widger <niels@qacafe.com> [rework code to be forwards/backwards compatible, fix some Network.Hosts methods, fix IP choice ordering, change commit subject, rewrap commit message] Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-06-02Merge pull request #4770 from nickberry17/update_DummyValueJo-Philipp Wich
luci-base: add new member 'hidden' to DummyValue
2021-06-01luci-base: form.js: consider aliased options in AbstractValue.remove()Jo-Philipp Wich
If different options point to the same underlying uci option, we must only remove the uci value if none of the other alias options is active in order to prevent inactive options (due to unsatisfied depends) removing the uci value of active once on save. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-05-31luci-base: fix `network` data type validationJo-Philipp Wich
Fixes: #5085 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-05-28treewide: drop MAC and MTU from interfaces (protocols)Rafał Miłecki
Those are L2 options that are not part of interfaces (L3), should not be set there and don't work. Setting MAC and MTU should be done at device layer (config device) and is supported for basic types already. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-05-27treewide: use "device" option in UCI "interface" sectionsRafał Miłecki
netifd has been recently patched to use "device" option instead of "ifname" as more clear & accurate. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-05-04luci-base: change button-text from Dismiss to Close in UCI changes overviewSven Roederer
Change the left button of the UCI Apply-changes overview to the more correct function close. This also avoids confusion between Dismiss and Revert, which translate to the same in german. Signed-off-by: Sven Roederer <devel-sven@geroedel.de>
2021-04-16luci-base: form.js: fix AbstractValue.textvalue() for uci list optionsJo-Philipp Wich
Serialize the uci list value into a space separated string before passing it to String.format() for HTML escaping. Without that change, empty strings were returned whenever the underlying uci get operation yieled an array. Fixes: #4993 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-03-29luci-base: uci.js: merge changes when retrieving entire sectionsJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-03-29luci-base: ui.js: fix UICheckbox widget operation when tooltips are setJo-Philipp Wich
When a tooltip is rendered for a checkbox widget, an additional node is placed after the checkbox label element, breaking DOM selectors in bind(), isChecked(), setValue(). Apparently the functionality was never actually tested. Fixes: #4938 Fixes: e951236e3 ("luci-base: add tooltip handling") Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-03-18luci-base: network.js: recognize DSA ports and bridge VLANsJo-Philipp Wich
Use the newly introduced devtype attribute for more robust network device type detection. This also allows us to easily recognize DSA ports. Furthermore, synthesize VLAN devices declared by uci bridge-vlan sections, similar to how it is done for legacy swconfig switch_vlan ones. Finally implement a new Network.Device.getParent() method to use the newly available "parent" attribute to resolve the base device of DSA ports or VLAN devices. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-03-15treewide: remove rendundant proto handler optionsJo-Philipp Wich
The introduction of network device configuration support also implemented all common, protocol-independent interface options directly in the interface config view, so drop the redundant option definitions. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-03-01luci-base: validation.js: optionally support negative prefixesJo-Philipp Wich
Support negative prefix length in the `cidr`, `cidr4`, `cidr6`, `ipmask`, `ipmask4` and `ipmask6` data types when an optional truish flag is passed to the datatype name. Ref: #4812 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-03-01luci-base: network.js: sort interface statuses by metric, then nameJo-Philipp Wich
Fixes: #4693 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-03-01luci-base: firewall.js: manage zomne networks as listJo-Philipp Wich
Fixes: #4827 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-02-19luci-base: ui.js: resolve parent ul early in UIDropdown.toggleItem()Jo-Philipp Wich
The parent node of the current li might be null after collapsing the dropdown, so resolve the parent ul early to avoid passing null to subsequent calls. Fixes clearing custom input values in DynamicList dropdowns. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-02-10luci-base: luci.js: fix sortedKeys() orderingJo-Philipp Wich
Chrome does not properly sort arrays when the sort function returns boolean results, in contrast to Firefox which does. Fix the issue by returning a numerical result instead. Fixes: #4792 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-02-10luci-base: add new member 'hidden' to DummyValueNicholas Smith
Signed-off-by: Nicholas Smith <nicholas@nbembedded.com>
2021-01-20treewide: minor fixes to typos, whitespace, and indentationGiovanni Giacobbi
Signed-off-by: Giovanni Giacobbi <giovanni@giacobbi.net>
2021-01-19luci-base: luci.js: fix `LuCI.request.poll.add()` exception handlingGiovanni Giacobbi
The try/catch is meant for the `res.json()` call and should apply to that. As it was before, an exception inside the poll callback would cause the callback to be reinvoked without the JSON parameter, which is an odd behaviour. Moreover, it makes it hard to debug because it is completely hidden from the browser console. We now differentiate between exceptions thrown due to bad JSON in `responseText` from exceptions generated inside the callback itself, which are let through for browser console logging. Signed-off-by: Giovanni Giacobbi <giovanni@giacobbi.net>
2021-01-13luci-base: make tooltip icon string configurableFlorian Eckert
Signed-off-by: Florian Eckert <fe@dev.tdt.de>