Polls the update check every 5 minutes and if an update is available it adds a message beside the version number in the footer. This should fix issue #130

This commit is contained in:
Kevin Crider 2013-09-19 12:50:44 -04:00
parent d9c62d5bbe
commit d78315de50
3 changed files with 19 additions and 1 deletions

View File

@ -6,5 +6,13 @@ class VersionController extends AppController {
$this->set('zmDynDBVersion', Configure::read('ZM_DYN_DB_VERSION'));
}
public function isUpdateAvailable() {
if (Configure::read('ZM_DYN_LAST_VERSION') > Configure::read('ZM_DYN_DB_VERSION')) {
echo 'true';
} else {
echo 'false';
}
die();
}
}
?>

View File

@ -82,7 +82,7 @@ $cakeDescription = __d('cake_dev', 'CakePHP: the rapid development php framework
<div class="container">
<p>
Configured for <?php echo $this->Html->link($zmBandwidth, array('controller' => 'Bandwidth', 'action' => 'index')); ?> bandwidth.
Version <?php echo $this->Html->link($zmVersion, array('controller' => 'Version'), array('escape' => false)); ?>
<span id="version">Version <?php echo $this->Html->link($zmVersion, array('controller' => 'Version'), array('escape' => false)); ?></span>
</p>
</div>
</div>

View File

@ -1,5 +1,15 @@
$(document).ready(function() {
// Version Polling //
setTimeout(function() {
$.post('/Version/isUpdateAvailable', function(data) {
if (data === 'false') {
$('#version').append(' - An update is available!');
}
});
}, 300000);
// Version Polling //
// Logs //
$("#LogsComponent").change(function(){
if (!!$(this).val()) {