update
This commit is contained in:
parent
838684affc
commit
178b4a9e4b
BIN
public/Screenshot_15.png
Normal file
BIN
public/Screenshot_15.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 111 KiB |
@ -953,12 +953,25 @@ function analyzeCameraFrame() {
|
|||||||
|
|
||||||
// 5. 2-Way Real-Time Chat Message Polling (No popup alerts!)
|
// 5. 2-Way Real-Time Chat Message Polling (No popup alerts!)
|
||||||
function pollCandidateChat() {
|
function pollCandidateChat() {
|
||||||
fetch(`{{ route('interview.poll', $interview->id) }}`)
|
fetch(`{{ route('interview.candidate.poll', $interview->id) }}`, {
|
||||||
.then(r => r.json())
|
headers: { 'Accept': 'application/json' }
|
||||||
|
})
|
||||||
|
.then(r => {
|
||||||
|
if (!r.ok) return null;
|
||||||
|
const contentType = r.headers.get('content-type');
|
||||||
|
if (!contentType || !contentType.includes('application/json')) return null;
|
||||||
|
return r.json();
|
||||||
|
})
|
||||||
.then(data => {
|
.then(data => {
|
||||||
|
if (!data) return;
|
||||||
const chatHistory = document.getElementById('candidate-chat-history');
|
const chatHistory = document.getElementById('candidate-chat-history');
|
||||||
if (!chatHistory) return;
|
if (!chatHistory) return;
|
||||||
|
|
||||||
|
if (data.status === 'blocked' || data.is_expired) {
|
||||||
|
window.location.reload();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (data.call_status === 'ended') {
|
if (data.call_status === 'ended') {
|
||||||
candidateLeaveCall();
|
candidateLeaveCall();
|
||||||
const badge = document.getElementById('call-status-badge');
|
const badge = document.getElementById('call-status-badge');
|
||||||
@ -988,7 +1001,8 @@ function pollCandidateChat() {
|
|||||||
chatHistory.innerHTML = html;
|
chatHistory.innerHTML = html;
|
||||||
chatHistory.scrollTop = chatHistory.scrollHeight;
|
chatHistory.scrollTop = chatHistory.scrollHeight;
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
|
.catch(() => {});
|
||||||
}
|
}
|
||||||
setInterval(pollCandidateChat, 3000);
|
setInterval(pollCandidateChat, 3000);
|
||||||
pollCandidateChat();
|
pollCandidateChat();
|
||||||
|
|||||||
@ -813,9 +813,17 @@ function openReviewModal(id, name, uid) {
|
|||||||
|
|
||||||
function pollReviewData() {
|
function pollReviewData() {
|
||||||
if (!currentInterviewId) return;
|
if (!currentInterviewId) return;
|
||||||
fetch(`{{ route('interview.poll', ':id') }}`.replace(':id', currentInterviewId))
|
fetch(`{{ route('interview.poll', ':id') }}`.replace(':id', currentInterviewId), {
|
||||||
.then(r => r.json())
|
headers: { 'Accept': 'application/json' }
|
||||||
|
})
|
||||||
|
.then(r => {
|
||||||
|
if (!r.ok) return null;
|
||||||
|
const contentType = r.headers.get('content-type');
|
||||||
|
if (!contentType || !contentType.includes('application/json')) return null;
|
||||||
|
return r.json();
|
||||||
|
})
|
||||||
.then(data => {
|
.then(data => {
|
||||||
|
if (!data) return;
|
||||||
document.getElementById('modal-code-lang').innerText = (data.submitted_language || 'UNKNOWN').toUpperCase();
|
document.getElementById('modal-code-lang').innerText = (data.submitted_language || 'UNKNOWN').toUpperCase();
|
||||||
document.getElementById('modal-code-display').innerText = data.submitted_code || '// Candidate has not typed any code yet.';
|
document.getElementById('modal-code-display').innerText = data.submitted_code || '// Candidate has not typed any code yet.';
|
||||||
document.getElementById('modal-output-display').innerText = data.code_output || 'No execution output.';
|
document.getElementById('modal-output-display').innerText = data.code_output || 'No execution output.';
|
||||||
@ -946,7 +954,8 @@ function pollReviewData() {
|
|||||||
} else {
|
} else {
|
||||||
sosBtn.style.display = 'none';
|
sosBtn.style.display = 'none';
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
|
.catch(() => {});
|
||||||
}
|
}
|
||||||
|
|
||||||
function openSosModal() {
|
function openSosModal() {
|
||||||
|
|||||||
@ -36,6 +36,7 @@
|
|||||||
Route::post('/candidate/notes/{id}', [InterviewController::class, 'saveCandidateNotes'])->name('interview.candidate.notes');
|
Route::post('/candidate/notes/{id}', [InterviewController::class, 'saveCandidateNotes'])->name('interview.candidate.notes');
|
||||||
Route::post('/candidate/drawing/{id}', [InterviewController::class, 'saveCandidateDrawing'])->name('interview.candidate.drawing');
|
Route::post('/candidate/drawing/{id}', [InterviewController::class, 'saveCandidateDrawing'])->name('interview.candidate.drawing');
|
||||||
Route::post('/candidate/send-message/{id}', [InterviewController::class, 'candidateSendMessage'])->name('interview.candidate.send-message');
|
Route::post('/candidate/send-message/{id}', [InterviewController::class, 'candidateSendMessage'])->name('interview.candidate.send-message');
|
||||||
|
Route::get('/candidate/poll/{id}', [InterviewController::class, 'getPollData'])->name('interview.candidate.poll');
|
||||||
|
|
||||||
// User Dashboard Portal (requires authenticated user)
|
// User Dashboard Portal (requires authenticated user)
|
||||||
Route::middleware(['auth', 'role:user', 'verify-ms-session'])->group(function () {
|
Route::middleware(['auth', 'role:user', 'verify-ms-session'])->group(function () {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user