Update frontend for phone caller display
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -53,7 +53,7 @@
|
|||||||
|
|
||||||
<!-- Call Queue -->
|
<!-- Call Queue -->
|
||||||
<section class="queue-section">
|
<section class="queue-section">
|
||||||
<h2>Incoming Calls <a href="/call-in" target="_blank" style="font-size:0.6em;font-weight:normal;color:var(--accent);">Call-in page</a></h2>
|
<h2>Incoming Calls</h2>
|
||||||
<div id="call-queue" class="call-queue">
|
<div id="call-queue" class="call-queue">
|
||||||
<div class="queue-empty">No callers waiting</div>
|
<div class="queue-empty">No callers waiting</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -207,6 +207,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="/js/app.js?v=12"></script>
|
<script src="/js/app.js?v=13"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -878,7 +878,7 @@ function renderQueue(queue) {
|
|||||||
const waitStr = mins > 0 ? `${mins}m ${secs}s` : `${secs}s`;
|
const waitStr = mins > 0 ? `${mins}m ${secs}s` : `${secs}s`;
|
||||||
return `
|
return `
|
||||||
<div class="queue-item">
|
<div class="queue-item">
|
||||||
<span class="queue-name">${caller.name}</span>
|
<span class="queue-name">${caller.phone}</span>
|
||||||
<span class="queue-wait">waiting ${waitStr}</span>
|
<span class="queue-wait">waiting ${waitStr}</span>
|
||||||
<button class="queue-take-btn" onclick="takeCall('${caller.caller_id}')">Take Call</button>
|
<button class="queue-take-btn" onclick="takeCall('${caller.caller_id}')">Take Call</button>
|
||||||
<button class="queue-drop-btn" onclick="dropCall('${caller.caller_id}')">Drop</button>
|
<button class="queue-drop-btn" onclick="dropCall('${caller.caller_id}')">Drop</button>
|
||||||
@@ -893,7 +893,7 @@ async function takeCall(callerId) {
|
|||||||
const data = await res.json();
|
const data = await res.json();
|
||||||
if (data.status === 'on_air') {
|
if (data.status === 'on_air') {
|
||||||
showRealCaller(data.caller);
|
showRealCaller(data.caller);
|
||||||
log(`${data.caller.name} is on air — Channel ${data.caller.channel}`);
|
log(`${data.caller.phone} is on air — Channel ${data.caller.channel}`);
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
log('Failed to take call: ' + err.message);
|
log('Failed to take call: ' + err.message);
|
||||||
@@ -936,7 +936,7 @@ function updateActiveCallIndicator() {
|
|||||||
function showRealCaller(callerInfo) {
|
function showRealCaller(callerInfo) {
|
||||||
const nameEl = document.getElementById('real-caller-name');
|
const nameEl = document.getElementById('real-caller-name');
|
||||||
const chEl = document.getElementById('real-caller-channel');
|
const chEl = document.getElementById('real-caller-channel');
|
||||||
if (nameEl) nameEl.textContent = callerInfo.name;
|
if (nameEl) nameEl.textContent = callerInfo.phone;
|
||||||
if (chEl) chEl.textContent = `Ch ${callerInfo.channel}`;
|
if (chEl) chEl.textContent = `Ch ${callerInfo.channel}`;
|
||||||
|
|
||||||
document.getElementById('real-caller-info')?.classList.remove('hidden');
|
document.getElementById('real-caller-info')?.classList.remove('hidden');
|
||||||
|
|||||||
Reference in New Issue
Block a user