Add comprehensive voicemail integration to browser phone

- Add AJAX endpoint for fetching user voicemails with stats and recent list
- Create voicemail display section with counts, transcriptions, and playback
- Implement click-to-play functionality for voicemail audio
- Add refresh and view-all buttons with admin page integration
- Style voicemail section with consistent design and dark mode support
- Include visual indicators for recordings and formatted durations
- Add mobile responsive design and hover effects

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-08-15 09:29:35 -07:00
parent d63eec129a
commit f26cb24dfd
5 changed files with 380 additions and 4 deletions

View File

@@ -463,6 +463,148 @@
opacity: 0.8;
}
/* Voicemail Section */
.twp-voicemail-section {
background: #fff;
padding: 16px;
border-radius: 8px;
border: 2px solid #e9ecef;
margin-bottom: 20px;
}
.twp-voicemail-section h4 {
margin: 0 0 16px 0;
color: #212529;
font-size: 1.1rem;
text-align: center;
}
.voicemail-stats {
display: flex;
justify-content: space-around;
margin-bottom: 16px;
padding: 12px;
background: #f8f9fa;
border-radius: 6px;
}
.stat-item {
text-align: center;
}
.stat-label {
display: block;
font-size: 0.9rem;
color: #6c757d;
margin-bottom: 4px;
}
.stat-value {
display: block;
font-size: 1.2rem;
font-weight: 600;
color: #495057;
}
.twp-voicemail-list {
margin-bottom: 16px;
max-height: 200px;
overflow-y: auto;
}
.voicemail-item {
padding: 12px;
border: 1px solid #dee2e6;
border-radius: 6px;
margin-bottom: 8px;
cursor: pointer;
transition: all 0.2s ease;
}
.voicemail-item:hover {
background: #f8f9fa;
border-color: #007bff;
}
.voicemail-item.has-recording {
border-left: 4px solid #28a745;
}
.voicemail-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 8px;
}
.voicemail-from {
display: flex;
align-items: center;
gap: 6px;
}
.from-number {
font-weight: 600;
color: #495057;
}
.voicemail-time {
font-size: 0.85rem;
color: #6c757d;
}
.voicemail-details {
display: flex;
align-items: center;
gap: 12px;
margin-bottom: 8px;
}
.voicemail-duration {
display: flex;
align-items: center;
gap: 4px;
font-size: 0.9rem;
color: #6c757d;
}
.recording-indicator {
background: #28a745;
color: white;
padding: 2px 8px;
border-radius: 12px;
font-size: 0.8rem;
}
.voicemail-transcription {
font-size: 0.9rem;
color: #495057;
font-style: italic;
padding: 8px;
background: #f8f9fa;
border-radius: 4px;
border-left: 3px solid #007bff;
}
.voicemail-actions {
display: flex;
gap: 8px;
flex-wrap: wrap;
}
.voicemail-actions .twp-btn {
flex: 1;
min-width: 80px;
}
.no-voicemails,
.voicemail-loading {
text-align: center;
padding: 20px;
color: #6c757d;
font-style: italic;
}
.twp-btn-secondary {
background: #6c757d;
color: white;
@@ -588,7 +730,8 @@
.twp-connection-status,
.twp-call-info,
.twp-queue-controls,
.twp-queue-section {
.twp-queue-section,
.twp-voicemail-section {
background: #2d3748;
border-color: #4a5568;
}
@@ -623,8 +766,11 @@
.twp-phone-selection label,
.twp-browser-phone-title,
.twp-queue-section h4,
.twp-voicemail-section h4,
.selected-queue-info h5,
.timer-value {
.timer-value,
.from-number,
.stat-value {
color: #f7fafc;
}
@@ -635,14 +781,33 @@
.queue-info,
.queue-stats,
.queue-loading,
.no-queues {
.no-queues,
.voicemail-stats,
.voicemail-time,
.voicemail-duration,
.stat-label,
.voicemail-loading,
.no-voicemails {
color: #cbd5e0;
}
.no-queues {
.no-queues,
.voicemail-stats,
.voicemail-transcription {
background: #2d3748;
border-color: #4a5568;
}
.voicemail-item {
background: #2d3748;
border-color: #4a5568;
color: #f7fafc;
}
.voicemail-item:hover {
background: #4a5568;
border-color: #63b3ed;
}
}
/* Animation for incoming calls */