Paginated runner loading (1000 per page)

ref #175
This commit is contained in:
Nicolai Ort 2023-04-18 20:40:28 +02:00
parent c33dfcfddd
commit faf3893180
Signed by: niggl
GPG Key ID: 13AFA55AF62F269F

View File

@ -50,7 +50,6 @@
}));
};
//Section table
const columns = [
{
@ -157,16 +156,7 @@
}).showToast();
}
onMount(() => {
RunnerService.runnerControllerGetAll().then((val) => {
current_runners = val;
dataLoaded = true;
options.update((options) => ({
...options,
data: current_runners,
}));
});
onMount(async () => {
RunnerTeamService.runnerTeamControllerGetAll().then((val) => {
teams = val;
});
@ -175,6 +165,26 @@
orgs = val;
}
);
let page = 0;
while (page >= 0) {
const runners = await RunnerService.runnerControllerGetAll(page, 1000);
if (runners.length == 0) {
page = -2;
}
current_runners = current_runners.concat(...runners);
options.update((options) => ({
...options,
data: current_runners,
}));
if (page == 0) {
dataLoaded = true;
}
page++;
}
console.log("All runners loaded");
});
</script>