321312
This commit is contained in:
parent
a39c5af74c
commit
ff3eb1db34
|
|
@ -21,14 +21,14 @@
|
|||
<!-- 通话状态指示器 -->
|
||||
<div class="d-flex align-items-center">
|
||||
<div id="status-indicator" class="rounded-circle me-2"
|
||||
style="width: 24px; height: 24px; background-color: red;"></div>
|
||||
style="width: 24px; height: 24px; background-color: red;"></div>
|
||||
<span id="status-text" class="me-3">未检测到通话</span>
|
||||
</div>
|
||||
|
||||
<!-- 单选按钮组 - 隐藏自动识别显示选项 -->
|
||||
<div class="btn-group" role="group" style="display: none;">
|
||||
<input type="radio" class="btn-check" name="displayMode" id="displayMode0" value="0"
|
||||
checked>
|
||||
checked>
|
||||
<label class="btn btn-outline-primary" for="displayMode0">自动识别显示</label>
|
||||
|
||||
<input type="radio" class="btn-check" name="displayMode" id="displayMode1" value="1">
|
||||
|
|
@ -38,28 +38,31 @@
|
|||
<!-- 音频传输开关 - 隐藏关闭音频传输选项 -->
|
||||
<div class="btn-group ms-3" role="group">
|
||||
<input type="radio" class="btn-check" name="audioStreaming" id="audioStreaming1" value="1"
|
||||
checked>
|
||||
checked>
|
||||
<label class="btn btn-outline-success" for="audioStreaming1">开启音频传输</label>
|
||||
|
||||
<input type="radio" class="btn-check" name="audioStreaming" id="audioStreaming0" value="0"
|
||||
style="display: none;">
|
||||
style="display: none;">
|
||||
<label class="btn btn-outline-danger" for="audioStreaming0"
|
||||
style="display: none;">关闭音频传输</label>
|
||||
style="display: none;">关闭音频传输</label>
|
||||
|
||||
<!-- 音量控制滑块 -->
|
||||
<div class="ms-3 d-flex align-items-center">
|
||||
<label for="volumeControl" class="me-2"><i class="bi bi-volume-up"></i></label>
|
||||
<input type="range" class="form-range" min="0" max="1" step="0.1" value="1.0"
|
||||
id="volumeControl" style="width: 100px;">
|
||||
id="volumeControl" style="width: 100px;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 控屏开关 -->
|
||||
<div class="btn-group ms-3" role="group">
|
||||
<input type="radio" class="btn-check" name="screenControl" id="screenControlAuto" value="0" checked>
|
||||
控评开关:
|
||||
<input type="radio" class="btn-check" name="screenControl" id="screenControlAuto" value="0"
|
||||
checked>
|
||||
<label class="btn btn-outline-primary" for="screenControlAuto">自动</label>
|
||||
|
||||
<input type="radio" class="btn-check" name="screenControl" id="screenControlManual" value="1">
|
||||
<input type="radio" class="btn-check" name="screenControl" id="screenControlManual"
|
||||
value="1">
|
||||
<label class="btn btn-outline-primary" for="screenControlManual">手动</label>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -77,7 +80,7 @@
|
|||
</div>
|
||||
<div class="card-body p-0">
|
||||
<div id="monitor-text-list" class="list-group list-group-flush"
|
||||
style="max-height: 75vh; overflow-y: auto;">
|
||||
style="max-height: 75vh; overflow-y: auto;">
|
||||
<!-- 文本列表内容将通过JS动态填充 -->
|
||||
<div class="text-center text-muted p-3">加载中...</div>
|
||||
</div>
|
||||
|
|
@ -117,7 +120,7 @@
|
|||
</div>
|
||||
<div class="card-body">
|
||||
<textarea id="text-input" class="form-control h-100" placeholder="请输入要显示的文本..."
|
||||
maxlength="30"></textarea>
|
||||
maxlength="30"></textarea>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -128,12 +131,12 @@
|
|||
<div class="card h-100">
|
||||
<div class="card-body d-flex justify-content-center align-items-center">
|
||||
<button id="add-text-btn" class="btn btn-primary me-3" data-bs-toggle="tooltip"
|
||||
title="将文本添加到显示队列,并显示在大屏上" onclick="addDisplayText()">
|
||||
title="将文本添加到显示队列,并显示在大屏上" onclick="addDisplayText()">
|
||||
<i class="bi bi-plus-circle"></i> 显示到大屏
|
||||
</button>
|
||||
<button id="add-and-remove-btn" class="btn btn-warning" data-bs-toggle="tooltip"
|
||||
title="将文本添加到显示队列,并从监控列表中移除当前选中项" onclick="addDisplayTextAndRemoveMonitor()"
|
||||
style="display: none;">
|
||||
title="将文本添加到显示队列,并从监控列表中移除当前选中项" onclick="addDisplayTextAndRemoveMonitor()"
|
||||
style="display: none;">
|
||||
<i class="bi bi-arrow-right-circle"></i> 添加并移除
|
||||
</button>
|
||||
</div>
|
||||
|
|
@ -157,7 +160,7 @@
|
|||
</div>
|
||||
<div class="card-body p-0">
|
||||
<div id="display-text-list" class="list-group list-group-flush"
|
||||
style="max-height: 75vh; overflow-y: auto;">
|
||||
style="max-height: 75vh; overflow-y: auto;">
|
||||
<!-- 文本列表内容将通过JS动态填充 -->
|
||||
<div class="text-center text-muted p-3">加载中...</div>
|
||||
</div>
|
||||
|
|
@ -190,7 +193,7 @@
|
|||
|
||||
<!-- 来电确认对话框 -->
|
||||
<div class="modal fade" id="callConfirmDialog" tabindex="-1" aria-labelledby="callConfirmDialogLabel"
|
||||
aria-hidden="true" data-bs-backdrop="static" data-bs-keyboard="false">
|
||||
aria-hidden="true" data-bs-backdrop="static" data-bs-keyboard="false">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header bg-primary text-white">
|
||||
|
|
@ -243,7 +246,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
@section Scripts {
|
||||
@section Scripts {
|
||||
<script src="~/lib/microsoft-signalr/signalr.min.js"></script>
|
||||
|
||||
<script>
|
||||
|
|
@ -287,9 +290,8 @@
|
|||
const timestamp = new Date().toLocaleTimeString();
|
||||
const logMsg = `[${timestamp}] ${message}`;
|
||||
console.log(logMsg);
|
||||
|
||||
const logElem = document.getElementById("debug-log");
|
||||
if (logElem&&false) {
|
||||
if (logElem) {
|
||||
const logLine = document.createElement("div");
|
||||
logLine.textContent = logMsg;
|
||||
logElem.insertBefore(logLine, logElem.firstChild);
|
||||
|
|
@ -314,9 +316,9 @@
|
|||
const alert = document.createElement("div");
|
||||
alert.className = `alert alert-${type} alert-dismissible fade show`;
|
||||
alert.innerHTML = `
|
||||
${message}
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
`;
|
||||
${message}
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
`;
|
||||
messageArea.appendChild(alert);
|
||||
|
||||
// 自动移除
|
||||
|
|
@ -686,22 +688,22 @@
|
|||
const shortText = text.length > 10 ? text.substring(0, 10) : text;
|
||||
|
||||
listItem.innerHTML = `
|
||||
<div class="d-flex justify-content-between align-items-start mb-1">
|
||||
<small class="text-muted">【${shortText}】</small>
|
||||
<div class="btn-group btn-group-sm">
|
||||
<button class="btn btn-outline-primary btn-sm" onclick="playAudio('${item.recordingPath || ''}', this)">
|
||||
<i class="bi bi-play-fill"></i>
|
||||
</button>
|
||||
<button class="btn btn-outline-secondary btn-sm" onclick="downloadRecording('${item.recordingPath || ''}')">
|
||||
<i class="bi bi-download"></i>
|
||||
</button>
|
||||
<button class="btn btn-outline-danger btn-sm" onclick="deleteMonitorText('${item.id}')">
|
||||
<i class="bi bi-trash"></i>
|
||||
</button>
|
||||
<div class="d-flex justify-content-between align-items-start mb-1">
|
||||
<small class="text-muted">【${shortText}】</small>
|
||||
<div class="btn-group btn-group-sm">
|
||||
<button class="btn btn-outline-primary btn-sm" onclick="playAudio('${item.recordingPath || ''}', this)">
|
||||
<i class="bi bi-play-fill"></i>
|
||||
</button>
|
||||
<button class="btn btn-outline-secondary btn-sm" onclick="downloadRecording('${item.recordingPath || ''}')">
|
||||
<i class="bi bi-download"></i>
|
||||
</button>
|
||||
<button class="btn btn-outline-danger btn-sm" onclick="deleteMonitorText('${item.id}')">
|
||||
<i class="bi bi-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>${formattedDate}</div>
|
||||
`;
|
||||
<div>${formattedDate}</div>
|
||||
`;
|
||||
|
||||
container.appendChild(listItem);
|
||||
});
|
||||
|
|
@ -907,11 +909,11 @@
|
|||
const shortText = text.length > 5 ? text.substring(0, 5) : text;
|
||||
|
||||
listItem.innerHTML = `
|
||||
<div class="mb-1">
|
||||
<small class="text-muted">${formattedDate}</small>
|
||||
</div>
|
||||
<div>【${shortText}】</div>
|
||||
`;
|
||||
<div class="mb-1">
|
||||
<small class="text-muted">${formattedDate}</small>
|
||||
</div>
|
||||
<div>【${shortText}】</div>
|
||||
`;
|
||||
|
||||
container.appendChild(listItem);
|
||||
});
|
||||
|
|
@ -1023,6 +1025,7 @@
|
|||
|
||||
// 设置控屏开关监听器
|
||||
function setupScreenControlListeners() {
|
||||
console.log('aaaa')
|
||||
const screenControlButtons = document.querySelectorAll('input[name="screenControl"]');
|
||||
screenControlButtons.forEach(radio => {
|
||||
radio.addEventListener('change', function () {
|
||||
|
|
@ -1072,6 +1075,7 @@
|
|||
|
||||
// 初始化页面
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
|
||||
// 初始化音频上下文
|
||||
initAudioContext();
|
||||
|
||||
|
|
@ -1079,7 +1083,7 @@
|
|||
initSignalR();
|
||||
|
||||
// 设置各种事件监听器
|
||||
setupEventListeners();
|
||||
// setupEventListeners();
|
||||
setupDisplayModeListeners();
|
||||
setupAudioStreamingListeners();
|
||||
setupScreenControlListeners();
|
||||
|
|
@ -1096,19 +1100,7 @@
|
|||
// 默认开启音频传输
|
||||
document.getElementById("audioStreaming1").checked = true;
|
||||
isAudioStreamEnabled = true;
|
||||
|
||||
// 显示提示消息
|
||||
setTimeout(function () {
|
||||
// 检查控屏模式
|
||||
if (isManualScreenControlEnabled) {
|
||||
showMessage("当前为手动控屏模式,需要您手动确认要显示的文本", "info", 10000);
|
||||
}
|
||||
|
||||
// 检查显示模式
|
||||
if (displayType === 1) {
|
||||
showMessage("当前为手动处理数据模式,需要您手动审核并添加文本到显示队列", "info", 10000);
|
||||
}
|
||||
}, 1500);
|
||||
|
||||
});
|
||||
|
||||
// 页面卸载前清理资源
|
||||
|
|
@ -1410,7 +1402,7 @@
|
|||
}
|
||||
|
||||
// 监听音量变化
|
||||
volumeSlider.addEventListener("input", function() {
|
||||
volumeSlider.addEventListener("input", function () {
|
||||
const newVolume = parseFloat(this.value) / 100;
|
||||
currentVolume = newVolume;
|
||||
|
||||
|
|
@ -1465,7 +1457,7 @@
|
|||
|
||||
// 恢复音频上下文
|
||||
if (audioContext.state === 'suspended') {
|
||||
const resumeAudio = function() {
|
||||
const resumeAudio = function () {
|
||||
if (audioContext && audioContext.state === 'suspended') {
|
||||
audioContext.resume().then(() => {
|
||||
log("音频上下文已激活");
|
||||
|
|
@ -1541,8 +1533,8 @@
|
|||
if (!isAudioPlaying && audioBufferQueue.length < bufferStartSizeThreshold) {
|
||||
// 只在达到特定比例时记录
|
||||
if (audioBufferQueue.length === 1 ||
|
||||
audioBufferQueue.length === Math.floor(bufferStartSizeThreshold/2) ||
|
||||
audioBufferQueue.length === bufferStartSizeThreshold-1) {
|
||||
audioBufferQueue.length === Math.floor(bufferStartSizeThreshold / 2) ||
|
||||
audioBufferQueue.length === bufferStartSizeThreshold - 1) {
|
||||
log(`缓冲中: ${audioBufferQueue.length}/${bufferStartSizeThreshold}`);
|
||||
}
|
||||
return;
|
||||
|
|
@ -1746,16 +1738,16 @@
|
|||
const shortText = text.length > 10 ? text.substring(0, 10) : text;
|
||||
|
||||
listItem.innerHTML = `
|
||||
<div class="d-flex justify-content-between align-items-start mb-1">
|
||||
<small class="text-muted">【${shortText}】</small>
|
||||
<div class="btn-group btn-group-sm">
|
||||
<button class="btn btn-outline-danger btn-sm" onclick="deleteMonitorText('${listItem.dataset.id}')">
|
||||
<i class="bi bi-trash"></i>
|
||||
</button>
|
||||
<div class="d-flex justify-content-between align-items-start mb-1">
|
||||
<small class="text-muted">【${shortText}】</small>
|
||||
<div class="btn-group btn-group-sm">
|
||||
<button class="btn btn-outline-danger btn-sm" onclick="deleteMonitorText('${listItem.dataset.id}')">
|
||||
<i class="bi bi-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>${formattedDate} (本地)</div>
|
||||
`;
|
||||
<div>${formattedDate} (本地)</div>
|
||||
`;
|
||||
|
||||
// 添加到列表顶部
|
||||
if (container.firstChild) {
|
||||
|
|
@ -1902,4 +1894,4 @@
|
|||
}
|
||||
}
|
||||
</script>
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user