From c4f654f96671f592cae718c1211899995f003aa7 Mon Sep 17 00:00:00 2001
From: alex <alex@alexloehr.net>
Date: Tue, 03 Jun 2025 12:32:47 +0000
Subject: [PATCH] adding api lib

---
 vue/src/pages/Users.vue |   18 +++++++++++-------
 1 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/vue/src/pages/Users.vue b/vue/src/pages/Users.vue
index bab2301..30b3b7c 100644
--- a/vue/src/pages/Users.vue
+++ b/vue/src/pages/Users.vue
@@ -2,6 +2,7 @@
 
 import {onMounted, reactive, ref} from "vue"
 import {useRoute} from "vue-router"
+import Pagination from "../components/Pagination.vue"
 
 const route = useRoute()
 const userId = route.params.userId
@@ -18,8 +19,8 @@
 
 /////////////////////////////////////////////////////////////////////////
 
-async function init () {
-   const res = await fetch(`/api/users?limit=${limit}&token=jiuGfr432898D90290kjfsldkfn3hh8F`)
+async function init (offset = 0) {
+   const res = await fetch(`/api/users?offset=${offset}&limit=${limit}&token=jiuGfr432898D90290kjfsldkfn3hh8F`)
    const data = await res.json()
    console.log(data)
    if (res.status === 200) {
@@ -30,6 +31,11 @@
    }
 }
 
+function go (offset) {
+   console.log("go", offset)
+   return init(offset)
+}
+
 </script>
 
 <template>
@@ -37,17 +43,15 @@
    <div>
 
       <h1>
-         Users
-         <small>
-            {{users.offset}} - {{users.offset+users.limit}} von {{users.total}}
-         </small>
+         ILIAS Users
+<!--         <small>{{users.offset}} - {{users.offset+users.data.length}} von {{users.total}}</small>-->
       </h1>
       <p>{{ userId }}</p>
       <p v-if="error">{{ error }}</p>
 
       <div class="users">
 
-
+         <Pagination :offset="users.offset" :limit="users.limit" :total="users.total" @go="go" />
 
          <table class="w100p">
             <thead>

--
Gitblit v1.8.0