diff --git a/app/public/js/index.js b/app/public/js/index.js index 4a37a5e..066934b 100644 --- a/app/public/js/index.js +++ b/app/public/js/index.js @@ -381,13 +381,6 @@ document.addEventListener('DOMContentLoaded', function() { showLoadingOverlay(); // Show the loading overlay instead of pageLoader updateLoadingMessage('Starting lab environment...'); updateExamInfo(`Lab: ${selectedLab.name} | Difficulty: ${selectedLab.difficulty || 'Medium'}`); - let userAgent = ''; - try { - userAgent = navigator.userAgent; - } catch (error) { - console.error('Error getting user agent:', error); - } - selectedLab.userAgent = userAgent; // Make a POST request to the facilitator API - using exams endpoint for POST fetch('/facilitator/api/v1/exams/', { @@ -481,7 +474,7 @@ document.addEventListener('DOMContentLoaded', function() { } catch (error) { console.error('Error polling exam status:', error); // Show error in the loading overlay - updateLoadingMessage(`Error: ${error.message}. Retrying...`); + updateLoadingMessage(`Error checking exam status: ${error.message}. Retrying in ${pollInterval/1000}s...`); // Continue polling despite errors setTimeout(poll, pollInterval); } diff --git a/facilitator/src/services/examService.js b/facilitator/src/services/examService.js index 4a405d6..f385bb4 100644 --- a/facilitator/src/services/examService.js +++ b/facilitator/src/services/examService.js @@ -66,9 +66,6 @@ async function createExam(examData) { category: examData.category, labId: examData.config.lab, examName: examData.name, - event: { - userAgent: examData.userAgent - } }); return { diff --git a/facilitator/src/utils/redisClient.js b/facilitator/src/utils/redisClient.js index 9b99cc8..0af7ebd 100644 --- a/facilitator/src/utils/redisClient.js +++ b/facilitator/src/utils/redisClient.js @@ -55,7 +55,7 @@ async function getClient() { * @param {number} [ttl=3600] - Time to live in seconds (default: 1 hour) * @returns {Promise} - Returns 'OK' if successful */ -async function persistExamInfo(examId, examInfo, ttl = 3600000) { +async function persistExamInfo(examId, examInfo, ttl = 36000) { try { const client = await getClient(); const key = `${KEYS.EXAM_INFO}${examId}`; @@ -76,7 +76,7 @@ async function persistExamInfo(examId, examInfo, ttl = 3600000) { * @param {number} [ttl=3600] - Time to live in seconds (default: 1 hour) * @returns {Promise} - Returns 'OK' if successful */ -async function persistExamStatus(examId, status, ttl = 3600000) { +async function persistExamStatus(examId, status, ttl = 36000) { try { const client = await getClient(); const key = `${KEYS.EXAM_STATUS}${examId}`; @@ -96,7 +96,7 @@ async function persistExamStatus(examId, status, ttl = 3600000) { * @param {number} [ttl=3600] - Time to live in seconds (default: 1 hour) * @returns {Promise} - Returns 'OK' if successful */ -async function persistExamResult(examId, result, ttl = 3600000) { +async function persistExamResult(examId, result, ttl = 36000) { try { const client = await getClient(); const key = `${KEYS.EXAM_RESULT}${examId}`; @@ -117,7 +117,7 @@ async function persistExamResult(examId, result, ttl = 3600000) { * @param {number} [ttl=3600] - Time to live in seconds (default: 1 hour) * @returns {Promise} - Returns 'OK' if successful */ -async function setCurrentExamId(examId, ttl = 3600000) { +async function setCurrentExamId(examId, ttl = 36000) { try { const client = await getClient(); const result = await client.setEx(KEYS.CURRENT_EXAM_ID, ttl, examId); diff --git a/scripts/install.ps1 b/scripts/install.ps1 index 29733ca..25e64d4 100644 --- a/scripts/install.ps1 +++ b/scripts/install.ps1 @@ -358,7 +358,7 @@ try { Write-ColorOutput "CK-X Simulator has been installed in: " -NoNewline Write-ColorOutput "$(Get-Location), run all below commands from this directory" "Green" Write-ColorOutput "To stop CK-X: " -NoNewline - Write-ColorOutput "docker compose down --volumes --remove-orphans --rmi all" "Green" + Write-ColorOutput "docker compose down" "Green" Write-ColorOutput "To Restart CK-X: " -NoNewline Write-ColorOutput "docker compose restart" "Green" Write-ColorOutput "To clean up all containers and images: " -NoNewline diff --git a/scripts/install.sh b/scripts/install.sh index 4866ecb..0f719e0 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -221,7 +221,7 @@ main() { echo -e "\n${BLUE}Useful Commands${NC}" echo -e "${CYAN}==============================================================${NC}" echo -e "${YELLOW}CK-X Simulator has been installed in:${NC} ${GREEN}$(pwd)${NC}, run all below commands from this directory" - echo -e "${YELLOW}To stop CK-X ${GREEN}docker compose down --volumes --remove-orphans --rmi all${NC}" + echo -e "${YELLOW}To stop CK-X ${GREEN}docker compose down${NC}" echo -e "${YELLOW}To Restart CK-X:${NC} ${GREEN}docker compose restart${NC}" echo -e "${YELLOW}To clean up all containers and images:${NC} ${GREEN}docker system prune -a${NC}" echo -e "${YELLOW}To remove only CK-X images:${NC} ${GREEN}docker compose down --rmi all${NC}"