Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CollabSpace Frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mona Schulz
CollabSpace Frontend
Commits
486b810c
Commit
486b810c
authored
4 days ago
by
MonaS8
Browse files
Options
Downloads
Patches
Plain Diff
add setcards
parent
e17a6c28
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/composables/api.ts
+18
-2
18 additions, 2 deletions
src/composables/api.ts
src/views/SessionAnalysisView.vue
+75
-11
75 additions, 11 deletions
src/views/SessionAnalysisView.vue
tsconfig.app.json
+1
-1
1 addition, 1 deletion
tsconfig.app.json
with
94 additions
and
14 deletions
src/composables/api.ts
+
18
−
2
View file @
486b810c
...
...
@@ -139,9 +139,15 @@ export type UpdateCategory = CreateCategory;
export
type
UpdateRoom
=
CreateRoom
;
export
type
Points
=
{
points
:
number
;
userId
:
number
;
sessionId
?:
number
;
allPoints
:
{
audioPoints
:
number
;
videoPoints
:
number
;
browserPoints
:
number
;
whiteboardPoints
:
number
;
notePoints
:
number
;
}
totalPoints
:
number
;
};
export
interface
RoomSession
{
...
...
@@ -175,6 +181,12 @@ export type Activity = {
timestamp
:
Date
;
}
export
interface
Role
{
id
:
number
;
name
:
string
;
description
?:
string
;
}
/**
* An object containing async functions to interact with the server API.
*/
...
...
@@ -385,6 +397,10 @@ const api = {
async
getRoomSessionById
(
sessionId
:
string
,
categoryId
:
string
,
roomId
:
string
):
Promise
<
RoomSession
>
{
return
await
fetch
.
getOrFail
(
`/category/
${
categoryId
}
/room/
${
roomId
}
/sessions/
${
sessionId
}
`
);
},
async
getRoles
():
Promise
<
Role
[]
>
{
return
await
fetch
.
getOrFail
(
'
/roles
'
);
},
}
/**
...
...
This diff is collapsed.
Click to expand it.
src/views/SessionAnalysisView.vue
+
75
−
11
View file @
486b810c
<
template
>
<Layout
title=
"Raum Überblick"
:buttons=
"['account', 'admin']"
>
<div>
<h1>
Teilnehmer
</h1>
<ul>
<li
v-for=
"user in roomSession?.users"
>
{{
user
.
name
}}
</li>
</ul>
<div
class=
"container"
>
<h1
class=
"mb-4"
>
Teilnehmer Analyse
</h1>
<div
class=
"row g-3"
>
<div
v-for=
"user in roomSession?.users"
:key=
"user.userId"
class=
"col-auto"
>
<div
class=
"card square-card"
>
<div
class=
"card-header text-center text-primary fw-bold"
>
MODERATOR
</div>
<div
class=
"card-body d-flex flex-column align-items-center"
>
<h5
class=
"card-title text-center mb-3"
>
{{
user
.
name
}}
</h5>
<div
class=
"card-text text-center w-100"
>
<p
class=
"mb-1 text-muted extra-small"
><strong>
User ID:
</strong>
{{
user
.
userId
}}
</p>
</div>
<div
class=
"card-text text-center w-100"
>
<p
class=
"mb-1 text-muted extra-small"
>
{{
userPoints
[
user
.
id
]?.
totalPoints
||
'
Loading...
'
}}
Punkte
</p>
</div>
</div>
</div>
</div>
</div>
</div>
</Layout>
</
template
>
...
...
@@ -15,16 +29,66 @@
import
{
ref
,
onMounted
,
Ref
}
from
'
vue
'
;
import
{
useApi
}
from
'
@/composables/api
'
;
import
{
useRoute
}
from
'
vue-router
'
;
import
{
RoomSession
}
from
'
@/composables/api
'
;
import
{
RoomSession
,
Points
}
from
'
@/composables/api
'
;
import
Layout
from
'
@/components/Layout.vue
'
;
const
api
=
useApi
();
const
route
=
useRoute
();
const
roomSession
:
Ref
<
RoomSession
|
null
>
=
ref
(
null
);
const
roomSession
:
Ref
<
RoomSession
|
null
>
=
ref
(
null
);
const
userPoints
=
ref
<
Record
<
number
,
Points
>>
({});
async
function
loadUserPoints
(
userId
:
number
)
{
try
{
const
points
=
await
api
.
getPointsByUser
(
userId
);
userPoints
.
value
[
userId
]
=
points
;
}
catch
(
error
)
{
console
.
error
(
`Error loading points for user
${
userId
}
:`
,
error
);
}
}
onMounted
(
async
()
=>
{
const
response
=
await
useApi
()
.
getRoomSessionById
(
route
.
query
.
roomSessionId
as
string
,
"
0
"
,
"
0
"
);
const
response
=
await
api
.
getRoomSessionById
(
route
.
query
.
roomSessionId
as
string
,
"
0
"
,
"
0
"
);
roomSession
.
value
=
response
;
// Load points for each user
if
(
response
.
users
)
{
for
(
const
user
of
response
.
users
)
{
await
loadUserPoints
(
user
.
id
);
}
}
});
</
script
>
<
style
scoped
>
.square-card
{
aspect-ratio
:
1
;
width
:
100%
;
transition
:
transform
0.2s
;
border
:
1px
solid
rgba
(
0
,
0
,
0
,
0.125
);
}
.square-card
:hover
{
transform
:
translateY
(
-5px
);
box-shadow
:
0
4px
8px
rgba
(
0
,
0
,
0
,
0.1
);
}
.card-body
{
padding
:
1.25rem
;
}
.card-header
{
background-color
:
rgba
(
13
,
110
,
253
,
0.1
);
border-bottom
:
1px
solid
rgba
(
13
,
110
,
253
,
0.2
);
padding
:
0.5rem
;
}
.small
{
font-size
:
0.875rem
;
}
</
script
>
\ No newline at end of file
.extra-small
{
font-size
:
0.75rem
;
opacity
:
0.7
;
}
</
style
>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tsconfig.app.json
+
1
−
1
View file @
486b810c
{
"extends"
:
"@vue/tsconfig/tsconfig.dom.json"
,
"include"
:
[
"env.d.ts"
,
"src/**/*"
,
"src/**/*.vue"
],
"include"
:
[
"env.d.ts"
,
"src/**/*
.ts
"
,
"src/**/*.vue"
],
"exclude"
:
[
"src/**/__tests__/*"
],
"compilerOptions"
:
{
"composite"
:
true
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment