From fc8d4b3a59bd6a6ccfda41a2142d5ca2c414e509 Mon Sep 17 00:00:00 2001
From: alex <alex@alexloehr.net>
Date: Tue, 03 Jun 2025 11:05:36 +0000
Subject: [PATCH] adding page Courses.vue
---
vue/src/pages/Users.vue | 32 +++++++++++++++++++++++++-------
1 files changed, 25 insertions(+), 7 deletions(-)
diff --git a/vue/src/pages/Users.vue b/vue/src/pages/Users.vue
index 4496c1d..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
@@ -11,14 +12,15 @@
limit: 10,
data: [],
})
+const limit = 24
const error = ref(null)
onMounted(init)
/////////////////////////////////////////////////////////////////////////
-async function init () {
- const res = await fetch(`/api/users?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) {
@@ -29,17 +31,29 @@
}
}
+function go (offset) {
+ console.log("go", offset)
+ return init(offset)
+}
+
</script>
<template>
<div>
- <h1>Users</h1>
+
+ <h1>
+ 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">
- <table>
+
+ <Pagination :offset="users.offset" :limit="users.limit" :total="users.total" @go="go" />
+
+ <table class="w100p">
<thead>
<tr>
<th>usr_id</th>
@@ -47,19 +61,23 @@
<th>firstname</th>
<th>lastname</th>
<th>gender</th>
- <th>email</th>
+<!-- <th>email</th>-->
<th>institution</th>
<th>department</th>
</tr>
</thead>
<tbody>
<tr v-for="user in users.data">
- <td>{{user.usr_id}}</td>
+ <td>
+ <RouterLink :to="`/ui/user/${user.usr_id}`">
+ {{user.usr_id}}
+ </RouterLink>
+ </td>
<td>{{user.login}}</td>
<td>{{user.firstname}}</td>
<td>{{user.lastname}}</td>
<td>{{user.gender}}</td>
- <td>{{user.email}}</td>
+<!-- <td>{{ user.email}}</td>-->
<td>{{user.institution}}</td>
<td>{{user.department}}</td>
</tr>
--
Gitblit v1.8.0