Fix recorders.html: rename handlers to avoid api.js shadowing (infinite recursion), fix resolution→recording_resolution

This commit is contained in:
Zac Gaetano 2026-05-16 00:48:40 -04:00
parent 6f7a446aa5
commit ed52dfcafb

View file

@ -544,7 +544,7 @@
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button class="btn btn-secondary" onclick="closeCreateModal()">Cancel</button> <button class="btn btn-secondary" onclick="closeCreateModal()">Cancel</button>
<button class="btn btn-primary" onclick="createRecorder()">Create</button> <button class="btn btn-primary" onclick="handleCreateRecorder()">Create</button>
</div> </div>
</div> </div>
</div> </div>
@ -690,7 +690,7 @@
</div> </div>
<div class="recorder-meta-item"> <div class="recorder-meta-item">
<span class="recorder-meta-label">Resolution</span> <span class="recorder-meta-label">Resolution</span>
<span class="recorder-meta-value">${recorder.resolution || 'Native'}</span> <span class="recorder-meta-value">${recorder.recording_resolution || 'Native'}</span>
</div> </div>
${isRecording ? ` ${isRecording ? `
<div class="recorder-meta-item"> <div class="recorder-meta-item">
@ -701,11 +701,11 @@
</div> </div>
<div class="recorder-actions"> <div class="recorder-actions">
${isRecording ? ` ${isRecording ? `
<button class="btn btn-sm btn-secondary" onclick="stopRecorder('${recorder.id}')">⏹ Stop</button> <button class="btn btn-sm btn-secondary" onclick="handleStopRecorder('${recorder.id}')">⏹ Stop</button>
` : ` ` : `
<button class="btn btn-sm btn-primary" onclick="startRecorder('${recorder.id}')">⏺ Start</button> <button class="btn btn-sm btn-primary" onclick="handleStartRecorder('${recorder.id}')">⏺ Start</button>
`} `}
<button class="btn btn-sm btn-secondary" onclick="deleteRecorder('${recorder.id}')">🗑 Delete</button> <button class="btn btn-sm btn-secondary" onclick="handleDeleteRecorder('${recorder.id}')">🗑 Delete</button>
</div> </div>
</div> </div>
`; `;
@ -792,9 +792,12 @@
// ============================================================ // ============================================================
// RECORDER OPERATIONS // RECORDER OPERATIONS
// Named handleCreateRecorder / handleStartRecorder / handleStopRecorder /
// handleDeleteRecorder to avoid shadowing the api.js globals of the
// same name (which would cause infinite recursion).
// ============================================================ // ============================================================
async function createRecorder() { async function handleCreateRecorder() {
const name = document.getElementById('recorderName').value.trim(); const name = document.getElementById('recorderName').value.trim();
const sourceType = document.getElementById('sourceType').value; const sourceType = document.getElementById('sourceType').value;
@ -819,7 +822,7 @@
source_type: sourceType, source_type: sourceType,
source_config: sourceConfig, source_config: sourceConfig,
recording_codec: document.getElementById('recordingCodec').value, recording_codec: document.getElementById('recordingCodec').value,
resolution: document.getElementById('resolution').value, recording_resolution: document.getElementById('resolution').value,
project_id: document.getElementById('projectSelect').value, project_id: document.getElementById('projectSelect').value,
}; };
@ -844,7 +847,7 @@
} }
} }
async function startRecorder(id) { async function handleStartRecorder(id) {
try { try {
const result = await startRecorder(id); const result = await startRecorder(id);
if (result.success) { if (result.success) {
@ -861,7 +864,7 @@
} }
} }
async function stopRecorder(id) { async function handleStopRecorder(id) {
try { try {
const result = await stopRecorder(id); const result = await stopRecorder(id);
if (result.success) { if (result.success) {
@ -877,7 +880,7 @@
} }
} }
async function deleteRecorder(id) { async function handleDeleteRecorder(id) {
if (!confirm('Are you sure you want to delete this recorder?')) return; if (!confirm('Are you sure you want to delete this recorder?')) return;
try { try {