1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

Add ajax beacon to dashboard.

This commit is contained in:
Brandon Hilkert 2013-01-02 17:49:12 -05:00
parent 0ae9b5579c
commit ab942628d4
3 changed files with 98 additions and 2 deletions

View file

@ -54,6 +54,7 @@ var realtimeGraph = function(updatePath) {
Sidekiq.failed = data.failed;
updateStatsSummary(data);
pulseBeacon();
});
i++;
}, timeInterval);
@ -114,6 +115,14 @@ var updateStatsSummary = function(data) {
$('ul.summary li.enqueued span.count').html(data.enqueued.numberWithDelimiter())
}
var pulseBeacon = function(){
$beacon = $('.beacon')
$beacon.addClass('pulse').delay(1000).queue(function(){
$(this).removeClass('pulse');
$(this).dequeue();
})
}
Number.prototype.numberWithDelimiter = function(delimiter) {
var number = this + '', delimiter = delimiter || ',';
var split = number.split('.');

View file

@ -268,6 +268,92 @@ img.smallogo {
font-size: 0.9em;
}
.beacon {
width: 10px;
height: 10px;
background-color: #80002d;
display: inline-block;
border-radius: 10px;
margin-left: 10px;
margin-bottom: 5px;
box-shadow: 0 0 9px #666;
-moz-box-shadow: 0 0 9px #666;
-webkit-box-shadow: 0 0 9px #666;
border: 3px solid transparent;
}
.beacon.pulse {
-webkit-animation: beacon-pulse 1s ease-out;
-moz-animation: beacon-pulse 1s ease-out;
animation: beacon-pulse 1s ease-out;
-webkit-animation-iteration-count: 1;
-moz-animation-iteration-count: 1;
animation-iteration-count: 1;
}
@-webkit-keyframes beacon-pulse {
from {
background-color: #80002d;
-webkit-box-shadow: 0 0 9px #666;
-moz-box-shadow: 0 0 9px #666;
box-shadow: 0 0 9px #666;
}
50% {
background-color: #c90047;
-webkit-box-shadow: 0 0 18px #666;
-moz-box-shadow: 0 0 18px #666;
box-shadow: 0 0 18px #666;
}
to {
background-color: #80002d;
-webkit-box-shadow: 0 0 9px #666;
-moz-box-shadow: 0 0 9px #666;
box-shadow: 0 0 9px #666;
}
}
@-moz-keyframes beacon-pulse {
from {
background-color: #80002d;
-webkit-box-shadow: 0 0 9px #666;
-moz-box-shadow: 0 0 9px #666;
box-shadow: 0 0 9px #666;
}
50% {
background-color: #c90047;
-webkit-box-shadow: 0 0 18px #666;
-moz-box-shadow: 0 0 18px #666;
box-shadow: 0 0 18px #666;
}
to {
background-color: #80002d;
-webkit-box-shadow: 0 0 9px #666;
-moz-box-shadow: 0 0 9px #666;
box-shadow: 0 0 9px #666;
}
}
@keyframes beacon-pulse {
from {
background-color: #80002d;
-webkit-box-shadow: 0 0 9px #666;
-moz-box-shadow: 0 0 9px #666;
box-shadow: 0 0 9px #666;
}
50% {
background-color: #c90047;
-webkit-box-shadow: 0 0 18px #666;
-moz-box-shadow: 0 0 18px #666;
box-shadow: 0 0 18px #666;
}
to {
background-color: #80002d;
-webkit-box-shadow: 0 0 9px #666;
-moz-box-shadow: 0 0 9px #666;
box-shadow: 0 0 9px #666;
}
}
.history-heading {
padding-right: 15px;
}
@ -343,7 +429,6 @@ img.smallogo {
}
/* Rickshaw */
.rickshaw_graph .detail {
pointer-events: none;
position: absolute;

View file

@ -1,6 +1,8 @@
script type="text/javascript" src="#{{root_path}}javascripts/dashboard.js"
h3 Dashboard
h3
| Dashboard
span.beacon
h5 Real-time
#realtime