REST Service for POPCORN - ILIAS
alex
2025-12-08 82f18bd37dae283be0940416f3ab7684ad56044c
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<script setup>
 
import {onMounted, reactive, ref} from "vue"
import {useRoute} from "vue-router"
import Pagination from "../components/Pagination.vue"
import {getCourseAdmins, getCourseNoAdmins, getUsers, iliasBase, routerBase, searchUsers} from "@/lib/api"
import {useRouteQuery} from '@vueuse/router'
import {onKeyStroke, useDebounceFn} from "@vueuse/core"
import LinkExtern from "@/components/LinkExtern.vue";
 
document.title = `Course-Admins | globus-ilias-rest`
 
const route = useRoute()
const adminRoles = ref([])
const adminRoles2 = ref([])
const error = ref(null)
 
onMounted(init)
 
/////////////////////////////////////////////////////////////////////////
 
async function init() {
   console.log(">>> INIT")
   const data1 = await getCourseAdmins()
   console.log({adminRoles:data1})
   adminRoles.value = data1
   const data2 = await getCourseNoAdmins()
   console.log({noAdminRoles:data2})
   adminRoles2.value = data2
}
 
 
</script>
 
<template>
 
   <div>
 
      <div>
 
         <h1>
            Admin-Rollen
            <small>{{ adminRoles.length }}</small>
         </h1>
         <p v-if="error">{{ error }}</p>
 
         <table class="w100p">
            <thead>
            <tr>
               <th>crs_obj_id</th>
               <th>crs_ref_id</th>
               <th>crs_title</th>
               <th>rol_id</th>
               <th>role</th>
            </tr>
            </thead>
            <tbody>
            <tr v-if="adminRoles" v-for="item in adminRoles">
               <td>{{ item.crs_obj_id }}</td>
               <td>
                  <a :href="`${iliasBase}/goto.php?target=crs_${item.crs_ref_id}`" target="_blank">
                     {{ item.crs_ref_id }}
                     <LinkExtern/>
                  </a>
               </td>
               <td>{{ item.crs_title }}</td>
               <td>{{ item.rol_id }}</td>
               <td>{{ item.role }}</td>
            </tr>
            </tbody>
         </table>
 
      </div>
 
      <br>
      <br>
 
      <div>
         <h1>Admin-Rollen ohne Benutzer
            <small>{{ adminRoles2.length }}</small>
         </h1>
         <p class="muted">Wenn ein Kurs <strong>keinen</strong> Benutzer mit einer Admin-Rolle zugewiesen hat, so kann
         von diesem Kurs kein TN gelöscht werden.</p>
         <table class="w100p">
            <thead>
            <tr>
               <th>crs_obj_id</th>
               <th>crs_ref_id</th>
               <th>crs_title</th>
               <th>rol_id</th>
               <th>role</th>
            </tr>
            </thead>
            <tbody>
            <tr v-if="adminRoles2" v-for="item in adminRoles2">
               <td>{{ item.crs_obj_id }}</td>
               <td>
                  <a :href="`${iliasBase}/goto.php?target=crs_${item.crs_ref_id}`" target="_blank">
                     {{ item.crs_ref_id }}
                     <LinkExtern/>
                  </a>
               </td>
               <td>{{ item.crs_title }}</td>
               <td>{{ item.rol_id }}</td>
               <td>{{ item.role }}</td>
            </tr>
            </tbody>
         </table>
      </div>
 
 
   </div>
 
</template>
 
<style scoped lang="stylus">
 
 
</style>