diff --git a/modules/openstack_project/files/zuul/status.html b/modules/openstack_project/files/zuul/status.html index f7bcfb1edb..cf60bf9e72 100644 --- a/modules/openstack_project/files/zuul/status.html +++ b/modules/openstack_project/files/zuul/status.html @@ -43,6 +43,7 @@ Zuul Status + diff --git a/modules/openstack_project/files/zuul/status.js b/modules/openstack_project/files/zuul/status.js index 2d11533fab..2d6479ebae 100644 --- a/modules/openstack_project/files/zuul/status.js +++ b/modules/openstack_project/files/zuul/status.js @@ -12,6 +12,8 @@ // License for the specific language governing permissions and limitations // under the License. +window.zuul_enable_status_updates = true; + function format_pipeline(data) { var html = '

'+ data['name']+'

'; @@ -90,6 +92,11 @@ function format_change(change) { function update() { var html = ''; + if (!window.zuul_enable_status_updates) { + setTimeout(update, 5000); + return; + } + $.getJSON('http://zuul.openstack.org/status.json', function(data) { if ('message' in data) { $("#message-container").attr('class', 'topMessage'); @@ -113,4 +120,14 @@ function update() { $(function() { update(); + + $(document).on({ + 'show.visibility': function() { + window.zuul_enable_status_updates = true; + }, + 'hide.visibility': function() { + window.zuul_enable_status_updates = false; + } + }); + }); diff --git a/modules/openstack_project/manifests/zuul.pp b/modules/openstack_project/manifests/zuul.pp index b7d3777ceb..5689594361 100644 --- a/modules/openstack_project/manifests/zuul.pp +++ b/modules/openstack_project/manifests/zuul.pp @@ -80,7 +80,8 @@ class openstack_project::zuul( file { '/var/lib/zuul/www/jquery.min.js': ensure => link, target => '/usr/share/javascript/jquery/jquery.min.js', - require => Package['libjs-jquery'], + require => [File['/var/lib/zuul/www'], + Package['libjs-jquery']], } file { '/var/lib/zuul/www/status.js': @@ -88,4 +89,17 @@ class openstack_project::zuul( source => 'puppet:///modules/openstack_project/zuul/status.js', require => File['/var/lib/zuul/www'], } + + vcsrepo { '/opt/jquery-visibility': + ensure => latest, + provider => git, + revision => 'master', + source => 'https://github.com/mathiasbynens/jquery-visibility.git', + } + + file { '/var/lib/zuul/www/jquery-visibility.min.js': + ensure => link, + target => '/opt/jquery-visibility/jquery-visibility.min.js', + require => File['/var/lib/zuul/www'], + } }