Default behaviour of changes to fstab (Mount Points) was
to use /etc/init.d/fstab restart, however this unmounts
filesystems via block umount which can cause the device
to fail, so replace the initscript call with an exec
of 'block mount'.
Signed-off-by: Daniel Dickinson <lede@cshore.thecshore.com>
(cherry picked from commit 33b279c475)
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>
(cherry picked from commit fcc9cd6a9a)
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>
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>
(cherry picked from commit f6ffc3d739)
Due to a huge number of fixes and diverging development histories, I decided
to completely merge the current LuCI master into the 18.06 release branch to
have a common code base for upcoming maintenance releases.
Some LuCI apps have minor style glitches yet but I do not deem them to be
release critical as non-default components need to be opkg-installed anyway
and the package repositories are continuously refreshed, so we do not need
to fix everything for OpenWrt 18.06.0-rc2.
The most important changes introduced by this merge are:
1) New HTTP handling library in C
The new library should vastly reduce the required RAM for processing
large POST bodies while implementing some slightly more strict parsing
logic.
2) Apply/Rollback workflow
The ubus rpcd based apply/rollback handling will automatically revert
config changes if access to the device is lost for a certain period
of time, this is mainly intended for preventing issues with bad
config settings and the like.
The feature is not 100% error-proof yet but it successfully prevents a
large number of issues already. For final, the handling of the firewall
conntrack cache needs to be fixed yet as adding "lockout" firewall rules
is not yet catched due to the open HTTP session allowed by netfilter
conntrack
3) Template markup and theme style modifications
A large number of changes have been made to the markup in the various
templates, mainly to allow for responsive styling of tables.
The only theme currently making full use of that is the non-default
OpenWrt theme which will break table rows into disjunct boxes on
very narrow screens.
The changes have been tested on IE 11, MS Edge, Firefox, Chrome, an
iPhone 5s, iPhone 6 and iPad Air.
4) Initial LuCI support for displaying virtual dynamic network interfaces
Some protocol handlers will spawn purely dynamic sub-interfaces which
are not present in UCI. Such interfaces have been invisible in LuCI so
far which caused confusion especialy wrt. missing IP addresses etc.
LuCI will now display such dynamic interfaces on the interface overview.
5) Initial LuCI support for display interface runtime error information
LuCI will now expose interface error information stored in the ubus
runtime information by protocol handlers.
This is mainly useful to get notified of low level problems like
bad SIM codes are missing APN information.
6) Various XSS and CSRF bypass fixes
A number of code places performing inadequate markup escaping have been
fixed and the dispatcher CSRF token enforcement rules have been reworked
to actually catch all POST security cases.
7) Initial support for running under nginx
Various bugs have been fixed to allow LuCI to function under nginx using
a FastCGI wrapper.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
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>
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>
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>
Commit c0de036b3 ("treewide: always include cbi.js") improperly removed the
cbi.js script include from header.htm, leaving behind the string dictionary.
Move the JSON dictionary to the parent <form> element and delete the
leftover </script> element.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>