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:
glaszig
2019-08-08 02:10:40 +02:00
parent 7dd80f6098
commit 993dc633a9
8 changed files with 275 additions and 173 deletions

View File

@@ -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());