+
Wenn der Countdown in Richtung "Aufwärts" zählt, wird die
festgelegte Zeit als Maximum gewertet. Wenn der Countdown in
Richtung "Abwärts" zählt, wird die festgelegte Zeit als
@@ -129,11 +131,6 @@ const { state } = defineProps({
},
});
-console.log("got state");
-console.log(state);
-console.log(state.time);
-console.log("---");
-
const form = ref<{
seconds: number;
minutes: number;
@@ -162,10 +159,6 @@ const updateTimeAndSubmit = () => {
};
const submitCountdownHandler = async () => {
- console.log("send state");
- console.log(state);
- console.log(state.time);
- console.log("---");
const response = await fetch("/dashboard/admin/countdown", {
method: "POST",
credentials: "include",
diff --git a/resources/js/pages/Dashboard/Admin/RandomGenerator/Display.vue b/resources/js/pages/Dashboard/Admin/RandomGenerator/Display.vue
index 401265c6..6ebf82c6 100644
--- a/resources/js/pages/Dashboard/Admin/RandomGenerator/Display.vue
+++ b/resources/js/pages/Dashboard/Admin/RandomGenerator/Display.vue
@@ -122,7 +122,11 @@ const fetchRandomGeneratorState = async () => {
isFetchingRandomGenerator.value = true;
- const response = await fetch("/api/random-generator/state", {
+ const apiPath = window.location.pathname.startsWith("/public")
+ ? "/public/api/random-generator/state"
+ : "/api/random-generator/state";
+
+ const response = await fetch(apiPath, {
method: "GET",
credentials: "include",
headers: {
diff --git a/resources/js/pages/Dashboard/Admin/ScoreSystem/Display.vue b/resources/js/pages/Dashboard/Admin/ScoreSystem/Display.vue
index 636e98df..d4002595 100644
--- a/resources/js/pages/Dashboard/Admin/ScoreSystem/Display.vue
+++ b/resources/js/pages/Dashboard/Admin/ScoreSystem/Display.vue
@@ -63,7 +63,11 @@ const fetchScoreSystemState = async () => {
isFetchingScoreSystem.value = true;
- const response = await fetch("/api/score-system/state", {
+ const apiPath = window.location.pathname.startsWith("/public")
+ ? "/public/api/score-system/state"
+ : "/api/score-system/state";
+
+ const response = await fetch(apiPath, {
method: "GET",
credentials: "include",
headers: {
@@ -78,7 +82,6 @@ const fetchScoreSystemState = async () => {
JSON.stringify(scoreSystemState.value.teams) !==
JSON.stringify(data.teams)
) {
- console.log("Score System State Updated!");
isRunningSound.value = true;
setTimeout(() => {
isRunningSound.value = false;
diff --git a/resources/js/types/auto-imports.d.ts b/resources/js/types/auto-imports.d.ts
index 896482af..b6775f88 100644
--- a/resources/js/types/auto-imports.d.ts
+++ b/resources/js/types/auto-imports.d.ts
@@ -3,6 +3,7 @@
// @ts-nocheck
// noinspection JSUnusedGlobalSymbols
// Generated by unplugin-auto-import
+// biome-ignore lint: disable
export {}
declare global {
const useAppEventType: (typeof import("../composables/useAppEventType"))["default"];
diff --git a/routes/web.php b/routes/web.php
index ee5687f0..934331af 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -108,20 +108,24 @@
Route::get('{slug?}', [DashboardController::class, 'cmsPage'])->where('slug', '.*');
});
-//public routes without authentication
+// public routes without authentication
Route::prefix('public')->group(function () {
Route::middleware(ActivePublicModule::class . ':randomGenerator')->group(function () {
- Route::get('/random-generator', [DashboardAdminRandomGeneratorController::class, 'display'])->name('dashboard.admin.randomGenerator.display');
+ Route::get('/random-generator', [DashboardAdminRandomGeneratorController::class, 'display'])->name('public.randomGenerator');
+ Route::get('/api/random-generator/state', [ApiController::class, 'randomGeneratorState'])->name('public.api.randomGeneratorState');
});
Route::middleware(ActivePublicModule::class . ':scoreSystem')->group(function () {
- Route::get('/score-system', [DashboardAdminScoreSystemController::class, 'display'])->name('dashboard.admin.scoreSystem.display');
+ Route::get('/score-system', [DashboardAdminScoreSystemController::class, 'display'])->name('public.scoreSystem');
+ Route::get('/api/score-system/state', [ApiController::class, 'scoreSystemState'])->name('public.api.scoreSystemState');
});
Route::middleware(ActivePublicModule::class . ':countdown')->group(function () {
- Route::get('/countdown', [DashboardAdminCountdownController::class, 'display'])->name('dashboard.admin.countdown.display');
+ Route::get('/countdown', [DashboardAdminCountdownController::class, 'display'])->name('public.countdown');
+ Route::get('/api/countdown/state', [ApiController::class, 'countdownState'])->name('public.api.countdownState');
});
});
+
// api routes with authentication
Route::prefix('api')->middleware(Authenticate::class)->group(function () {
Route::middleware(IsLoggedInTutor::class)->group(function () {
diff --git a/vite.config.js b/vite.config.js
index cf4806d1..f2f218a5 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -5,6 +5,14 @@ import Components from "unplugin-vue-components/vite";
import AutoImport from "unplugin-auto-import/vite";
export default defineConfig({
+ build: {
+ target: "esnext",
+ },
+ optimizeDeps: {
+ esbuildOptions: {
+ target: "esnext",
+ },
+ },
resolve: {
alias: {
"@": "/resources/js",
@@ -43,7 +51,7 @@ export default defineConfig({
define: {
__PACKAGE_NAME__: JSON.stringify(process.env.npm_package_name),
__PACKAGE_REPOSITORY_URL__: JSON.stringify(
- "https://github.com/fsr5-fhaachen/portals/"
+ "https://github.com/fsr5-fhaachen/portals/",
),
},
});