Registrations: Manually pause refresh, and pause on button hover. Requested in Issue 922.

This commit is contained in:
Nate Jones 2015-04-16 20:02:04 +00:00
parent f7b687c94e
commit 483745cf98
5 changed files with 87 additions and 48 deletions

View File

@ -21,6 +21,20 @@ $text['label-response']['fr-fr'] = "Réponse:";
$text['label-response']['pt-br'] = "Resposta"; $text['label-response']['pt-br'] = "Resposta";
$text['label-response']['pl'] = "Odpowiedź"; $text['label-response']['pl'] = "Odpowiedź";
$text['label-refresh_pause']['en-us'] = "Pause Refresh";
$text['label-refresh_pause']['es-cl'] = "Actualizar Pausa";
$text['label-refresh_pause']['pt-pt'] = "Pausa Atualizar";
$text['label-refresh_pause']['fr-fr'] = "Pause Actualiser";
$text['label-refresh_pause']['pt-br'] = "Pausar atualização";
$text['label-refresh_pause']['pl'] = "Pauzuj odÅwieżanie";
$text['label-refresh_enable']['en-us'] = "Enable Refresh";
$text['label-refresh_enable']['es-cl'] = "Activar Actualizar";
$text['label-refresh_enable']['pt-pt'] = "Habilitar Atualização";
$text['label-refresh_enable']['fr-fr'] = "Activer Actualiser";
$text['label-refresh_enable']['pt-br'] = "Habilitar atualização";
$text['label-refresh_enable']['pl'] = "Ä…cz odÅwieżanie";
$text['label-port']['en-us'] = "Port"; $text['label-port']['en-us'] = "Port";
$text['label-port']['es-cl'] = "Puerto"; $text['label-port']['es-cl'] = "Puerto";
$text['label-port']['pt-pt'] = "Porto"; $text['label-port']['pt-pt'] = "Porto";

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 501 B

View File

