Merge pull request #158 from WDKevin/modern

Checks for updates every 5 minutes and notifies the user when there is one
This commit is contained in:
Kyle Johnson 2013-09-20 08:25:52 -07:00
commit c38a666301
3 changed files with 20 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,16 @@
$(document).ready(function() {
// Version Polling //
setTimeout(function() {
$.post('/Version/isUpdateAvailable', function(data) {
if (data === 'true') {
$('#version').append(' - An update is available!');
$('#version span.label').removeClass('label-success').addClass('label-danger');
}
});
}, 300000);
// Version Polling //
// Logs //
$("#LogsComponent").change(function(){
if (!!$(this).val()) {