improve pagination

This commit is contained in:
2024-08-23 10:51:20 +02:00
parent 0f0c896065
commit 0e7b9d8c20
6 changed files with 79 additions and 61 deletions

View File

@ -25,7 +25,14 @@ All Sales
{{ end }}
{{ define "js" }}
<script type="module">
import {showTable, pageSize, currentPage} from "/static/js/all-sales.js"
showTable({{.API}}, pageSize, currentPage);
import {pageSize} from "/static/js/common.js"
import {showTable, currentPage} from "/static/js/all-sales.js"
let curPage = currentPage;
if (localStorage.getItem("cur-page") !== null) {
curPage = localStorage.getItem("cur-page");
localStorage.removeItem("cur-page");
}
showTable({{.API}}, pageSize, curPage);
</script>
{{ end }}

View File

@ -28,7 +28,14 @@ All Subscriptions
{{define "js"}}
<script type="module">
import {showTable, pageSize, currentPage} from "/static/js/all-subscriptions.js"
showTable({{.API}}, pageSize, currentPage);
import {pageSize} from "/static/js/common.js"
import {showTable, currentPage} from "/static/js/all-subscriptions.js"
let curPage = currentPage;
if (localStorage.getItem("cur-page") !== null) {
curPage = localStorage.getItem("cur-page");
localStorage.removeItem("cur-page");
}
showTable({{.API}}, pageSize, curPage);
</script>
{{end}}