REST Service for POPCORN - ILIAS
alex
2025-06-03 cedfd136bf19bcb01d2d93a77629f50177df599a
vue/src/pages/Users.vue
@@ -11,6 +11,7 @@
   limit: 10,
   data: [],
})
const limit = 24
const error = ref(null)
onMounted(init)
@@ -18,7 +19,7 @@
/////////////////////////////////////////////////////////////////////////
async function init () {
   const res = await fetch(`/api/users?token=jiuGfr432898D90290kjfsldkfn3hh8F`)
   const res = await fetch(`/api/users?limit=${limit}&token=jiuGfr432898D90290kjfsldkfn3hh8F`)
   const data = await res.json()
   console.log(data)
   if (res.status === 200) {
@@ -34,12 +35,21 @@
<template>
   <div>
      <h1>Users</h1>
      <h1>
         Users
         <small>
            {{users.offset}} - {{users.offset+users.limit}} von {{users.total}}
         </small>
      </h1>
      <p>{{ userId }}</p>
      <p v-if="error">{{ error }}</p>
      <div class="users">
         <table>
         <table class="w100p">
            <thead>
               <tr>
                  <th>usr_id</th>
@@ -47,19 +57,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>