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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>NexusDial - Advanced Cloud Dialer</title>
|
| 7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 9 |
+
<script>
|
| 10 |
+
tailwind.config = {
|
| 11 |
+
theme: {
|
| 12 |
+
extend: {
|
| 13 |
+
colors: {
|
| 14 |
+
primary: '#4f46e5',
|
| 15 |
+
secondary: '#10b981',
|
| 16 |
+
accent: '#f59e0b',
|
| 17 |
+
dark: '#1e293b',
|
| 18 |
+
light: '#f8fafc'
|
| 19 |
+
}
|
| 20 |
+
}
|
| 21 |
+
}
|
| 22 |
+
}
|
| 23 |
+
</script>
|
| 24 |
+
<style>
|
| 25 |
+
@keyframes pulse {
|
| 26 |
+
0%, 100% { opacity: 1; }
|
| 27 |
+
50% { opacity: 0.5; }
|
| 28 |
+
}
|
| 29 |
+
.pulse-animation {
|
| 30 |
+
animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
|
| 31 |
+
}
|
| 32 |
+
.agent-card:hover {
|
| 33 |
+
transform: translateY(-2px);
|
| 34 |
+
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
|
| 35 |
+
}
|
| 36 |
+
.call-animation {
|
| 37 |
+
animation: ring 1.5s ease infinite;
|
| 38 |
+
}
|
| 39 |
+
@keyframes ring {
|
| 40 |
+
0% { transform: rotate(0); }
|
| 41 |
+
10% { transform: rotate(-5deg); }
|
| 42 |
+
20% { transform: rotate(5deg); }
|
| 43 |
+
30% { transform: rotate(-5deg); }
|
| 44 |
+
40% { transform: rotate(5deg); }
|
| 45 |
+
50% { transform: rotate(0); }
|
| 46 |
+
100% { transform: rotate(0); }
|
| 47 |
+
}
|
| 48 |
+
.sidebar {
|
| 49 |
+
scrollbar-width: thin;
|
| 50 |
+
scrollbar-color: #4f46e5 #e2e8f0;
|
| 51 |
+
}
|
| 52 |
+
.sidebar::-webkit-scrollbar {
|
| 53 |
+
width: 6px;
|
| 54 |
+
}
|
| 55 |
+
.sidebar::-webkit-scrollbar-track {
|
| 56 |
+
background: #e2e8f0;
|
| 57 |
+
}
|
| 58 |
+
.sidebar::-webkit-scrollbar-thumb {
|
| 59 |
+
background-color: #4f46e5;
|
| 60 |
+
border-radius: 3px;
|
| 61 |
+
}
|
| 62 |
+
</style>
|
| 63 |
+
</head>
|
| 64 |
+
<body class="bg-gray-50 font-sans antialiased">
|
| 65 |
+
<div class="flex h-screen overflow-hidden">
|
| 66 |
+
<!-- Sidebar -->
|
| 67 |
+
<div class="hidden md:flex md:flex-shrink-0">
|
| 68 |
+
<div class="flex flex-col w-64 bg-white border-r border-gray-200">
|
| 69 |
+
<div class="flex items-center justify-center h-16 px-4 bg-primary text-white">
|
| 70 |
+
<div class="flex items-center">
|
| 71 |
+
<i class="fas fa-phone-alt mr-2"></i>
|
| 72 |
+
<span class="text-xl font-semibold">NexusDial</span>
|
| 73 |
+
</div>
|
| 74 |
+
</div>
|
| 75 |
+
<div class="flex flex-col flex-grow overflow-y-auto sidebar">
|
| 76 |
+
<nav class="flex-1 px-2 py-4 space-y-1">
|
| 77 |
+
<a href="#" class="flex items-center px-2 py-2 text-sm font-medium rounded-md bg-indigo-100 text-primary">
|
| 78 |
+
<i class="fas fa-tachometer-alt mr-3"></i>
|
| 79 |
+
Dashboard
|
| 80 |
+
</a>
|
| 81 |
+
<a href="#" class="flex items-center px-2 py-2 text-sm font-medium rounded-md text-gray-600 hover:bg-gray-100 hover:text-gray-900">
|
| 82 |
+
<i class="fas fa-users mr-3"></i>
|
| 83 |
+
Contacts
|
| 84 |
+
</a>
|
| 85 |
+
<a href="#" class="flex items-center px-2 py-2 text-sm font-medium rounded-md text-gray-600 hover:bg-gray-100 hover:text-gray-900">
|
| 86 |
+
<i class="fas fa-chart-line mr-3"></i>
|
| 87 |
+
Analytics
|
| 88 |
+
</a>
|
| 89 |
+
<a href="#" class="flex items-center px-2 py-2 text-sm font-medium rounded-md text-gray-600 hover:bg-gray-100 hover:text-gray-900">
|
| 90 |
+
<i class="fas fa-cog mr-3"></i>
|
| 91 |
+
Settings
|
| 92 |
+
</a>
|
| 93 |
+
<a href="#" class="flex items-center px-2 py-2 text-sm font-medium rounded-md text-gray-600 hover:bg-gray-100 hover:text-gray-900">
|
| 94 |
+
<i class="fas fa-question-circle mr-3"></i>
|
| 95 |
+
Help
|
| 96 |
+
</a>
|
| 97 |
+
</nav>
|
| 98 |
+
<div class="px-4 py-4 border-t border-gray-200">
|
| 99 |
+
<div class="flex items-center">
|
| 100 |
+
<img class="w-10 h-10 rounded-full" src="https://randomuser.me/api/portraits/women/44.jpg" alt="User profile">
|
| 101 |
+
<div class="ml-3">
|
| 102 |
+
<p class="text-sm font-medium text-gray-700">Sarah Johnson</p>
|
| 103 |
+
<p class="text-xs font-medium text-gray-500">Admin</p>
|
| 104 |
+
</div>
|
| 105 |
+
</div>
|
| 106 |
+
</div>
|
| 107 |
+
</div>
|
| 108 |
+
</div>
|
| 109 |
+
</div>
|
| 110 |
+
|
| 111 |
+
<!-- Main Content -->
|
| 112 |
+
<div class="flex flex-col flex-1 overflow-hidden">
|
| 113 |
+
<!-- Top Navigation -->
|
| 114 |
+
<div class="flex items-center justify-between h-16 px-4 bg-white border-b border-gray-200">
|
| 115 |
+
<div class="flex items-center">
|
| 116 |
+
<button class="md:hidden text-gray-500 focus:outline-none">
|
| 117 |
+
<i class="fas fa-bars"></i>
|
| 118 |
+
</button>
|
| 119 |
+
<h1 class="ml-4 text-lg font-semibold text-gray-800">Dialer Dashboard</h1>
|
| 120 |
+
</div>
|
| 121 |
+
<div class="flex items-center space-x-4">
|
| 122 |
+
<button class="p-1 text-gray-400 rounded-full hover:text-gray-500 focus:outline-none">
|
| 123 |
+
<i class="fas fa-bell"></i>
|
| 124 |
+
</button>
|
| 125 |
+
<button class="p-1 text-gray-400 rounded-full hover:text-gray-500 focus:outline-none">
|
| 126 |
+
<i class="fas fa-envelope"></i>
|
| 127 |
+
</button>
|
| 128 |
+
<div class="relative">
|
| 129 |
+
<button class="flex items-center text-sm text-gray-700 focus:outline-none">
|
| 130 |
+
<span class="sr-only">Open user menu</span>
|
| 131 |
+
<img class="w-8 h-8 rounded-full" src="https://randomuser.me/api/portraits/women/44.jpg" alt="User profile">
|
| 132 |
+
</button>
|
| 133 |
+
</div>
|
| 134 |
+
</div>
|
| 135 |
+
</div>
|
| 136 |
+
|
| 137 |
+
<!-- Main Content Area -->
|
| 138 |
+
<div class="flex-1 overflow-auto p-4">
|
| 139 |
+
<div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
|
| 140 |
+
<!-- Left Column -->
|
| 141 |
+
<div class="lg:col-span-2 space-y-6">
|
| 142 |
+
<!-- Campaign Stats -->
|
| 143 |
+
<div class="bg-white rounded-lg shadow p-6">
|
| 144 |
+
<div class="flex justify-between items-center mb-4">
|
| 145 |
+
<h2 class="text-lg font-semibold text-gray-800">Campaign Performance</h2>
|
| 146 |
+
<div class="flex space-x-2">
|
| 147 |
+
<button class="px-3 py-1 text-xs bg-primary text-white rounded-md">Today</button>
|
| 148 |
+
<button class="px-3 py-1 text-xs bg-gray-200 text-gray-700 rounded-md">Week</button>
|
| 149 |
+
<button class="px-3 py-1 text-xs bg-gray-200 text-gray-700 rounded-md">Month</button>
|
| 150 |
+
</div>
|
| 151 |
+
</div>
|
| 152 |
+
<div class="grid grid-cols-2 md:grid-cols-4 gap-4">
|
| 153 |
+
<div class="bg-indigo-50 p-4 rounded-lg">
|
| 154 |
+
<div class="text-sm font-medium text-indigo-600">Total Calls</div>
|
| 155 |
+
<div class="mt-1 text-2xl font-semibold text-gray-900">1,248</div>
|
| 156 |
+
<div class="text-xs text-green-600 flex items-center">
|
| 157 |
+
<i class="fas fa-arrow-up mr-1"></i> 12% from yesterday
|
| 158 |
+
</div>
|
| 159 |
+
</div>
|
| 160 |
+
<div class="bg-green-50 p-4 rounded-lg">
|
| 161 |
+
<div class="text-sm font-medium text-green-600">Connected</div>
|
| 162 |
+
<div class="mt-1 text-2xl font-semibold text-gray-900">842</div>
|
| 163 |
+
<div class="text-xs text-green-600 flex items-center">
|
| 164 |
+
<i class="fas fa-arrow-up mr-1"></i> 8% from yesterday
|
| 165 |
+
</div>
|
| 166 |
+
</div>
|
| 167 |
+
<div class="bg-yellow-50 p-4 rounded-lg">
|
| 168 |
+
<div class="text-sm font-medium text-yellow-600">Conversion</div>
|
| 169 |
+
<div class="mt-1 text-2xl font-semibold text-gray-900">312</div>
|
| 170 |
+
<div class="text-xs text-red-600 flex items-center">
|
| 171 |
+
<i class="fas fa-arrow-down mr-1"></i> 3% from yesterday
|
| 172 |
+
</div>
|
| 173 |
+
</div>
|
| 174 |
+
<div class="bg-red-50 p-4 rounded-lg">
|
| 175 |
+
<div class="text-sm font-medium text-red-600">DNC Hits</div>
|
| 176 |
+
<div class="mt-1 text-2xl font-semibold text-gray-900">24</div>
|
| 177 |
+
<div class="text-xs text-green-600 flex items-center">
|
| 178 |
+
<i class="fas fa-arrow-down mr-1"></i> 5% from yesterday
|
| 179 |
+
</div>
|
| 180 |
+
</div>
|
| 181 |
+
</div>
|
| 182 |
+
</div>
|
| 183 |
+
|
| 184 |
+
<!-- Dialer Controls -->
|
| 185 |
+
<div class="bg-white rounded-lg shadow p-6">
|
| 186 |
+
<h2 class="text-lg font-semibold text-gray-800 mb-4">Dialer Controls</h2>
|
| 187 |
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
| 188 |
+
<div>
|
| 189 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Load Contacts</label>
|
| 190 |
+
<div class="flex space-x-2 mb-4">
|
| 191 |
+
<label class="flex-1">
|
| 192 |
+
<div class="flex items-center justify-center px-4 py-2 bg-white border border-gray-300 rounded-md shadow-sm text-sm font-medium text-gray-700 hover:bg-gray-50 cursor-pointer">
|
| 193 |
+
<i class="fas fa-file-upload mr-2"></i> Upload CSV
|
| 194 |
+
<input type="file" class="hidden" id="csv-upload" accept=".csv,.txt">
|
| 195 |
+
</div>
|
| 196 |
+
</label>
|
| 197 |
+
<button class="px-4 py-2 bg-primary text-white rounded-md shadow-sm text-sm font-medium hover:bg-indigo-700 focus:outline-none">
|
| 198 |
+
<i class="fas fa-database mr-2"></i> From CRM
|
| 199 |
+
</button>
|
| 200 |
+
</div>
|
| 201 |
+
|
| 202 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Or paste numbers</label>
|
| 203 |
+
<textarea id="paste-list" rows="4" class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-primary focus:border-primary" placeholder="Enter phone numbers, one per line..."></textarea>
|
| 204 |
+
|
| 205 |
+
<div class="flex justify-between mt-2">
|
| 206 |
+
<span id="queue-count" class="text-sm text-gray-500">0 numbers in queue</span>
|
| 207 |
+
<button id="clear-queue" class="text-sm text-red-500 hover:text-red-700">
|
| 208 |
+
<i class="fas fa-trash-alt mr-1"></i> Clear
|
| 209 |
+
</button>
|
| 210 |
+
</div>
|
| 211 |
+
</div>
|
| 212 |
+
|
| 213 |
+
<div>
|
| 214 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Dialer Settings</label>
|
| 215 |
+
<div class="space-y-3">
|
| 216 |
+
<div>
|
| 217 |
+
<label class="block text-xs text-gray-500 mb-1">Dial Mode</label>
|
| 218 |
+
<select class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-primary focus:border-primary text-sm">
|
| 219 |
+
<option>Predictive (Auto)</option>
|
| 220 |
+
<option>Progressive</option>
|
| 221 |
+
<option>Preview</option>
|
| 222 |
+
<option>Manual</option>
|
| 223 |
+
</select>
|
| 224 |
+
</div>
|
| 225 |
+
|
| 226 |
+
<div class="grid grid-cols-2 gap-3">
|
| 227 |
+
<div>
|
| 228 |
+
<label class="block text-xs text-gray-500 mb-1">Max Calls/Hour</label>
|
| 229 |
+
<input type="number" value="60" class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-primary focus:border-primary text-sm">
|
| 230 |
+
</div>
|
| 231 |
+
<div>
|
| 232 |
+
<label class="block text-xs text-gray-500 mb-1">Call Timeout</label>
|
| 233 |
+
<input type="number" value="30" class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-primary focus:border-primary text-sm">
|
| 234 |
+
</div>
|
| 235 |
+
</div>
|
| 236 |
+
|
| 237 |
+
<div class="flex items-center">
|
| 238 |
+
<input id="enable-recording" type="checkbox" checked class="h-4 w-4 text-primary focus:ring-primary border-gray-300 rounded">
|
| 239 |
+
<label for="enable-recording" class="ml-2 block text-sm text-gray-700">Record calls</label>
|
| 240 |
+
</div>
|
| 241 |
+
|
| 242 |
+
<div class="flex space-x-2 pt-2">
|
| 243 |
+
<button id="start-dialer" class="flex-1 px-4 py-2 bg-green-600 text-white rounded-md shadow-sm text-sm font-medium hover:bg-green-700 focus:outline-none">
|
| 244 |
+
<i class="fas fa-play mr-2"></i> Start Dialing
|
| 245 |
+
</button>
|
| 246 |
+
<button id="pause-dialer" class="flex-1 px-4 py-2 bg-yellow-500 text-white rounded-md shadow-sm text-sm font-medium hover:bg-yellow-600 focus:outline-none">
|
| 247 |
+
<i class="fas fa-pause mr-2"></i> Pause
|
| 248 |
+
</button>
|
| 249 |
+
</div>
|
| 250 |
+
</div>
|
| 251 |
+
</div>
|
| 252 |
+
</div>
|
| 253 |
+
</div>
|
| 254 |
+
|
| 255 |
+
<!-- Active Calls -->
|
| 256 |
+
<div class="bg-white rounded-lg shadow overflow-hidden">
|
| 257 |
+
<div class="px-6 py-4 border-b border-gray-200">
|
| 258 |
+
<h2 class="text-lg font-semibold text-gray-800">Active Calls</h2>
|
| 259 |
+
</div>
|
| 260 |
+
<div class="divide-y divide-gray-200">
|
| 261 |
+
<div class="p-4 hover:bg-gray-50">
|
| 262 |
+
<div class="flex items-center">
|
| 263 |
+
<div class="flex-shrink-0">
|
| 264 |
+
<div class="h-10 w-10 rounded-full bg-green-100 flex items-center justify-center text-green-600">
|
| 265 |
+
<i class="fas fa-phone-alt call-animation"></i>
|
| 266 |
+
</div>
|
| 267 |
+
</div>
|
| 268 |
+
<div class="ml-4 flex-1">
|
| 269 |
+
<div class="flex items-center justify-between">
|
| 270 |
+
<p class="text-sm font-medium text-gray-900">+1 (555) 123-4567</p>
|
| 271 |
+
<p class="text-xs text-gray-500">02:34</p>
|
| 272 |
+
</div>
|
| 273 |
+
<div class="flex items-center justify-between mt-1">
|
| 274 |
+
<p class="text-xs text-gray-500">Agent: Michael Scott</p>
|
| 275 |
+
<span class="px-2 py-1 text-xs rounded-full bg-green-100 text-green-800">Connected</span>
|
| 276 |
+
</div>
|
| 277 |
+
</div>
|
| 278 |
+
</div>
|
| 279 |
+
</div>
|
| 280 |
+
<div class="p-4 hover:bg-gray-50">
|
| 281 |
+
<div class="flex items-center">
|
| 282 |
+
<div class="flex-shrink-0">
|
| 283 |
+
<div class="h-10 w-10 rounded-full bg-blue-100 flex items-center justify-center text-blue-600">
|
| 284 |
+
<i class="fas fa-phone-alt call-animation"></i>
|
| 285 |
+
</div>
|
| 286 |
+
</div>
|
| 287 |
+
<div class="ml-4 flex-1">
|
| 288 |
+
<div class="flex items-center justify-between">
|
| 289 |
+
<p class="text-sm font-medium text-gray-900">+1 (555) 987-6543</p>
|
| 290 |
+
<p class="text-xs text-gray-500">01:12</p>
|
| 291 |
+
</div>
|
| 292 |
+
<div class="flex items-center justify-between mt-1">
|
| 293 |
+
<p class="text-xs text-gray-500">Agent: Dwight Schrute</p>
|
| 294 |
+
<span class="px-2 py-1 text-xs rounded-full bg-blue-100 text-blue-800">Ringing</span>
|
| 295 |
+
</div>
|
| 296 |
+
</div>
|
| 297 |
+
</div>
|
| 298 |
+
</div>
|
| 299 |
+
<div class="p-4 hover:bg-gray-50">
|
| 300 |
+
<div class="flex items-center">
|
| 301 |
+
<div class="flex-shrink-0">
|
| 302 |
+
<div class="h-10 w-10 rounded-full bg-yellow-100 flex items-center justify-center text-yellow-600">
|
| 303 |
+
<i class="fas fa-phone-alt"></i>
|
| 304 |
+
</div>
|
| 305 |
+
</div>
|
| 306 |
+
<div class="ml-4 flex-1">
|
| 307 |
+
<div class="flex items-center justify-between">
|
| 308 |
+
<p class="text-sm font-medium text-gray-900">+1 (555) 456-7890</p>
|
| 309 |
+
<p class="text-xs text-gray-500">00:45</p>
|
| 310 |
+
</div>
|
| 311 |
+
<div class="flex items-center justify-between mt-1">
|
| 312 |
+
<p class="text-xs text-gray-500">Agent: Jim Halpert</p>
|
| 313 |
+
<span class="px-2 py-1 text-xs rounded-full bg-yellow-100 text-yellow-800">On Hold</span>
|
| 314 |
+
</div>
|
| 315 |
+
</div>
|
| 316 |
+
</div>
|
| 317 |
+
</div>
|
| 318 |
+
</div>
|
| 319 |
+
</div>
|
| 320 |
+
</div>
|
| 321 |
+
|
| 322 |
+
<!-- Right Column -->
|
| 323 |
+
<div class="space-y-6">
|
| 324 |
+
<!-- Agent Status -->
|
| 325 |
+
<div class="bg-white rounded-lg shadow overflow-hidden">
|
| 326 |
+
<div class="px-6 py-4 border-b border-gray-200">
|
| 327 |
+
<div class="flex items-center justify-between">
|
| 328 |
+
<h2 class="text-lg font-semibold text-gray-800">Agent Status</h2>
|
| 329 |
+
<span class="text-xs bg-primary text-white px-2 py-1 rounded-full">10 Agents</span>
|
| 330 |
+
</div>
|
| 331 |
+
</div>
|
| 332 |
+
<div class="divide-y divide-gray-200">
|
| 333 |
+
<div class="p-4 hover:bg-gray-50">
|
| 334 |
+
<div class="flex items-center">
|
| 335 |
+
<div class="flex-shrink-0">
|
| 336 |
+
<img class="h-10 w-10 rounded-full" src="https://randomuser.me/api/portraits/men/32.jpg" alt="Agent">
|
| 337 |
+
</div>
|
| 338 |
+
<div class="ml-4 flex-1">
|
| 339 |
+
<div class="flex items-center justify-between">
|
| 340 |
+
<p class="text-sm font-medium text-gray-900">Michael Scott</p>
|
| 341 |
+
<span class="px-2 py-1 text-xs rounded-full bg-green-100 text-green-800">On Call</span>
|
| 342 |
+
</div>
|
| 343 |
+
<div class="mt-1">
|
| 344 |
+
<p class="text-xs text-gray-500">+1 (555) 123-4567 (02:34)</p>
|
| 345 |
+
</div>
|
| 346 |
+
</div>
|
| 347 |
+
</div>
|
| 348 |
+
</div>
|
| 349 |
+
<div class="p-4 hover:bg-gray-50">
|
| 350 |
+
<div class="flex items-center">
|
| 351 |
+
<div class="flex-shrink-0">
|
| 352 |
+
<img class="h-10 w-10 rounded-full" src="https://randomuser.me/api/portraits/men/44.jpg" alt="Agent">
|
| 353 |
+
</div>
|
| 354 |
+
<div class="ml-4 flex-1">
|
| 355 |
+
<div class="flex items-center justify-between">
|
| 356 |
+
<p class="text-sm font-medium text-gray-900">Dwight Schrute</p>
|
| 357 |
+
<span class="px-2 py-1 text-xs rounded-full bg-blue-100 text-blue-800">Ringing</span>
|
| 358 |
+
</div>
|
| 359 |
+
<div class="mt-1">
|
| 360 |
+
<p class="text-xs text-gray-500">+1 (555) 987-6543 (01:12)</p>
|
| 361 |
+
</div>
|
| 362 |
+
</div>
|
| 363 |
+
</div>
|
| 364 |
+
</div>
|
| 365 |
+
<div class="p-4 hover:bg-gray-50">
|
| 366 |
+
<div class="flex items-center">
|
| 367 |
+
<div class="flex-shrink-0">
|
| 368 |
+
<img class="h-10 w-10 rounded-full" src="https://randomuser.me/api/portraits/men/22.jpg" alt="Agent">
|
| 369 |
+
</div>
|
| 370 |
+
<div class="ml-4 flex-1">
|
| 371 |
+
<div class="flex items-center justify-between">
|
| 372 |
+
<p class="text-sm font-medium text-gray-900">Jim Halpert</p>
|
| 373 |
+
<span class="px-2 py-1 text-xs rounded-full bg-yellow-100 text-yellow-800">On Hold</span>
|
| 374 |
+
</div>
|
| 375 |
+
<div class="mt-1">
|
| 376 |
+
<p class="text-xs text-gray-500">+1 (555) 456-7890 (00:45)</p>
|
| 377 |
+
</div>
|
| 378 |
+
</div>
|
| 379 |
+
</div>
|
| 380 |
+
</div>
|
| 381 |
+
<div class="p-4 hover:bg-gray-50">
|
| 382 |
+
<div class="flex items-center">
|
| 383 |
+
<div class="flex-shrink-0">
|
| 384 |
+
<img class="h-10 w-10 rounded-full" src="https://randomuser.me/api/portraits/women/63.jpg" alt="Agent">
|
| 385 |
+
</div>
|
| 386 |
+
<div class="ml-4 flex-1">
|
| 387 |
+
<div class="flex items-center justify-between">
|
| 388 |
+
<p class="text-sm font-medium text-gray-900">Pam Beesly</p>
|
| 389 |
+
<span class="px-2 py-1 text-xs rounded-full bg-gray-100 text-gray-800">Available</span>
|
| 390 |
+
</div>
|
| 391 |
+
<div class="mt-1">
|
| 392 |
+
<p class="text-xs text-gray-500">Ready for next call</p>
|
| 393 |
+
</div>
|
| 394 |
+
</div>
|
| 395 |
+
</div>
|
| 396 |
+
</div>
|
| 397 |
+
</div>
|
| 398 |
+
<div class="px-6 py-3 bg-gray-50 text-center">
|
| 399 |
+
<button class="text-sm text-primary hover:text-indigo-700 font-medium">
|
| 400 |
+
<i class="fas fa-plus mr-1"></i> Add Agent
|
| 401 |
+
</button>
|
| 402 |
+
</div>
|
| 403 |
+
</div>
|
| 404 |
+
|
| 405 |
+
<!-- Call Disposition -->
|
| 406 |
+
<div class="bg-white rounded-lg shadow p-6">
|
| 407 |
+
<h2 class="text-lg font-semibold text-gray-800 mb-4">Call Disposition</h2>
|
| 408 |
+
<div class="space-y-4">
|
| 409 |
+
<div>
|
| 410 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Status</label>
|
| 411 |
+
<select class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-primary focus:border-primary text-sm">
|
| 412 |
+
<option>Interested - Follow up needed</option>
|
| 413 |
+
<option>Not Interested</option>
|
| 414 |
+
<option>Call Back Later</option>
|
| 415 |
+
<option>Do Not Call</option>
|
| 416 |
+
<option>Wrong Number</option>
|
| 417 |
+
<option>No Answer</option>
|
| 418 |
+
<option>Busy</option>
|
| 419 |
+
</select>
|
| 420 |
+
</div>
|
| 421 |
+
|
| 422 |
+
<div>
|
| 423 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Notes</label>
|
| 424 |
+
<textarea rows="3" class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-primary focus:border-primary text-sm" placeholder="Add call notes..."></textarea>
|
| 425 |
+
</div>
|
| 426 |
+
|
| 427 |
+
<div>
|
| 428 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Next Action</label>
|
| 429 |
+
<select class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-primary focus:border-primary text-sm">
|
| 430 |
+
<option>None</option>
|
| 431 |
+
<option>Schedule Call Back</option>
|
| 432 |
+
<option>Send Email</option>
|
| 433 |
+
<option>Send SMS</option>
|
| 434 |
+
<option>Create Task</option>
|
| 435 |
+
</select>
|
| 436 |
+
</div>
|
| 437 |
+
|
| 438 |
+
<div id="callback-container" class="hidden">
|
| 439 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Callback Date/Time</label>
|
| 440 |
+
<input type="datetime-local" class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-primary focus:border-primary text-sm">
|
| 441 |
+
</div>
|
| 442 |
+
|
| 443 |
+
<button class="w-full px-4 py-2 bg-primary text-white rounded-md shadow-sm text-sm font-medium hover:bg-indigo-700 focus:outline-none">
|
| 444 |
+
<i class="fas fa-save mr-2"></i> Save Disposition
|
| 445 |
+
</button>
|
| 446 |
+
</div>
|
| 447 |
+
</div>
|
| 448 |
+
|
| 449 |
+
<!-- Quick Stats -->
|
| 450 |
+
<div class="bg-white rounded-lg shadow p-6">
|
| 451 |
+
<h2 class="text-lg font-semibold text-gray-800 mb-4">Quick Stats</h2>
|
| 452 |
+
<div class="space-y-3">
|
| 453 |
+
<div class="flex justify-between">
|
| 454 |
+
<span class="text-sm text-gray-600">Calls Today</span>
|
| 455 |
+
<span class="text-sm font-medium">124</span>
|
| 456 |
+
</div>
|
| 457 |
+
<div class="flex justify-between">
|
| 458 |
+
<span class="text-sm text-gray-600">Connect Rate</span>
|
| 459 |
+
<span class="text-sm font-medium">67%</span>
|
| 460 |
+
</div>
|
| 461 |
+
<div class="flex justify-between">
|
| 462 |
+
<span class="text-sm text-gray-600">Avg Talk Time</span>
|
| 463 |
+
<span class="text-sm font-medium">2:34</span>
|
| 464 |
+
</div>
|
| 465 |
+
<div class="flex justify-between">
|
| 466 |
+
<span class="text-sm text-gray-600">Conversion Rate</span>
|
| 467 |
+
<span class="text-sm font-medium">25%</span>
|
| 468 |
+
</div>
|
| 469 |
+
<div class="flex justify-between">
|
| 470 |
+
<span class="text-sm text-gray-600">DNC Hits</span>
|
| 471 |
+
<span class="text-sm font-medium">3</span>
|
| 472 |
+
</div>
|
| 473 |
+
</div>
|
| 474 |
+
</div>
|
| 475 |
+
</div>
|
| 476 |
+
</div>
|
| 477 |
+
</div>
|
| 478 |
+
</div>
|
| 479 |
+
</div>
|
| 480 |
+
|
| 481 |
+
<!-- Call Modal -->
|
| 482 |
+
<div id="call-modal" class="fixed inset-0 z-50 hidden overflow-y-auto">
|
| 483 |
+
<div class="flex items-center justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0">
|
| 484 |
+
<div class="fixed inset-0 transition-opacity" aria-hidden="true">
|
| 485 |
+
<div class="absolute inset-0 bg-gray-500 opacity-75"></div>
|
| 486 |
+
</div>
|
| 487 |
+
<span class="hidden sm:inline-block sm:align-middle sm:h-screen" aria-hidden="true">​</span>
|
| 488 |
+
<div class="inline-block align-bottom bg-white rounded-lg px-4 pt-5 pb-4 text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-sm sm:w-full sm:p-6">
|
| 489 |
+
<div>
|
| 490 |
+
<div class="mx-auto flex items-center justify-center h-12 w-12 rounded-full bg-green-100">
|
| 491 |
+
<i class="fas fa-phone-alt text-green-600 call-animation"></i>
|
| 492 |
+
</div>
|
| 493 |
+
<div class="mt-3 text-center sm:mt-5">
|
| 494 |
+
<h3 class="text-lg leading-6 font-medium text-gray-900" id="modal-title">Incoming Call</h3>
|
| 495 |
+
<div class="mt-2">
|
| 496 |
+
<p class="text-sm text-gray-500" id="caller-number">+1 (555) 123-4567</p>
|
| 497 |
+
<p class="text-xs text-gray-400 mt-1">John Smith • Acme Corp</p>
|
| 498 |
+
</div>
|
| 499 |
+
</div>
|
| 500 |
+
</div>
|
| 501 |
+
<div class="mt-5 sm:mt-6 grid grid-cols-2 gap-3">
|
| 502 |
+
<button type="button" class="inline-flex justify-center w-full rounded-md border border-transparent shadow-sm px-4 py-2 bg-green-600 text-base font-medium text-white hover:bg-green-700 focus:outline-none sm:text-sm">
|
| 503 |
+
<i class="fas fa-phone mr-2"></i> Answer
|
| 504 |
+
</button>
|
| 505 |
+
<button type="button" class="inline-flex justify-center w-full rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none sm:text-sm">
|
| 506 |
+
<i class="fas fa-phone-slash mr-2"></i> Decline
|
| 507 |
+
</button>
|
| 508 |
+
</div>
|
| 509 |
+
</div>
|
| 510 |
+
</div>
|
| 511 |
+
</div>
|
| 512 |
+
|
| 513 |
+
<script>
|
| 514 |
+
// Initialize data
|
| 515 |
+
let callQueue = [];
|
| 516 |
+
let isPaused = false;
|
| 517 |
+
let agents = [
|
| 518 |
+
{ id: 1, name: "Michael Scott", status: "on-call", avatar: "https://randomuser.me/api/portraits/men/32.jpg", currentCall: "+1 (555) 123-4567", callDuration: "02:34" },
|
| 519 |
+
{ id: 2, name: "Dwight Schrute", status: "ringing", avatar: "https://randomuser.me/api/portraits/men/44.jpg", currentCall: "+1 (555) 987-6543", callDuration: "01:12" },
|
| 520 |
+
{ id: 3, name: "Jim Halpert", status: "on-hold", avatar: "https://randomuser.me/api/portraits/men/22.jpg", currentCall: "+1 (555) 456-7890", callDuration: "00:45" },
|
| 521 |
+
{ id: 4, name: "Pam Beesly", status: "available", avatar: "https://randomuser.me/api/portraits/women/63.jpg", currentCall: null, callDuration: null },
|
| 522 |
+
{ id: 5, name: "Stanley Hudson", status: "available", avatar: "https://randomuser.me/api/portraits/men/12.jpg", currentCall: null, callDuration: null },
|
| 523 |
+
{ id: 6, name: "Phyllis Vance", status: "available", avatar: "https://randomuser.me/api/portraits/women/45.jpg", currentCall: null, callDuration: null },
|
| 524 |
+
{ id: 7, name: "Kevin Malone", status: "break", avatar: "https://randomuser.me/api/portraits/men/65.jpg", currentCall: null, callDuration: null },
|
| 525 |
+
{ id: 8, name: "Angela Martin", status: "break", avatar: "https://randomuser.me/api/portraits/women/33.jpg", currentCall: null, callDuration: null },
|
| 526 |
+
{ id: 9, name: "Oscar Martinez", status: "training", avatar: "https://randomuser.me/api/portraits/men/76.jpg", currentCall: null, callDuration: null },
|
| 527 |
+
{ id: 10, name: "Kelly Kapoor", status: "wrap-up", avatar: "https://randomuser.me/api/portraits/women/22.jpg", currentCall: null, callDuration: null }
|
| 528 |
+
];
|
| 529 |
+
|
| 530 |
+
// DOM Elements
|
| 531 |
+
const csvUpload = document.getElementById('csv-upload');
|
| 532 |
+
const pasteList = document.getElementById('paste-list');
|
| 533 |
+
const queueCount = document.getElementById('queue-count');
|
| 534 |
+
const clearQueueBtn = document.getElementById('clear-queue');
|
| 535 |
+
const startDialerBtn = document.getElementById('start-dialer');
|
| 536 |
+
const pauseDialerBtn = document.getElementById('pause-dialer');
|
| 537 |
+
const callModal = document.getElementById('call-modal');
|
| 538 |
+
|
| 539 |
+
// Event Listeners
|
| 540 |
+
csvUpload.addEventListener('change', handleCSVUpload);
|
| 541 |
+
pasteList.addEventListener('input', autoLoadPasteList);
|
| 542 |
+
clearQueueBtn.addEventListener('click', clearQueue);
|
| 543 |
+
startDialerBtn.addEventListener('click', startAutoDialing);
|
| 544 |
+
pauseDialerBtn.addEventListener('click', togglePauseDialer);
|
| 545 |
+
|
| 546 |
+
// Functions
|
| 547 |
+
function updateQueueCount() {
|
| 548 |
+
const count = callQueue.length;
|
| 549 |
+
queueCount.textContent = `${count} number${count !== 1 ? 's' : ''} in queue`;
|
| 550 |
+
}
|
| 551 |
+
|
| 552 |
+
function handleCSVUpload(event) {
|
| 553 |
+
const file = event.target.files[0];
|
| 554 |
+
if (!file) return;
|
| 555 |
+
|
| 556 |
+
const reader = new FileReader();
|
| 557 |
+
reader.onload = function(e) {
|
| 558 |
+
const content = e.target.result;
|
| 559 |
+
callQueue = content.split('\n')
|
| 560 |
+
.map(line => line.trim())
|
| 561 |
+
.filter(line => line !== '');
|
| 562 |
+
|
| 563 |
+
updateQueueCount();
|
| 564 |
+
showNotification(`Successfully loaded ${callQueue.length} numbers from CSV`);
|
| 565 |
+
};
|
| 566 |
+
reader.readAsText(file);
|
| 567 |
+
}
|
| 568 |
+
|
| 569 |
+
function autoLoadPasteList() {
|
| 570 |
+
const inputText = pasteList.value;
|
| 571 |
+
callQueue = inputText.split('\n')
|
| 572 |
+
.map(line => line.trim())
|
| 573 |
+
.filter(line => line !== '');
|
| 574 |
+
|
| 575 |
+
updateQueueCount();
|
| 576 |
+
}
|
| 577 |
+
|
| 578 |
+
function clearQueue() {
|
| 579 |
+
callQueue = [];
|
| 580 |
+
pasteList.value = '';
|
| 581 |
+
updateQueueCount();
|
| 582 |
+
showNotification('Call queue has been cleared', 'info');
|
| 583 |
+
}
|
| 584 |
+
|
| 585 |
+
function startAutoDialing() {
|
| 586 |
+
if (callQueue.length === 0) {
|
| 587 |
+
showNotification('Please add numbers to the queue first', 'warning');
|
| 588 |
+
return;
|
| 589 |
+
}
|
| 590 |
+
|
| 591 |
+
showNotification('Dialer started successfully', 'success');
|
| 592 |
+
isPaused = false;
|
| 593 |
+
startDialerBtn.disabled = true;
|
| 594 |
+
pauseDialerBtn.disabled = false;
|
| 595 |
+
|
| 596 |
+
// Simulate calls
|
| 597 |
+
simulateCalls();
|
| 598 |
+
}
|
| 599 |
+
|
| 600 |
+
function togglePauseDialer() {
|
| 601 |
+
isPaused = !isPaused;
|
| 602 |
+
if (isPaused) {
|
| 603 |
+
pauseDialerBtn.innerHTML = '<i class="fas fa-play mr-2"></i> Resume';
|
| 604 |
+
showNotification('Dialer paused', 'info');
|
| 605 |
+
} else {
|
| 606 |
+
pauseDialerBtn.innerHTML = '<i class="fas fa-pause mr-2"></i> Pause';
|
| 607 |
+
showNotification('Dialer resumed', 'success');
|
| 608 |
+
simulateCalls();
|
| 609 |
+
}
|
| 610 |
+
}
|
| 611 |
+
|
| 612 |
+
function simulateCalls() {
|
| 613 |
+
if (isPaused || callQueue.length === 0) return;
|
| 614 |
+
|
| 615 |
+
// Find available agents
|
| 616 |
+
const availableAgents = agents.filter(agent => agent.status === 'available');
|
| 617 |
+
if (availableAgents.length === 0) {
|
| 618 |
+
setTimeout(simulateCalls, 2000);
|
| 619 |
+
return;
|
| 620 |
+
}
|
| 621 |
+
|
| 622 |
+
// Assign calls to available agents
|
| 623 |
+
availableAgents.slice(0, Math.min(availableAgents.length, callQueue.length)).forEach(agent => {
|
| 624 |
+
if (callQueue.length === 0) return;
|
| 625 |
+
|
| 626 |
+
const number = callQueue.shift();
|
| 627 |
+
updateQueueCount();
|
| 628 |
+
|
| 629 |
+
// Update agent status
|
| 630 |
+
agent.status = 'ringing';
|
| 631 |
+
agent.currentCall = number;
|
| 632 |
+
agent.callDuration = '00:00';
|
| 633 |
+
|
| 634 |
+
// Show call modal (simulated)
|
| 635 |
+
showCallModal(number);
|
| 636 |
+
|
| 637 |
+
// Simulate call progress
|
| 638 |
+
setTimeout(() => {
|
| 639 |
+
agent.status = 'on-call';
|
| 640 |
+
updateAgentUI(agent);
|
| 641 |
+
|
| 642 |
+
// Simulate call ending
|
| 643 |
+
const callDuration = Math.floor(Math.random() * 120) + 30; // 30-150 seconds
|
| 644 |
+
setTimeout(() => {
|
| 645 |
+
agent.status = 'wrap-up';
|
| 646 |
+
agent.callDuration = null;
|
| 647 |
+
updateAgentUI(agent);
|
| 648 |
+
|
| 649 |
+
// Return to available after wrap-up
|
| 650 |
+
setTimeout(() => {
|
| 651 |
+
agent.status = 'available';
|
| 652 |
+
agent.currentCall = null;
|
| 653 |
+
updateAgentUI(agent);
|
| 654 |
+
simulateCalls();
|
| 655 |
+
}, 5000);
|
| 656 |
+
}, callDuration * 1000);
|
| 657 |
+
}, 3000);
|
| 658 |
+
});
|
| 659 |
+
|
| 660 |
+
// Continue with next batch
|
| 661 |
+
setTimeout(simulateCalls, 2000);
|
| 662 |
+
}
|
| 663 |
+
|
| 664 |
+
function updateAgentUI(agent) {
|
| 665 |
+
// In a real app, this would update the specific agent card in the UI
|
| 666 |
+
console.log(`Agent ${agent.name} status updated to ${agent.status}`);
|
| 667 |
+
}
|
| 668 |
+
|
| 669 |
+
function showCallModal(number) {
|
| 670 |
+
document.getElementById('caller-number').textContent = number;
|
| 671 |
+
callModal.classList.remove('hidden');
|
| 672 |
+
|
| 673 |
+
// Auto-close after 10 seconds if not answered
|
| 674 |
+
setTimeout(() => {
|
| 675 |
+
if (!callModal.classList.contains('hidden')) {
|
| 676 |
+
callModal.classList.add('hidden');
|
| 677 |
+
}
|
| 678 |
+
}, 10000);
|
| 679 |
+
}
|
| 680 |
+
|
| 681 |
+
function showNotification(message, type = 'success') {
|
| 682 |
+
// In a real app, this would show a toast notification
|
| 683 |
+
console.log(`Notification (${type}): ${message}`);
|
| 684 |
+
}
|
| 685 |
+
|
| 686 |
+
// Initialize
|
| 687 |
+
updateQueueCount();
|
| 688 |
+
|
| 689 |
+
// Close modal when clicking outside
|
| 690 |
+
window.addEventListener('click', (event) => {
|
| 691 |
+
if (event.target === callModal) {
|
| 692 |
+
callModal.classList.add('hidden');
|
| 693 |
+
}
|
| 694 |
+
});
|
| 695 |
+
|
| 696 |
+
// Handle next action dropdown
|
| 697 |
+
document.querySelector('select').addEventListener('change', function() {
|
| 698 |
+
const callbackContainer = document.getElementById('callback-container');
|
| 699 |
+
if (this.value === 'Schedule Call Back') {
|
| 700 |
+
callbackContainer.classList.remove('hidden');
|
| 701 |
+
} else {
|
| 702 |
+
callbackContainer.classList.add('hidden');
|
| 703 |
+
}
|
| 704 |
+
});
|
| 705 |
+
</script>
|
| 706 |
+
</body>
|
| 707 |
+
</html>
|