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:
commit
c38a666301
|
@ -6,5 +6,13 @@ class VersionController extends AppController {
|
||||||
$this->set('zmDynDBVersion', Configure::read('ZM_DYN_DB_VERSION'));
|
$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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -82,7 +82,7 @@ $cakeDescription = __d('cake_dev', 'CakePHP: the rapid development php framework
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<p>
|
<p>
|
||||||
Configured for <?php echo $this->Html->link($zmBandwidth, array('controller' => 'Bandwidth', 'action' => 'index')); ?> bandwidth.
|
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>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,5 +1,16 @@
|
||||||
$(document).ready(function() {
|
$(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 //
|
// Logs //
|
||||||
$("#LogsComponent").change(function(){
|
$("#LogsComponent").change(function(){
|
||||||
if (!!$(this).val()) {
|
if (!!$(this).val()) {
|
||||||
|
|
Loading…
Reference in New Issue