<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>
|