REST Service for POPCORN - ILIAS
alex
2025-06-03 fd94c517909211b0079a225f1c438a07f96289cc
vue/src/pages/KursDetail.vue
@@ -2,7 +2,8 @@
import {useRoute} from 'vue-router'
import {onMounted, reactive, ref} from "vue"
import {getKurs, getKursItems, getKursTn} from "../lib/api.js"
import {getKurs, getKursItems, getKursTn, iliasBase} from "../lib/api.js"
import LinkExtern from "../components/LinkExtern.vue"
const route = useRoute()
const kursId = route.params.kursId
@@ -27,13 +28,18 @@
   const dataKursTn = await getKursTn(kursId)
   console.log(dataKursTn)
   kursTn.value = dataKursTn
   console.log(222222222222,import.meta.env.VITE_TST)
}
const aaa = import.meta.env.VITE_TST
</script>
<template>
   <div>
      <pre>---{{aaa}}</pre>
      <h1>
         Kurs
         <small>{{ kurs?.title }}</small>
@@ -45,7 +51,12 @@
      <div class="user" v-if="kurs">
         <span>ref_id</span>
         <div>{{ kurs.ref_id }}</div>
         <div>
            <a :href="`${iliasBase}/goto.php?target=${kurs.type}_${kurs.ref_id}`" target="_blank">
               {{ kurs.ref_id }}
               <LinkExtern />
            </a>
         </div>
         <span>obj_id</span>
         <div>{{ kurs.obj_id }}</div>
@@ -64,17 +75,24 @@
      </h2>
      <table>
         <thead>
            <th>parent_id</th>
            <th>ref_id</th>
            <th>obj_id</th>
            <th>title</th>
            <th>type</th>
            <tr>
               <th>parent_id</th>
               <th>ref_id</th>
               <th>obj_id</th>
               <th>title</th>
               <th>type</th>
            </tr>
         </thead>
         <tbody>
            <!-- TODO verlinken auf Ziel in ILAS | goto.php?target=crs_ID -->
            <tr v-for="item in kursItems">
               <td>{{ item.parent_id }}</td>
               <td>{{ item.ref_id }}</td>
               <td>
                  <a :href="`${iliasBase}/goto.php?target=${item.type}_${item.ref_id}`" target="_blank">
                     {{ item.ref_id }}
                     <LinkExtern />
                  </a>
               </td>
               <td>{{ item.obj_id }}</td>
               <td>{{ item.title }}</td>
               <td>{{ item.type }}</td>
@@ -89,14 +107,18 @@
      <div :style="{columns: kursTn?.length > 16 ? 3 : 1}">
         <table>
            <thead>
               <th>usr_id</th>
               <th>login</th>
               <th>firstname</th>
               <th>lastname</th>
               <tr>
                  <th>usr_id</th>
                  <th>login</th>
                  <th>firstname</th>
                  <th>lastname</th>
               </tr>
            </thead>
            <tbody>
               <tr v-for="tn in kursTn">
                  <td>{{ tn.usr_id }}</td>
                  <td>
                     <RouterLink :to="`/ui/user/${tn.usr_id}`">{{ tn.usr_id }}</RouterLink>
                  </td>
                  <td>{{ tn.login }}</td>
                  <td>{{ tn.firstname }}</td>
                  <td>{{ tn.lastname }}</td>