Skip to content

Commit

Permalink
Add default room number to settings
Browse files Browse the repository at this point in the history
  • Loading branch information
andre-dietrich committed Sep 6, 2023
1 parent c775109 commit 614a690
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 22 deletions.
44 changes: 28 additions & 16 deletions dist/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -27285,7 +27285,8 @@ const router1 = new mod6.Router().get('/readUser', async (ctx)=>{
meta: class_.meta || {
logo: '',
description: '',
selfAssign: false
selfAssign: false,
defaultNumberOfRooms: 0
},
modules: class_.modules.map((m)=>({
url: m.url,
Expand Down Expand Up @@ -27320,7 +27321,8 @@ const router1 = new mod6.Router().get('/readUser', async (ctx)=>{
meta: {
logo: '',
description: '',
selfAssign: false
selfAssign: false,
defaultNumberOfRooms: 0
},
members: {
teacher: [
Expand Down Expand Up @@ -27415,34 +27417,44 @@ const router1 = new mod6.Router().get('/readUser', async (ctx)=>{
ctx.response.status = 401;
return;
}
if (!live_class) {
classes[class_id] = {
autoAssign: undefined,
users: {},
rooms: {
Lobby: {
studentPublicState: '',
teacherPublicState: '',
teacherPrivateState: ''
},
"Teacher's Lounge": {
if (!live_class && class_id) {
const rooms = {
Lobby: {
studentPublicState: '',
teacherPublicState: '',
teacherPrivateState: ''
},
"Teacher's Lounge": {
studentPublicState: '',
teacherPublicState: '',
teacherPrivateState: ''
}
};
if (res[0]?.meta?.defaultNumberOfRooms) {
for(let i = 1; i <= res[0]?.meta?.defaultNumberOfRooms; i++){
rooms[`Room ${i}`] = {
studentPublicState: '',
teacherPublicState: '',
teacherPrivateState: ''
}
};
}
}
classes[class_id] = {
autoAssign: undefined,
users: {},
rooms
};
live_class = classes[class_id];
}
let connection_id = '';
if (live_class.users[username]) {
if (live_class && live_class.users[username]) {
connection_id = nanoid();
live_class.users[username].connections ??= [];
live_class.users[username].connections.push({
id: connection_id,
target: target
});
} else {
} else if (live_class) {
live_class.users[username] = {
displayName: display_name,
room: is_station ? `Station ${display_name}` : ReservedRoomNames.Lobby,
Expand Down
4 changes: 2 additions & 2 deletions dist/static/200.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<!doctype html>
<html>
<head>
<title>Home - Edrys</title><meta data-n-head="1" charset="utf-8"><meta data-n-head="1" name="viewport" content="width=device-width,initial-scale=1"><meta data-n-head="1" data-hid="description" name="description" content=""><meta data-n-head="1" name="format-detection" content="telephone=no"><link data-n-head="1" rel="icon" type="image/x-icon" href="/favicon.png"><link rel="preload" href="/_nuxt/e18606d.js" as="script"><link rel="preload" href="/_nuxt/29c1d74.js" as="script"><link rel="preload" href="/_nuxt/fa636b9.js" as="script"><link rel="preload" href="/_nuxt/ee22b62.js" as="script">
<title>Home - Edrys</title><meta data-n-head="1" charset="utf-8"><meta data-n-head="1" name="viewport" content="width=device-width,initial-scale=1"><meta data-n-head="1" data-hid="description" name="description" content=""><meta data-n-head="1" name="format-detection" content="telephone=no"><link data-n-head="1" rel="icon" type="image/x-icon" href="/favicon.png"><link rel="preload" href="/_nuxt/0c66bdd.js" as="script"><link rel="preload" href="/_nuxt/29c1d74.js" as="script"><link rel="preload" href="/_nuxt/fa636b9.js" as="script"><link rel="preload" href="/_nuxt/ee22b62.js" as="script">
</head>
<body>
<div id="__nuxt"><style>#nuxt-loading{background:#fff;visibility:hidden;opacity:0;position:absolute;left:0;right:0;top:0;bottom:0;display:flex;justify-content:center;align-items:center;flex-direction:column;animation:nuxtLoadingIn 10s ease;-webkit-animation:nuxtLoadingIn 10s ease;animation-fill-mode:forwards;overflow:hidden}@keyframes nuxtLoadingIn{0%{visibility:hidden;opacity:0}20%{visibility:visible;opacity:0}100%{visibility:visible;opacity:1}}@-webkit-keyframes nuxtLoadingIn{0%{visibility:hidden;opacity:0}20%{visibility:visible;opacity:0}100%{visibility:visible;opacity:1}}#nuxt-loading>div,#nuxt-loading>div:after{border-radius:50%;width:5rem;height:5rem}#nuxt-loading>div{font-size:10px;position:relative;text-indent:-9999em;border:.5rem solid #f5f5f5;border-left:.5rem solid #000;-webkit-transform:translateZ(0);-ms-transform:translateZ(0);transform:translateZ(0);-webkit-animation:nuxtLoading 1.1s infinite linear;animation:nuxtLoading 1.1s infinite linear}#nuxt-loading.error>div{border-left:.5rem solid #ff4500;animation-duration:5s}@-webkit-keyframes nuxtLoading{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes nuxtLoading{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}</style><script>window.addEventListener("error",function(){var e=document.getElementById("nuxt-loading");e&&(e.className+=" error")})</script><div id="nuxt-loading" aria-live="polite" role="status"><div>Loading...</div></div></div><script>window.__NUXT__={config:{_app:{basePath:"/",assetsPath:"/_nuxt/",cdnURL:null}}}</script>
<script src="/_nuxt/e18606d.js"></script><script src="/_nuxt/29c1d74.js"></script><script src="/_nuxt/fa636b9.js"></script><script src="/_nuxt/ee22b62.js"></script></body>
<script src="/_nuxt/0c66bdd.js"></script><script src="/_nuxt/29c1d74.js"></script><script src="/_nuxt/fa636b9.js"></script><script src="/_nuxt/ee22b62.js"></script></body>
</html>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/static/_nuxt/85c36f1.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion dist/static/_nuxt/8929965.js

This file was deleted.

4 changes: 2 additions & 2 deletions dist/static/index.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<!doctype html>
<html>
<head>
<title>Home - Edrys</title><meta data-n-head="1" charset="utf-8"><meta data-n-head="1" name="viewport" content="width=device-width,initial-scale=1"><meta data-n-head="1" data-hid="description" name="description" content=""><meta data-n-head="1" name="format-detection" content="telephone=no"><link data-n-head="1" rel="icon" type="image/x-icon" href="/favicon.png"><link rel="preload" href="/_nuxt/e18606d.js" as="script"><link rel="preload" href="/_nuxt/29c1d74.js" as="script"><link rel="preload" href="/_nuxt/fa636b9.js" as="script"><link rel="preload" href="/_nuxt/ee22b62.js" as="script">
<title>Home - Edrys</title><meta data-n-head="1" charset="utf-8"><meta data-n-head="1" name="viewport" content="width=device-width,initial-scale=1"><meta data-n-head="1" data-hid="description" name="description" content=""><meta data-n-head="1" name="format-detection" content="telephone=no"><link data-n-head="1" rel="icon" type="image/x-icon" href="/favicon.png"><link rel="preload" href="/_nuxt/0c66bdd.js" as="script"><link rel="preload" href="/_nuxt/29c1d74.js" as="script"><link rel="preload" href="/_nuxt/fa636b9.js" as="script"><link rel="preload" href="/_nuxt/ee22b62.js" as="script">
</head>
<body>
<div id="__nuxt"><style>#nuxt-loading{background:#fff;visibility:hidden;opacity:0;position:absolute;left:0;right:0;top:0;bottom:0;display:flex;justify-content:center;align-items:center;flex-direction:column;animation:nuxtLoadingIn 10s ease;-webkit-animation:nuxtLoadingIn 10s ease;animation-fill-mode:forwards;overflow:hidden}@keyframes nuxtLoadingIn{0%{visibility:hidden;opacity:0}20%{visibility:visible;opacity:0}100%{visibility:visible;opacity:1}}@-webkit-keyframes nuxtLoadingIn{0%{visibility:hidden;opacity:0}20%{visibility:visible;opacity:0}100%{visibility:visible;opacity:1}}#nuxt-loading>div,#nuxt-loading>div:after{border-radius:50%;width:5rem;height:5rem}#nuxt-loading>div{font-size:10px;position:relative;text-indent:-9999em;border:.5rem solid #f5f5f5;border-left:.5rem solid #000;-webkit-transform:translateZ(0);-ms-transform:translateZ(0);transform:translateZ(0);-webkit-animation:nuxtLoading 1.1s infinite linear;animation:nuxtLoading 1.1s infinite linear}#nuxt-loading.error>div{border-left:.5rem solid #ff4500;animation-duration:5s}@-webkit-keyframes nuxtLoading{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes nuxtLoading{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}</style><script>window.addEventListener("error",function(){var e=document.getElementById("nuxt-loading");e&&(e.className+=" error")})</script><div id="nuxt-loading" aria-live="polite" role="status"><div>Loading...</div></div></div><script>window.__NUXT__={config:{_app:{basePath:"/",assetsPath:"/_nuxt/",cdnURL:null}}}</script>
<script src="/_nuxt/e18606d.js"></script><script src="/_nuxt/29c1d74.js"></script><script src="/_nuxt/fa636b9.js"></script><script src="/_nuxt/ee22b62.js"></script></body>
<script src="/_nuxt/0c66bdd.js"></script><script src="/_nuxt/29c1d74.js"></script><script src="/_nuxt/fa636b9.js"></script><script src="/_nuxt/ee22b62.js"></script></body>
</html>

0 comments on commit 614a690

Please sign in to comment.