mirror of
https://github.com/billz/raspap-webgui.git
synced 2025-03-01 10:31:47 +00:00
load wifi stations via ajax, cache the scan result
until the "rescan" button is pressed. speeds up "configure client" page massively.
This commit is contained in:
16
js/custom.js
16
js/custom.js
@@ -180,6 +180,20 @@ function contentLoaded() {
|
||||
}
|
||||
}
|
||||
|
||||
function loadWifiStations(refresh) {
|
||||
return function() {
|
||||
var complete = function() { $(this).removeClass('loading-spinner'); }
|
||||
var qs = refresh === true ? '?refresh' : '';
|
||||
$('.js-wifi-stations')
|
||||
.addClass('loading-spinner')
|
||||
.empty()
|
||||
.load('/ajax/networking/wifi_stations.php'+qs, complete);
|
||||
};
|
||||
}
|
||||
|
||||
$(".js-reload-wifi-stations").on("click", loadWifiStations(true));
|
||||
|
||||
$(document)
|
||||
.ajaxSend(setCSRFTokenHeader)
|
||||
.ready(contentLoaded);
|
||||
.ready(contentLoaded)
|
||||
.ready(loadWifiStations());
|
||||
|
Reference in New Issue
Block a user