Age | Commit message (Collapse) | Author |
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Defer the start of the queue poll loop until the document has been loaded.
This allows all XHR.poll() invocations on the page to register their
handlers before the first batch of requests is made.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Internet Explorer 11 requires the timeout to be applied after the open()
call, otherwise an invlaid state exception will be raised
Fixes aa6c97154 ("luci-base: extend xhr.js")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Add timeout options to get() and post() and introduce XHR.stop() to support
stopping a poll operation.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
|
|
* Rename subdirectories to their repective OpenWrt package names
* Make each LuCI module its own standalone package
* Deploy a shared luci.mk which is used by each module Makefile
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
|