diff --git a/.gitignore b/.gitignore index 77574b5e..afb9df7b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /config /wg0.conf -/wg0.json \ No newline at end of file +/wg0.json +/create config \ No newline at end of file diff --git a/src/www/index.html b/src/www/index.html index 34177ffc..c8945faa 100644 --- a/src/www/index.html +++ b/src/www/index.html @@ -79,7 +79,7 @@
-
@@ -527,7 +527,30 @@
+ +
+
+ + +
+
+ + +
+

Made by { if (!this.search) return true; + // Reset page number if search changed + if (this.search !== this.searchPrevious) { + this.pageNumber = 0; + this.searchPrevious = this.search; + } const search = this.search.toLowerCase(); - return client.name.toLowerCase().includes(search) - || client.address.toLowerCase().includes(search) - || client.id.toLowerCase().includes(search); + return client.name.toLowerCase().includes(search); }); + }, + + currentPage() { + if (!this.filteredClients) return null; + + this.canGoToNextPage = this.pageNumber+1 < this.filteredClients.length / this.prepage; + return this.filteredClients.slice(this.pageNumber * this.prepage, this.pageNumber * this.prepage + this.prepage); } + }, methods: { + nextPage() { + if (this.pageNumber < this.clients.length / this.prepage) { + this.pageNumber++; + } + }, + + previousPage() { + if (this.pageNumber > 0) { + this.pageNumber--; + } + }, + dateTime: value => { return new Intl.DateTimeFormat(undefined, { year: 'numeric',