Sha256: 35d263e03620a08f91c6e2992a011e8e90db9c054d1cd098a85b6b0393ba3a60
Contents?: true
Size: 1.59 KB
Versions: 2
Compression:
Stored size: 1.59 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', 'submit', function() { $.post($(this).attr('action'), function(data) { needRefreshServices(true); }); return false; }); $('#service-refresh-interval').text(REFRESH_SERVICES_TIMEOUT / 1000); needRefreshServices(true); })(jQuery);
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
runit-man-1.7.4 | public/js/runit-man.js |
runit-man-1.7.3 | public/js/runit-man.js |