Subversion Repositories SmartDukaan

Rev

Rev 35994 | Rev 36086 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 35994 Rev 36057
Line 231... Line 231...
231
                        #elseif($agentStatus.getAgentStatus() == "Available")
231
                        #elseif($agentStatus.getAgentStatus() == "Available")
232
                            <span class="badge"
232
                            <span class="badge"
233
                                  style="background-color: #dc3545; color: white;">$agentStatus.getAgentStatus()</span>
233
                                  style="background-color: #dc3545; color: white;">$agentStatus.getAgentStatus()</span>
234
                        #elseif($agentStatus.getAgentStatus().toLowerCase().contains("break"))
234
                        #elseif($agentStatus.getAgentStatus().toLowerCase().contains("break"))
235
                            <span class="badge"
235
                            <span class="badge"
236
                                  style="background-color: #dc3545; color: white;">$agentStatus.getAgentStatus()</span>
236
                                  style="background-color: #fd7e14; color: white;">$agentStatus.getAgentStatus()</span>
237
                        #elseif($agentStatus.getAgentStatus() == "Logged Out")
237
                        #elseif($agentStatus.getAgentStatus() == "Logged Out")
-
 
238
                            <span class="badge"
238
                            <span class="badge" style="background-color: #dc3545; color: white;">$agentStatus.getAgentStatus()</span>
239
                                  style="background-color: #6c757d; color: white;">$agentStatus.getAgentStatus()</span>
239
                        #elseif($agentStatus.getAgentStatus() == "Trying")
240
                        #elseif($agentStatus.getAgentStatus() == "Trying")
-
 
241
                            <span class="badge"
240
                            <span class="badge" style="background-color: #fd7e14; color: white;">$agentStatus.getAgentStatus()</span>
242
                                  style="background-color: #ffc107; color: black;">$agentStatus.getAgentStatus()</span>
241
                        #else
243
                        #else
242
                            <span class="badge" style="background-color: #6c757d; color: white;">$agentStatus.getAgentStatus()</span>
244
                            <span class="badge" style="background-color: #6c757d; color: white;">$agentStatus.getAgentStatus()</span>
243
                        #end
245
                        #end
244
                    #else
246
                    #else
245
                        <span class="badge" style="background-color: #6c757d; color: white;">-</span>
247
                        <span class="badge" style="background-color: #6c757d; color: white;">-</span>
Line 636... Line 638...
636
        if (status === 'On Call') {
638
        if (status === 'On Call') {
637
            bgColor = '#28a745';
639
            bgColor = '#28a745';
638
        } else if (status === 'Available') {
640
        } else if (status === 'Available') {
639
            bgColor = '#dc3545';
641
            bgColor = '#dc3545';
640
        } else if (lowerStatus.indexOf('break') !== -1) {
642
        } else if (lowerStatus.indexOf('break') !== -1) {
641
            bgColor = '#dc3545';
643
            bgColor = '#fd7e14';  // Orange for break
642
        } else if (status === 'Logged Out') {
644
        } else if (status === 'Logged Out') {
643
            bgColor = '#dc3545';
645
            bgColor = '#6c757d';  // Grey for logged out
644
        } else if (status === 'Trying') {
646
        } else if (status === 'Trying') {
-
 
647
            bgColor = '#ffc107';  // Yellow for trying
645
            bgColor = '#fd7e14';
648
            textColor = 'black';
646
        }
649
        }
647
 
650
 
648
        return '<span class="badge" style="background-color: ' + bgColor + '; color: ' + textColor + ';">' + status + '</span>';
651
        return '<span class="badge" style="background-color: ' + bgColor + '; color: ' + textColor + ';">' + status + '</span>';
649
    }
652
    }
650
 
653
 
651
    // Refresh every 20 seconds
654
    // Refresh every 10 seconds
652
    setInterval(refreshAgentStatus, 20000);
655
    setInterval(refreshAgentStatus, 10000);
653
 
656
 
654
    // Initial refresh after page load
657
    // Initial refresh after page load
655
    setTimeout(refreshAgentStatus, 2000);
658
    setTimeout(refreshAgentStatus, 2000);
656
 
659
 
657
    // Download All Call Data by Date
660
    // Download All Call Data by Date