update with changes from Production branch

This commit is contained in:
Lee Lawlor
2014-02-17 12:05:39 -05:00
parent 5b640cf9d8
commit a4937fb2e5
384 changed files with 14690 additions and 2242 deletions

BIN
public/resque/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
public/resque/idle.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 661 B

19
public/resque/jquery-1.3.2.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,95 @@
// All credit goes to Rick Olson.
(function($) {
$.fn.relatizeDate = function() {
return $(this).each(function() {
if ($(this).hasClass( 'relatized' )) return
$(this).text( $.relatizeDate(this) ).addClass( 'relatized' )
})
}
$.relatizeDate = function(element) {
return $.relatizeDate.timeAgoInWords( new Date($(element).text()) )
}
// shortcut
$r = $.relatizeDate
$.extend($.relatizeDate, {
shortDays: [ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat' ],
days: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
shortMonths: [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ],
months: [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ],
/**
* Given a formatted string, replace the necessary items and return.
* Example: Time.now().strftime("%B %d, %Y") => February 11, 2008
* @param {String} format The formatted string used to format the results
*/
strftime: function(date, format) {
var day = date.getDay(), month = date.getMonth();
var hours = date.getHours(), minutes = date.getMinutes();
var pad = function(num) {
var string = num.toString(10);
return new Array((2 - string.length) + 1).join('0') + string
};
return format.replace(/\%([aAbBcdHImMpSwyY])/g, function(part) {
switch(part[1]) {
case 'a': return $r.shortDays[day]; break;
case 'A': return $r.days[day]; break;
case 'b': return $r.shortMonths[month]; break;
case 'B': return $r.months[month]; break;
case 'c': return date.toString(); break;
case 'd': return pad(date.getDate()); break;
case 'H': return pad(hours); break;
case 'I': return pad((hours + 12) % 12); break;
case 'm': return pad(month + 1); break;
case 'M': return pad(minutes); break;
case 'p': return hours > 12 ? 'PM' : 'AM'; break;
case 'S': return pad(date.getSeconds()); break;
case 'w': return day; break;
case 'y': return pad(date.getFullYear() % 100); break;
case 'Y': return date.getFullYear().toString(); break;
}
})
},
timeAgoInWords: function(targetDate, includeTime) {
return $r.distanceOfTimeInWords(targetDate, new Date(), includeTime);
},
/**
* Return the distance of time in words between two Date's
* Example: '5 days ago', 'about an hour ago'
* @param {Date} fromTime The start date to use in the calculation
* @param {Date} toTime The end date to use in the calculation
* @param {Boolean} Include the time in the output
*/
distanceOfTimeInWords: function(fromTime, toTime, includeTime) {
var delta = parseInt((toTime.getTime() - fromTime.getTime()) / 1000, 10);
if (delta < 60) {
return 'just now';
} else if (delta < 120) {
return 'about a minute ago';
} else if (delta < (45*60)) {
return (parseInt(delta / 60, 10)).toString() + ' minutes ago';
} else if (delta < (120*60)) {
return 'about an hour ago';
} else if (delta < (24*60*60)) {
return 'about ' + (parseInt(delta / 3600, 10)).toString() + ' hours ago';
} else if (delta < (48*60*60)) {
return '1 day ago';
} else {
var days = (parseInt(delta / 86400, 10)).toString();
if (days > 5) {
var fmt = '%B %d, %Y'
if (includeTime) fmt += ' %I:%M %p'
return $r.strftime(fromTime, fmt);
} else {
return days + " days ago"
}
}
}
})
})(jQuery);

BIN
public/resque/poll.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 627 B

78
public/resque/ranger.js Normal file
View File

@ -0,0 +1,78 @@
$(function() {
var poll_interval = 2
var relatizer = function(){
var dt = $(this).text(), relatized = $.relatizeDate(this)
if ($(this).parents("a").length > 0 || $(this).is("a")) {
$(this).relatizeDate()
if (!$(this).attr('title')) {
$(this).attr('title', dt)
}
} else {
$(this)
.text('')
.append( $('<a href="#" class="toggle_format" title="' + dt + '" />')
.append('<span class="date_time">' + dt +
'</span><span class="relatized_time">' +
relatized + '</span>') )
}
};
$('.time').each(relatizer);
$('.time a.toggle_format .date_time').hide()
var format_toggler = function(){
$('.time a.toggle_format span').toggle()
$(this).attr('title', $('span:hidden',this).text())
return false
};
$('.time a.toggle_format').click(format_toggler);
$('.backtrace').click(function() {
$(this).next().toggle()
return false
})
$('a[rel=poll]').click(function() {
var href = $(this).attr('href')
$(this).parent().text('Starting...')
$("#main").addClass('polling')
setInterval(function() {
$.ajax({dataType: 'text', type: 'get', url: href,
success: function(data) {
$('#main').html(data)
$('#main .time').relatizeDate()
},
error: function(data) {
if (data.status == '401') { window.location.href = '/' }
}
})
}, poll_interval * 1000)
return false
})
$('ul.failed li').hover(function() {
$(this).addClass('hover');
}, function() {
$(this).removeClass('hover');
})
$('ul.failed a[rel=retry]').click(function() {
var href = $(this).attr('href');
$(this).text('Retrying...');
var parent = $(this).parent();
$.ajax({dataType: 'text', type: 'get', url: href, success: function(data) {
parent.html('Retried <b><span class="time">' + data + '</span></b>');
relatizer.apply($('.time', parent));
$('.date_time', parent).hide();
$('a.toggle_format span', parent).click(format_toggler);
}});
return false;
})
})

44
public/resque/reset.css Normal file
View File

@ -0,0 +1,44 @@
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
dl, dt, dd, ul, li,
form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
margin: 0;
padding: 0;
border: 0;
outline: 0;
font-weight: inherit;
font-style: normal;
font-size: 100%;
font-family: inherit;
}
body {
line-height: 1;
}
ul {
list-style: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
caption, th, td {
text-align: left;
font-weight: normal;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: "";
}
blockquote, q {
quotes: "" "";
}

91
public/resque/style.css Normal file
View File

@ -0,0 +1,91 @@
html { background:#efefef; font-family:Arial, Verdana, sans-serif; font-size:13px; }
body { padding:0; margin:0; }
.header { background:#000; padding:8px 5% 0 5%; border-bottom:1px solid #444;border-bottom:5px solid #ce1212;}
.header h1 { color:#333; font-size:90%; font-weight:bold; margin-bottom:6px;}
.header ul li { display:inline;}
.header ul li a { color:#fff; text-decoration:none; margin-right:10px; display:inline-block; padding:8px; -webkit-border-top-right-radius:6px; -webkit-border-top-left-radius:6px; -moz-border-radius-topleft:6px; -moz-border-radius-topright:6px; }
.header ul li a:hover { background:#333;}
.header ul li.current a { background:#ce1212; font-weight:bold; color:#fff;}
.header .namespace { position: absolute; right: 75px; top: 10px; color: #7A7A7A; }
.subnav { padding:2px 5% 7px 5%; background:#ce1212; font-size:90%;}
.subnav li { display:inline;}
.subnav li a { color:#fff; text-decoration:none; margin-right:10px; display:inline-block; background:#dd5b5b; padding:5px; -webkit-border-radius:3px; -moz-border-radius:3px;}
.subnav li.current a { background:#fff; font-weight:bold; color:#ce1212;}
.subnav li a:active { background:#b00909;}
#main { padding:10px 5%; background:#fff; overflow:hidden; }
#main .logo { float:right; margin:10px;}
#main span.hl { background:#efefef; padding:2px;}
#main h1 { margin:10px 0; font-size:190%; font-weight:bold; color:#ce1212;}
#main h2 { margin:10px 0; font-size:130%;}
#main table { width:100%; margin:10px 0;}
#main table tr td, #main table tr th { border:1px solid #ccc; padding:6px;}
#main table tr th { background:#efefef; color:#888; font-size:15px; font-weight:bold;}
#main table tr td.no-data { text-align:center; padding:40px 0; color:#999; font-style:italic; font-size:130%;}
#main a { color:#111;}
#main p { margin:5px 0;}
#main p.intro { margin-bottom:15px; font-size:85%; color:#999; margin-top:0; line-height:1.3;}
#main h1.wi { margin-bottom:5px;}
#main p.sub { font-size:95%; color:#999;}
#main table.queues { width:40%;}
#main table.queues td.queue { font-weight:bold; width:50%;}
#main table.queues tr.failure td { background:#ffecec; font-size:90%; color:#d37474;}
#main table.queues tr.failure td a{ color:#d37474;}
#main table.queues tr.first_failure td { border-top:2px solid #d37474; }
#main table.jobs td.class { font-family:Monaco, "Courier New", monospace; font-size:90%; width:50%;}
#main table.jobs td.args{ width:50%;}
#main table.workers td.icon {width:1%; background:#efefef;text-align:center;}
#main table.workers td.icon img { height: 16px; width: 16px; }
#main table.workers td.where { width:25%;}
#main table.workers td.queues { width:35%;}
#main .queue-tag { background:#b1d2e9; padding:2px; margin:0 3px; font-size:80%; text-decoration:none; text-transform:uppercase; font-weight:bold; color:#3274a2; -webkit-border-radius:4px; -moz-border-radius:4px;}
#main .queue-tag a { color: #3274A2; text-decoration: none; }
#main table.workers td.queues.queue { width:10%;}
#main table.workers td.process { width:35%;}
#main table.workers td.process span.waiting { color:#999; font-size:90%;}
#main table.workers td.process small { font-size:80%; margin-left:5px;}
#main table.workers td.process code { font-family:Monaco, "Courier New", monospace; font-size:90%;}
#main table.workers td.process small a { color:#999;}
#main.polling table.workers tr.working td { background:#f4ffe4; color:#7ac312;}
#main.polling table.workers tr.working td.where a { color:#7ac312;}
#main.polling table.workers tr.working td.process code { font-weight:bold;}
#main table.stats th { font-size:100%; width:40%; color:#000;}
#main hr { border:0; border-top:5px solid #efefef; margin:15px 0;}
#footer { padding:10px 5%; background:#efefef; color:#999; font-size:85%; line-height:1.5; border-top:5px solid #ccc; padding-top:10px;}
#footer p a { color:#999;}
#main p.poll { background:url(poll.png) no-repeat 0 2px; padding:3px 0; padding-left:23px; float:right; font-size:85%; }
#main ul.failed {}
#main ul.failed li {background:-webkit-gradient(linear, left top, left bottom, from(#efefef), to(#fff)) #efefef; margin-top:10px; padding:10px; overflow:hidden; -webkit-border-radius:5px; border:1px solid #ccc; }
#main ul.failed li dl dt {font-size:80%; color:#999; width:60px; float:left; padding-top:1px; text-align:right;}
#main ul.failed li dl dd {margin-bottom:10px; margin-left:70px;}
#main ul.failed li dl dd .retried { float:right; text-align: right; }
#main ul.failed li dl dd .retried .remove { display:none; margin-top: 8px; }
#main ul.failed li.hover dl dd .retried .remove { display:block; }
#main ul.failed li dl dd .controls { display:none; float:right; }
#main ul.failed li.hover dl dd .controls { display:block; }
#main ul.failed li dl dd code, #main ul.failed li dl dd pre { font-family:Monaco, "Courier New", monospace; font-size:90%; white-space: pre-wrap;}
#main ul.failed li dl dd.error a {font-family:Monaco, "Courier New", monospace; font-size:90%; }
#main ul.failed li dl dd.error pre { margin-top:3px; line-height:1.3;}
#main p.pagination { background:#efefef; padding:10px; overflow:hidden; text-align:center}
#main p.pagination a.less { float:left;}
#main p.pagination a.more { float:right;}
#main form {float:right; margin-top:-10px;margin-left:10px;}
#main .time a.toggle_format {text-decoration:none;}
#failed tr.total td {background-color: #FFECEC; color: #D37474; font-size: 15px; font-weight: bold;}
#failed .center {text-align: center;}
#failed .failed_class { padding-left: 20px; font-size:12px; }

BIN
public/resque/working.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 792 B