@ -52,6 +52,10 @@ require_once "resources/check_auth.php";
//ajax for refresh //ajax for refresh
?> ?>
<script type="text/javascript"> <script type="text/javascript">
var refresh = 1500;
var source_url = 'status_registrations_inc.php?profile=<?php echo $profile; ?>&show=<?php echo $show; ?>';
var interval_timer_id;
function loadXmlHttp(url, id) { function loadXmlHttp(url, id) {
var f = this; var f = this;
f.xmlHttp = null; f.xmlHttp = null;
@ -87,9 +91,9 @@ require_once "resources/check_auth.php";
} }
var requestTime = function() { var requestTime = function() {
var url = 'status_registrations_inc.php?profile=<?php echo $profile; ?>&show=<?php echo $show; ?>'; var url = source_url;
new loadXmlHttp(url, 'ajax_reponse'); new loadXmlHttp(url, 'ajax_reponse');
setInterval(function(){new loadXmlHttp(url, 'ajax_reponse');}, 1500); refresh_start();
} }
if (window.addEventListener) { if (window.addEventListener) {
@ -101,6 +105,21 @@ require_once "resources/check_auth.php";
var record_count = 0; var record_count = 0;
var destination; var destination;
//refresh controls
function refresh_stop() {
clearInterval(interval_timer_id);
document.getElementById('refresh_state').innerHTML = "<img src='resources/images/refresh_paused.png' style='width: 16px; height: 16px; border: none; margin-top: 1px; cursor: pointer;' onclick='refresh_start();' alt=\"<?php echo $text['label-refresh_enable']?>\" title=\"<?php echo $text['label-refresh_enable']?>\">";
}
function refresh_start() {
if (document.getElementById('refresh_state')) { document.getElementById('refresh_state').innerHTML = "<img src='resources/images/refresh_active.gif' style='width: 16px; height: 16px; border: none; margin-top: 3px; cursor: pointer;' alt=\"<?php echo $text['label-refresh_pause']?>\" title=\"<?php echo $text['label-refresh_pause']?>\">"; }
interval_timer_id = setInterval( function() {
url = source_url;
new loadXmlHttp(url, 'ajax_reponse');
}, refresh);
}
</script> </script>
<?php <?php

View File

@ -56,6 +56,9 @@ require_once "resources/check_auth.php";
$msg = "<div align='center'>".$text['error-event-socket']."<br /></div>"; $msg = "<div align='center'>".$text['error-event-socket']."<br /></div>";
} }
//define js function call var
$onhover_pause_refresh = " onmouseover='refresh_stop();' onmouseout='refresh_start();'";
//show the error message or show the content //show the error message or show the content
if (strlen($msg) > 0) { if (strlen($msg) > 0) {
echo "<div align='center'>\n"; echo "<div align='center'>\n";
@ -120,16 +123,19 @@ require_once "resources/check_auth.php";
//show the registrations //show the registrations
echo "<table width='100%' border='0' cellspacing='0' cellpadding='5'>\n"; echo "<table width='100%' border='0' cellspacing='0' cellpadding='5'>\n";
echo "<tr>\n"; echo "<tr>\n";
echo "<td colspan='5'>\n"; echo "<td width='100%'>\n";
echo " <b>".$text['header-registrations'].": ".count($registrations)."</b>\n"; echo " <b>".$text['header-registrations'].": ".count($registrations)."</b>\n";
echo "</td>\n"; echo "</td>\n";
echo "<td align='right'>\n"; echo "<td valign='middle' nowrap='nowrap' style='padding-right: 15px' id='refresh_state'>";
echo " <img src='resources/images/refresh_active.gif' style='width: 16px; height: 16px; border: none; margin-top: 3px; cursor: pointer;' onclick='refresh_stop();' alt=\"".$text['label-refresh_pause']."\" title=\"".$text['label-refresh_pause']."\">";
echo "</td>";
echo "<td valign='top' nowrap='nowrap'>";
if (permission_exists('registration_all')) { if (permission_exists('registration_all')) {
if ($show == "all") { if ($show == "all") {
echo " <input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"window.location='status_registrations.php?show_reg=1&profile=$sip_profile_name'\" value='".$text['button-back']."'>\n"; echo " <input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"window.location='status_registrations.php?show_reg=1&profile=$sip_profile_name'\" value='".$text['button-back']."' ".$onhover_pause_refresh.">\n";
} }
else { else {
echo " <input type='button' class='btn' name='' alt='".$text['button-show_all']."' onclick=\"window.location='status_registrations.php?show_reg=1&profile=$sip_profile_name&show=all'\" value='".$text['button-show_all']."'>\n"; echo " <input type='button' class='btn' name='' alt='".$text['button-show_all']."' onclick=\"window.location='status_registrations.php?show_reg=1&profile=$sip_profile_name&show=all'\" value='".$text['button-show_all']."' ".$onhover_pause_refresh.">\n";
} }
} }
echo "</td>\n"; echo "</td>\n";
@ -168,9 +174,9 @@ require_once "resources/check_auth.php";
echo " <td class='".$row_style[$c]."'>".$row['host']."&nbsp;</td>\n"; echo " <td class='".$row_style[$c]."'>".$row['host']."&nbsp;</td>\n";
echo " <td class='".$row_style[$c]."'>".$row['status']."&nbsp;</td>\n"; echo " <td class='".$row_style[$c]."'>".$row['status']."&nbsp;</td>\n";
echo " <td class='".$row_style[$c]."' style='text-align: right;' nowrap='nowrap'>\n"; echo " <td class='".$row_style[$c]."' style='text-align: right;' nowrap='nowrap'>\n";
echo " <input type='button' class='btn' value='".$text['button-unregister']."' onclick=\"document.location.href='cmd.php?cmd=unregister&profile=".$sip_profile_name."&show=".$show."&user=".$row['user']."&domain=".$row['sip-auth-realm']."&agent=".urlencode($row['agent'])."';\" />\n"; echo " <input type='button' class='btn' value='".$text['button-unregister']."' onclick=\"document.location.href='cmd.php?cmd=unregister&profile=".$sip_profile_name."&show=".$show."&user=".$row['user']."&domain=".$row['sip-auth-realm']."&agent=".urlencode($row['agent'])."';\" ".$onhover_pause_refresh.">\n";
echo " <input type='button' class='btn' value='".$text['button-provision']."' onclick=\"document.location.href='cmd.php?cmd=check_sync&profile=".$sip_profile_name."&show=".$show."&user=".$row['user']."&domain=".$row['sip-auth-realm']."&agent=".urlencode($row['agent'])."';\" />\n"; echo " <input type='button' class='btn' value='".$text['button-provision']."' onclick=\"document.location.href='cmd.php?cmd=check_sync&profile=".$sip_profile_name."&show=".$show."&user=".$row['user']."&domain=".$row['sip-auth-realm']."&agent=".urlencode($row['agent'])."';\" ".$onhover_pause_refresh.">\n";
echo " <input type='button' class='btn' value='".$text['button-reboot']."' onclick=\"document.location.href='cmd.php?cmd=reboot&profile=".$sip_profile_name."&show=".$show."&user=".$row['user']."&domain=".$row['sip-auth-realm']."&agent=".urlencode($row['agent'])."';\" onclick=\"\" />\n"; echo " <input type='button' class='btn' value='".$text['button-reboot']."' onclick=\"document.location.href='cmd.php?cmd=reboot&profile=".$sip_profile_name."&show=".$show."&user=".$row['user']."&domain=".$row['sip-auth-realm']."&agent=".urlencode($row['agent'])."';\" ".$onhover_pause_refresh.">\n";
echo " </td>\n"; echo " </td>\n";
echo "</tr>\n"; echo "</tr>\n";
if ($c==0) { $c=1; } else { $c=0; } if ($c==0) { $c=1; } else { $c=0; }