Sha256: ee3766ed9d8ec8f538d100f27d133a5eb9ad8defa5b5049233e416bbae776ac7
Contents?: true
Size: 1.5 KB
Versions: 18
Compression:
Stored size: 1.5 KB
Contents
(function($) { var REFRESH_SERVICES_TIMEOUT = 5000; $.ajaxSetup({ error: function(e, req, options, error) { $('#url').text(settings.url); $('#error').show(); } }); var needRefreshServices; var refreshServices = function() { refreshServices.timer = null; $.ajax({ url: '/services', cache: false }).error(function() { $('#url').text('/services'); $('#error').show(); }).success(function(html) { $('#error').hide(); $('#services').html(html); }).complete(function() { needRefreshServices(false); }); }; needRefreshServices = function(now) { if (refreshServices.timer != null) { clearTimeout(refreshServices.timer); refreshServices.timer = null; } if (now) { refreshServices(); } else { refreshServices.timer = setTimeout(refreshServices, REFRESH_SERVICES_TIMEOUT); } }; $('#services').delegate('form.service-action,form.service-signal', 'submit', function(e) { e.preventDefault(); $.post($(this).attr('action')).complete(function() { needRefreshServices(true); }); return false; }); $('#service-refresh-interval').text(REFRESH_SERVICES_TIMEOUT / 1000); needRefreshServices(true); })(jQuery);
Version data entries
18 entries across 18 versions & 1 rubygems