REST Service for POPCORN - ILIAS
alex
2025-06-08 c24428b52feeb4b9cfbafac2541e40e9a891b428
fixing current count
4 files modified
13 ■■■■■ changed files
lib/search.js 5 ●●●● patch | view | raw | blame | history
settings.default.json 2 ●●● patch | view | raw | blame | history
vue/src/components/Pagination.vue 4 ●●● patch | view | raw | blame | history
vue/src/pages/Users.vue 2 ●●● patch | view | raw | blame | history
lib/search.js
@@ -89,7 +89,10 @@
      users = JSON.parse(users)
   }
   else {
      // TODO zweite möglichkeit "readFromApi" implementieren
      console.log("~~~ reading users from DB ... ~~~")
      const db = require("./db")
      const {data} = await db.getUsers(0, 100000)
      users = data
   }
   for (const user of users) {
settings.default.json
@@ -9,7 +9,7 @@
      "password": "paaa322ss"
   },
   "search": {
      "readFromFile": true,
      "readFromFile": false,
      "file": "users-local.json"
   }
}
vue/src/components/Pagination.vue
@@ -10,6 +10,7 @@
   total: Number,
   offset: Number,
   limit: Number,
   current: Number,
})
const emit = defineEmits(["go"])
@@ -70,9 +71,10 @@
   <div class="pagination">
      <div class="pagination-buttons">
<!--         <pre>&#45;&#45;{{current}}&#45;&#45;</pre>-->
         <input type="button" @click="goStart()" class="start" value="«">
         <input type="button" @click="goPrev()" class="prev" value="‹">
         <span class="current">{{ offset }} - {{ offset + limit }} / {{ total }}</span>
         <span class="current">{{ offset }} - {{ offset + current }} / {{ total }}</span>
         <input type="button" @click="goNext()" class="next" value="›">
         <input type="button" @click="goEnd()" class="end" value="»">
         <KeyboardToggle :initial="false" @toggle="toggleKeyboard" style="color: #666" />
vue/src/pages/Users.vue
@@ -73,7 +73,7 @@
                  <div style="transform:scale(1.4); font-weight: bold;">&times;</div>
               </button>
            </div>
            <Pagination :offset="users.offset" :limit="users.limit" :total="users.total" @go="go" />
            <Pagination :offset="users.offset" :limit="users.limit" :total="users.total" :current="users.data.length" @go="go" />
         </div>
         <table class="w100p">