REST Service for POPCORN - ILIAS
alex
2025-11-17 ef84ae50b88aac0bd93b1306a51d600a9540ee98
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<script setup>
 
import {onMounted, reactive, ref} from "vue"
import {useRoute} from "vue-router"
import Pagination from "../components/Pagination.vue"
import {getKurse, routerBase} from "@/lib/api"
 
document.title = 'Kurse | globus-ilias-rest'
 
const route = useRoute()
const kurse = ref([])
const error = ref(null)
 
 
onMounted(init)
 
/////////////////////////////////////////////////////////////////////////
 
async function init(offset = 0) {
  const data = await getKurse()
  console.log(data)
  kurse.value = data
}
 
function go(offset) {
  console.log("go", offset)
  return init(offset)
}
 
</script>
 
<template>
 
  <div>
 
    <h1>
      ILIAS Kurse
      <small>({{ kurse?.length }})</small>
    </h1>
    <p v-if="error">{{ error }}</p>
 
    <div class="kurse">
 
      <table class="w100p" v-if="kurse">
        <thead>
        <tr>
          <th>usr_id</th>
          <th>obj_id</th>
          <th>title</th>
          <th>description</th>
          <th>type</th>
          <th>offline</th>
        </tr>
        </thead>
        <tbody>
        <tr v-for="kurs in kurse">
          <td>
            <RouterLink :to="`${routerBase}/ui/kurs/${kurs.ref_id}`">
              {{ kurs.ref_id }}
            </RouterLink>
          </td>
          <td>{{ kurs.obj_id }}</td>
          <td>{{ kurs.title }}</td>
          <td>{{ kurs.description }}</td>
          <td>{{ kurs.type }}</td>
          <td>
            <div :class="{red:kurs.offline===1,green:kurs.offline===0}">
              {{ kurs.offline }}
            </div>
          </td>
        </tr>
        </tbody>
      </table>
    </div>
 
    <!--      <pre>{{ kurse }}</pre>-->
 
  </div>
 
</template>
 
<style scoped lang="stylus">
//
//.red
//  max-width 2ch
//  text-align center;
//  background-color red;
//  color white
//  font-weight bold
//
//.green
//  color green
 
</style>