sidekiq 6.2.2 → 6.4.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of sidekiq might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Changes.md +69 -1
- data/LICENSE +3 -3
- data/README.md +3 -3
- data/lib/generators/sidekiq/job_generator.rb +57 -0
- data/lib/generators/sidekiq/templates/{worker.rb.erb → job.rb.erb} +2 -2
- data/lib/generators/sidekiq/templates/{worker_spec.rb.erb → job_spec.rb.erb} +1 -1
- data/lib/generators/sidekiq/templates/{worker_test.rb.erb → job_test.rb.erb} +1 -1
- data/lib/sidekiq/api.rb +7 -4
- data/lib/sidekiq/cli.rb +13 -3
- data/lib/sidekiq/client.rb +5 -39
- data/lib/sidekiq/delay.rb +2 -0
- data/lib/sidekiq/extensions/action_mailer.rb +2 -2
- data/lib/sidekiq/extensions/active_record.rb +2 -2
- data/lib/sidekiq/extensions/class_methods.rb +2 -2
- data/lib/sidekiq/extensions/generic_proxy.rb +2 -2
- data/lib/sidekiq/fetch.rb +4 -3
- data/lib/sidekiq/job.rb +8 -3
- data/lib/sidekiq/job_retry.rb +6 -4
- data/lib/sidekiq/job_util.rb +65 -0
- data/lib/sidekiq/launcher.rb +5 -1
- data/lib/sidekiq/manager.rb +7 -9
- data/lib/sidekiq/middleware/current_attributes.rb +57 -0
- data/lib/sidekiq/rails.rb +11 -0
- data/lib/sidekiq/redis_connection.rb +4 -6
- data/lib/sidekiq/scheduled.rb +44 -15
- data/lib/sidekiq/util.rb +13 -0
- data/lib/sidekiq/version.rb +1 -1
- data/lib/sidekiq/web/application.rb +7 -4
- data/lib/sidekiq/web/helpers.rb +1 -12
- data/lib/sidekiq/worker.rb +127 -7
- data/lib/sidekiq.rb +8 -1
- data/sidekiq.gemspec +1 -1
- data/web/assets/javascripts/application.js +82 -61
- data/web/assets/javascripts/dashboard.js +51 -51
- data/web/assets/stylesheets/application-dark.css +19 -23
- data/web/assets/stylesheets/application-rtl.css +0 -4
- data/web/assets/stylesheets/application.css +10 -108
- data/web/locales/en.yml +1 -1
- data/web/views/_footer.erb +1 -1
- data/web/views/_poll_link.erb +2 -5
- data/web/views/_summary.erb +7 -7
- data/web/views/dashboard.erb +8 -8
- data/web/views/layout.erb +1 -1
- data/web/views/queue.erb +10 -10
- data/web/views/queues.erb +1 -1
- metadata +9 -7
- data/lib/generators/sidekiq/worker_generator.rb +0 -57
@@ -15,9 +15,12 @@ var responsiveWidth = function() {
|
|
15
15
|
var gridSize=(this.orientation=="right"?1:-1)*this.graph.width;this.graph.vis.append("svg:g").attr("class","y_grid").call(axis.ticks(this.ticks).tickSubdivide(0).tickSize(gridSize)).selectAll("text").each(function(){this.parentNode.setAttribute("data-y-value",this.textContent)})}});Rickshaw.namespace("Rickshaw.Graph.Axis.Y.Scaled");Rickshaw.Graph.Axis.Y.Scaled=Rickshaw.Class.create(Rickshaw.Graph.Axis.Y,{initialize:function($super,args){if(typeof args.scale==="undefined"){throw new Error("Scaled requires scale")}this.scale=args.scale;if(typeof args.grid==="undefined"){this.grid=true}else{this.grid=args.grid}$super(args)},_drawAxis:function($super,scale){var domain=this.scale.domain();var renderDomain=this.graph.renderer.domain().y;var extents=[Math.min.apply(Math,domain),Math.max.apply(Math,domain)];var extentMap=d3.scale.linear().domain([0,1]).range(extents);var adjExtents=[extentMap(renderDomain[0]),extentMap(renderDomain[1])];var adjustment=d3.scale.linear().domain(extents).range(adjExtents);var adjustedScale=this.scale.copy().domain(domain.map(adjustment)).range(scale.range());return $super(adjustedScale)},_drawGrid:function($super,axis){if(this.grid){$super(axis)}}});Rickshaw.namespace("Rickshaw.Graph.Behavior.Series.Highlight");Rickshaw.Graph.Behavior.Series.Highlight=function(args){this.graph=args.graph;this.legend=args.legend;var self=this;var colorSafe={};var activeLine=null;var disabledColor=args.disabledColor||function(seriesColor){return d3.interpolateRgb(seriesColor,d3.rgb("#d8d8d8"))(.8).toString()};this.addHighlightEvents=function(l){l.element.addEventListener("mouseover",function(e){if(activeLine)return;else activeLine=l;self.legend.lines.forEach(function(line){if(l===line){if(self.graph.renderer.unstack&&(line.series.renderer?line.series.renderer.unstack:true)){var seriesIndex=self.graph.series.indexOf(line.series);line.originalIndex=seriesIndex;var series=self.graph.series.splice(seriesIndex,1)[0];self.graph.series.push(series)}return}colorSafe[line.series.name]=colorSafe[line.series.name]||line.series.color;line.series.color=disabledColor(line.series.color)});self.graph.update()},false);l.element.addEventListener("mouseout",function(e){if(!activeLine)return;else activeLine=null;self.legend.lines.forEach(function(line){if(l===line&&line.hasOwnProperty("originalIndex")){var series=self.graph.series.pop();self.graph.series.splice(line.originalIndex,0,series);delete line.originalIndex}if(colorSafe[line.series.name]){line.series.color=colorSafe[line.series.name]}});self.graph.update()},false)};if(this.legend){this.legend.lines.forEach(function(l){self.addHighlightEvents(l)})}};Rickshaw.namespace("Rickshaw.Graph.Behavior.Series.Order");Rickshaw.Graph.Behavior.Series.Order=function(args){this.graph=args.graph;this.legend=args.legend;var self=this;if(typeof window.jQuery=="undefined"){throw"couldn't find jQuery at window.jQuery"}if(typeof window.jQuery.ui=="undefined"){throw"couldn't find jQuery UI at window.jQuery.ui"}jQuery(function(){jQuery(self.legend.list).sortable({containment:"parent",tolerance:"pointer",update:function(event,ui){var series=[];jQuery(self.legend.list).find("li").each(function(index,item){if(!item.series)return;series.push(item.series)});for(var i=self.graph.series.length-1;i>=0;i--){self.graph.series[i]=series.shift()}self.graph.update()}});jQuery(self.legend.list).disableSelection()});this.graph.onUpdate(function(){var h=window.getComputedStyle(self.legend.element).height;self.legend.element.style.height=h})};Rickshaw.namespace("Rickshaw.Graph.Behavior.Series.Toggle");Rickshaw.Graph.Behavior.Series.Toggle=function(args){this.graph=args.graph;this.legend=args.legend;var self=this;this.addAnchor=function(line){var anchor=document.createElement("a");anchor.innerHTML="✔";anchor.classList.add("action");line.element.insertBefore(anchor,line.element.firstChild);anchor.onclick=function(e){if(line.series.disabled){line.series.enable();line.element.classList.remove("disabled")}else{if(this.graph.series.filter(function(s){return!s.disabled}).length<=1)return;line.series.disable();line.element.classList.add("disabled")}self.graph.update()}.bind(this);var label=line.element.getElementsByTagName("span")[0];label.onclick=function(e){var disableAllOtherLines=line.series.disabled;if(!disableAllOtherLines){for(var i=0;i<self.legend.lines.length;i++){var l=self.legend.lines[i];if(line.series===l.series){}else if(l.series.disabled){}else{disableAllOtherLines=true;break}}}if(disableAllOtherLines){line.series.enable();line.element.classList.remove("disabled");self.legend.lines.forEach(function(l){if(line.series===l.series){}else{l.series.disable();l.element.classList.add("disabled")}})}else{self.legend.lines.forEach(function(l){l.series.enable();l.element.classList.remove("disabled")})}self.graph.update()}};if(this.legend){var $=jQuery;if(typeof $!="undefined"&&$(this.legend.list).sortable){$(this.legend.list).sortable({start:function(event,ui){ui.item.bind("no.onclick",function(event){event.preventDefault()})},stop:function(event,ui){setTimeout(function(){ui.item.unbind("no.onclick")},250)}})}this.legend.lines.forEach(function(l){self.addAnchor(l)})}this._addBehavior=function(){this.graph.series.forEach(function(s){s.disable=function(){if(self.graph.series.length<=1){throw"only one series left"}s.disabled=true};s.enable=function(){s.disabled=false}})};this._addBehavior();this.updateBehaviour=function(){this._addBehavior()}};Rickshaw.namespace("Rickshaw.Graph.HoverDetail");Rickshaw.Graph.HoverDetail=Rickshaw.Class.create({initialize:function(args){var graph=this.graph=args.graph;this.xFormatter=args.xFormatter||function(x){return new Date(x*1e3).toUTCString()};this.yFormatter=args.yFormatter||function(y){return y===null?y:y.toFixed(2)};var element=this.element=document.createElement("div");element.className="detail";this.visible=true;graph.element.appendChild(element);this.lastEvent=null;this._addListeners();this.onShow=args.onShow;this.onHide=args.onHide;this.onRender=args.onRender;this.formatter=args.formatter||this.formatter},formatter:function(series,x,y,formattedX,formattedY,d){return series.name+": "+formattedY},update:function(e){e=e||this.lastEvent;if(!e)return;this.lastEvent=e;if(!e.target.nodeName.match(/^(path|svg|rect|circle)$/))return;var graph=this.graph;var eventX=e.offsetX||e.layerX;var eventY=e.offsetY||e.layerY;var j=0;var points=[];var nearestPoint;this.graph.series.active().forEach(function(series){var data=this.graph.stackedData[j++];if(!data.length)return;var domainX=graph.x.invert(eventX);var domainIndexScale=d3.scale.linear().domain([data[0].x,data.slice(-1)[0].x]).range([0,data.length-1]);var approximateIndex=Math.round(domainIndexScale(domainX));if(approximateIndex==data.length-1)approximateIndex--;var dataIndex=Math.min(approximateIndex||0,data.length-1);for(var i=approximateIndex;i<data.length-1;){if(!data[i]||!data[i+1])break;if(data[i].x<=domainX&&data[i+1].x>domainX){dataIndex=Math.abs(domainX-data[i].x)<Math.abs(domainX-data[i+1].x)?i:i+1;break}if(data[i+1].x<=domainX){i++}else{i--}}if(dataIndex<0)dataIndex=0;var value=data[dataIndex];var distance=Math.sqrt(Math.pow(Math.abs(graph.x(value.x)-eventX),2)+Math.pow(Math.abs(graph.y(value.y+value.y0)-eventY),2));var xFormatter=series.xFormatter||this.xFormatter;var yFormatter=series.yFormatter||this.yFormatter;var point={formattedXValue:xFormatter(value.x),formattedYValue:yFormatter(series.scale?series.scale.invert(value.y):value.y),series:series,value:value,distance:distance,order:j,name:series.name};if(!nearestPoint||distance<nearestPoint.distance){nearestPoint=point}points.push(point)},this);if(!nearestPoint)return;nearestPoint.active=true;var domainX=nearestPoint.value.x;var formattedXValue=nearestPoint.formattedXValue;this.element.innerHTML="";this.element.style.left=graph.x(domainX)+"px";this.visible&&this.render({points:points,detail:points,mouseX:eventX,mouseY:eventY,formattedXValue:formattedXValue,domainX:domainX})},hide:function(){this.visible=false;this.element.classList.add("inactive");if(typeof this.onHide=="function"){this.onHide()}},show:function(){this.visible=true;this.element.classList.remove("inactive");if(typeof this.onShow=="function"){this.onShow()}},render:function(args){var graph=this.graph;var points=args.points;var point=points.filter(function(p){return p.active}).shift();if(point.value.y===null)return;var formattedXValue=point.formattedXValue;var formattedYValue=point.formattedYValue;this.element.innerHTML="";this.element.style.left=graph.x(point.value.x)+"px";var xLabel=document.createElement("div");xLabel.className="x_label";xLabel.innerHTML=formattedXValue;this.element.appendChild(xLabel);var item=document.createElement("div");item.className="item";var series=point.series;var actualY=series.scale?series.scale.invert(point.value.y):point.value.y;item.innerHTML=this.formatter(series,point.value.x,actualY,formattedXValue,formattedYValue,point);item.style.top=this.graph.y(point.value.y0+point.value.y)+"px";this.element.appendChild(item);var dot=document.createElement("div");dot.className="dot";dot.style.top=item.style.top;dot.style.borderColor=series.color;this.element.appendChild(dot);if(point.active){item.classList.add("active");dot.classList.add("active")}var alignables=[xLabel,item];alignables.forEach(function(el){el.classList.add("left")});this.show();var leftAlignError=this._calcLayoutError(alignables);if(leftAlignError>0){alignables.forEach(function(el){el.classList.remove("left");el.classList.add("right")});var rightAlignError=this._calcLayoutError(alignables);if(rightAlignError>leftAlignError){alignables.forEach(function(el){el.classList.remove("right");el.classList.add("left")})}}if(typeof this.onRender=="function"){this.onRender(args)}},_calcLayoutError:function(alignables){var parentRect=this.element.parentNode.getBoundingClientRect();var error=0;var alignRight=alignables.forEach(function(el){var rect=el.getBoundingClientRect();if(!rect.width){return}if(rect.right>parentRect.right){error+=rect.right-parentRect.right}if(rect.left<parentRect.left){error+=parentRect.left-rect.left}});return error},_addListeners:function(){this.graph.element.addEventListener("mousemove",function(e){this.visible=true;this.update(e)}.bind(this),false);this.graph.onUpdate(function(){this.update()}.bind(this));this.graph.element.addEventListener("mouseout",function(e){if(e.relatedTarget&&!(e.relatedTarget.compareDocumentPosition(this.graph.element)&Node.DOCUMENT_POSITION_CONTAINS)){this.hide()}}.bind(this),false)}});Rickshaw.namespace("Rickshaw.Graph.JSONP");Rickshaw.Graph.JSONP=Rickshaw.Class.create(Rickshaw.Graph.Ajax,{request:function(){jQuery.ajax({url:this.dataURL,dataType:"jsonp",success:this.success.bind(this),error:this.error.bind(this)})}});Rickshaw.namespace("Rickshaw.Graph.Legend");Rickshaw.Graph.Legend=Rickshaw.Class.create({className:"rickshaw_legend",initialize:function(args){this.element=args.element;this.graph=args.graph;this.naturalOrder=args.naturalOrder;this.element.classList.add(this.className);this.list=document.createElement("ul");this.element.appendChild(this.list);this.render();this.graph.onUpdate(function(){})},render:function(){var self=this;while(this.list.firstChild){this.list.removeChild(this.list.firstChild)}this.lines=[];var series=this.graph.series.map(function(s){return s});if(!this.naturalOrder){series=series.reverse()}series.forEach(function(s){self.addLine(s)})},addLine:function(series){var line=document.createElement("li");line.className="line";if(series.disabled){line.className+=" disabled"}if(series.className){d3.select(line).classed(series.className,true)}var swatch=document.createElement("div");swatch.className="swatch";swatch.style.backgroundColor=series.color;line.appendChild(swatch);var label=document.createElement("span");label.className="label";label.innerHTML=series.name;line.appendChild(label);this.list.appendChild(line);line.series=series;if(series.noLegend){line.style.display="none"}var _line={element:line,series:series};if(this.shelving){this.shelving.addAnchor(_line);this.shelving.updateBehaviour()}if(this.highlighter){this.highlighter.addHighlightEvents(_line)}this.lines.push(_line);return line}});Rickshaw.namespace("Rickshaw.Graph.RangeSlider");Rickshaw.Graph.RangeSlider=Rickshaw.Class.create({initialize:function(args){var $=jQuery;var self=this;var element=this.element=args.element;var graphs=this.graphs=args.graphs;if(!graphs){graphs=this.graph=args.graph}if(graphs.constructor!==Array){graphs=[graphs]}this.graph=graphs[0];this.slideCallbacks=[];this.build();for(var i=0;i<graphs.length;i++){graphs[i].onUpdate(function(){self.update()}.bind(self));graphs[i].onConfigure(function(){$(element)[0].style.width=graphs[i].width+"px"}.bind(self))}},build:function(){var domain;var element=this.element;var $=jQuery;var self=this;var graphs=this.graphs||this.graph;if(graphs.constructor!==Array){graphs=[graphs]}this.graph=graphs[0];domain=graphs[0].dataDomain();$(function(){$(element).slider({range:true,min:domain[0],max:domain[1],values:[domain[0],domain[1]],start:function(event,ui){self.slideStarted({event:event,ui:ui})},stop:function(event,ui){self.slideFinished({event:event,ui:ui})},slide:function(event,ui){if(!self.slideShouldUpdate(event,ui))return;if(ui.values[1]<=ui.values[0])return;for(var i=0;i<graphs.length;i++){self.processSlideChange({event:event,ui:ui,graph:graphs[i]})}}})});graphs[0].onConfigure(function(){$(element)[0].style.width=graphs[0].width+"px"}.bind(this))},update:function(){var element=this.element;var graph=this.graph;var $=jQuery;var values=$(element).slider("option","values");var domain=graph.dataDomain();$(element).slider("option","min",domain[0]);$(element).slider("option","max",domain[1]);if(graph.window.xMin==null){values[0]=domain[0]}if(graph.window.xMax==null){values[1]=domain[1]}$(element).slider("option","values",values)},onSlide:function(callback){this.slideCallbacks.push(callback)},processSlideChange:function(args){var event=args.event;var ui=args.ui;var graph=args.graph;graph.window.xMin=ui.values[0];graph.window.xMax=ui.values[1];graph.update();var domain=graph.dataDomain();if(domain[0]==ui.values[0]){graph.window.xMin=undefined}if(domain[1]==ui.values[1]){graph.window.xMax=undefined}this.slideCallbacks.forEach(function(callback){callback(graph,graph.window.xMin,graph.window.xMax)})},slideShouldUpdate:function(){return true},slideStarted:function(){return},slideFinished:function(){return}});Rickshaw.namespace("Rickshaw.Graph.RangeSlider.Preview");Rickshaw.Graph.RangeSlider.Preview=Rickshaw.Class.create({initialize:function(args){if(!args.element)throw"Rickshaw.Graph.RangeSlider.Preview needs a reference to an element";if(!args.graph&&!args.graphs)throw"Rickshaw.Graph.RangeSlider.Preview needs a reference to an graph or an array of graphs";this.element=args.element;this.element.style.position="relative";this.graphs=args.graph?[args.graph]:args.graphs;this.defaults={height:75,width:400,gripperColor:undefined,frameTopThickness:3,frameHandleThickness:10,frameColor:"#d4d4d4",frameOpacity:1,minimumFrameWidth:0,heightRatio:.2};this.heightRatio=args.heightRatio||this.defaults.heightRatio;this.defaults.gripperColor=d3.rgb(this.defaults.frameColor).darker().toString();this.configureCallbacks=[];this.slideCallbacks=[];this.previews=[];if(!args.width)this.widthFromGraph=true;if(!args.height)this.heightFromGraph=true;if(this.widthFromGraph||this.heightFromGraph){this.graphs[0].onConfigure(function(){this.configure(args);this.render()}.bind(this))}args.width=args.width||this.graphs[0].width||this.defaults.width;args.height=args.height||this.graphs[0].height*this.heightRatio||this.defaults.height;this.configure(args);this.render()},onSlide:function(callback){this.slideCallbacks.push(callback)},onConfigure:function(callback){this.configureCallbacks.push(callback)},configure:function(args){this.config=this.config||{};this.configureCallbacks.forEach(function(callback){callback(args)});Rickshaw.keys(this.defaults).forEach(function(k){this.config[k]=k in args?args[k]:k in this.config?this.config[k]:this.defaults[k]},this);if("width"in args||"height"in args){if(this.widthFromGraph){this.config.width=this.graphs[0].width}if(this.heightFromGraph){this.config.height=this.graphs[0].height*this.heightRatio;this.previewHeight=this.config.height}this.previews.forEach(function(preview){var height=this.previewHeight/this.graphs.length-this.config.frameTopThickness*2;var width=this.config.width-this.config.frameHandleThickness*2;preview.setSize({width:width,height:height});if(this.svg){var svgHeight=height+this.config.frameHandleThickness*2;var svgWidth=width+this.config.frameHandleThickness*2;this.svg.style("width",svgWidth+"px");this.svg.style("height",svgHeight+"px")}},this)}},render:function(){var self=this;this.svg=d3.select(this.element).selectAll("svg.rickshaw_range_slider_preview").data([null]);this.previewHeight=this.config.height-this.config.frameTopThickness*2;this.previewWidth=this.config.width-this.config.frameHandleThickness*2;this.currentFrame=[0,this.previewWidth];var buildGraph=function(parent,index){var graphArgs=Rickshaw.extend({},parent.config);var height=self.previewHeight/self.graphs.length;var renderer=parent.renderer.name;Rickshaw.extend(graphArgs,{element:this.appendChild(document.createElement("div")),height:height,width:self.previewWidth,series:parent.series,renderer:renderer});var graph=new Rickshaw.Graph(graphArgs);self.previews.push(graph);parent.onUpdate(function(){graph.render();self.render()});parent.onConfigure(function(args){delete args.height;args.width=args.width-self.config.frameHandleThickness*2;graph.configure(args);graph.render()});graph.render()};var graphContainer=d3.select(this.element).selectAll("div.rickshaw_range_slider_preview_container").data(this.graphs);var translateCommand="translate("+this.config.frameHandleThickness+"px, "+this.config.frameTopThickness+"px)";graphContainer.enter().append("div").classed("rickshaw_range_slider_preview_container",true).style("-webkit-transform",translateCommand).style("-moz-transform",translateCommand).style("-ms-transform",translateCommand).style("transform",translateCommand).each(buildGraph);graphContainer.exit().remove();var masterGraph=this.graphs[0];var domainScale=d3.scale.linear().domain([0,this.previewWidth]).range(masterGraph.dataDomain());var currentWindow=[masterGraph.window.xMin,masterGraph.window.xMax];this.currentFrame[0]=currentWindow[0]===undefined?0:Math.round(domainScale.invert(currentWindow[0]));if(this.currentFrame[0]<0)this.currentFrame[0]=0;this.currentFrame[1]=currentWindow[1]===undefined?this.previewWidth:domainScale.invert(currentWindow[1]);if(this.currentFrame[1]-this.currentFrame[0]<self.config.minimumFrameWidth){this.currentFrame[1]=(this.currentFrame[0]||0)+self.config.minimumFrameWidth}this.svg.enter().append("svg").classed("rickshaw_range_slider_preview",true).style("height",this.config.height+"px").style("width",this.config.width+"px").style("position","absolute").style("top",0);this._renderDimming();this._renderFrame();this._renderGrippers();this._renderHandles();this._renderMiddle();this._registerMouseEvents()},_renderDimming:function(){var element=this.svg.selectAll("path.dimming").data([null]);element.enter().append("path").attr("fill","white").attr("fill-opacity","0.7").attr("fill-rule","evenodd").classed("dimming",true);var path="";path+=" M "+this.config.frameHandleThickness+" "+this.config.frameTopThickness;path+=" h "+this.previewWidth;path+=" v "+this.previewHeight;path+=" h "+-this.previewWidth;path+=" z ";path+=" M "+Math.max(this.currentFrame[0],this.config.frameHandleThickness)+" "+this.config.frameTopThickness;path+=" H "+Math.min(this.currentFrame[1]+this.config.frameHandleThickness*2,this.previewWidth+this.config.frameHandleThickness);path+=" v "+this.previewHeight;path+=" H "+Math.max(this.currentFrame[0],this.config.frameHandleThickness);path+=" z";element.attr("d",path)},_renderFrame:function(){var element=this.svg.selectAll("path.frame").data([null]);element.enter().append("path").attr("stroke","white").attr("stroke-width","1px").attr("stroke-linejoin","round").attr("fill",this.config.frameColor).attr("fill-opacity",this.config.frameOpacity).attr("fill-rule","evenodd").classed("frame",true);var path="";path+=" M "+this.currentFrame[0]+" 0";path+=" H "+(this.currentFrame[1]+this.config.frameHandleThickness*2);path+=" V "+this.config.height;path+=" H "+this.currentFrame[0];path+=" z";path+=" M "+(this.currentFrame[0]+this.config.frameHandleThickness)+" "+this.config.frameTopThickness;path+=" H "+(this.currentFrame[1]+this.config.frameHandleThickness);path+=" v "+this.previewHeight;path+=" H "+(this.currentFrame[0]+this.config.frameHandleThickness);path+=" z";element.attr("d",path)},_renderGrippers:function(){var gripper=this.svg.selectAll("path.gripper").data([null]);gripper.enter().append("path").attr("stroke",this.config.gripperColor).classed("gripper",true);var path="";[.4,.6].forEach(function(spacing){path+=" M "+Math.round(this.currentFrame[0]+this.config.frameHandleThickness*spacing)+" "+Math.round(this.config.height*.3);path+=" V "+Math.round(this.config.height*.7);path+=" M "+Math.round(this.currentFrame[1]+this.config.frameHandleThickness*(1+spacing))+" "+Math.round(this.config.height*.3);path+=" V "+Math.round(this.config.height*.7)}.bind(this));gripper.attr("d",path)},_renderHandles:function(){var leftHandle=this.svg.selectAll("rect.left_handle").data([null]);leftHandle.enter().append("rect").attr("width",this.config.frameHandleThickness).style("cursor","ew-resize").style("fill-opacity","0").classed("left_handle",true);leftHandle.attr("x",this.currentFrame[0]).attr("height",this.config.height);var rightHandle=this.svg.selectAll("rect.right_handle").data([null]);rightHandle.enter().append("rect").attr("width",this.config.frameHandleThickness).style("cursor","ew-resize").style("fill-opacity","0").classed("right_handle",true);rightHandle.attr("x",this.currentFrame[1]+this.config.frameHandleThickness).attr("height",this.config.height)},_renderMiddle:function(){var middleHandle=this.svg.selectAll("rect.middle_handle").data([null]);middleHandle.enter().append("rect").style("cursor","move").style("fill-opacity","0").classed("middle_handle",true);middleHandle.attr("width",Math.max(0,this.currentFrame[1]-this.currentFrame[0])).attr("x",this.currentFrame[0]+this.config.frameHandleThickness).attr("height",this.config.height)},_registerMouseEvents:function(){var element=d3.select(this.element);var drag={target:null,start:null,stop:null,left:false,right:false,rigid:false};var self=this;function onMousemove(datum,index){drag.stop=self._getClientXFromEvent(d3.event,drag);var distanceTraveled=drag.stop-drag.start;var frameAfterDrag=self.frameBeforeDrag.slice(0);var minimumFrameWidth=self.config.minimumFrameWidth;if(drag.rigid){minimumFrameWidth=self.frameBeforeDrag[1]-self.frameBeforeDrag[0]}if(drag.left){frameAfterDrag[0]=Math.max(frameAfterDrag[0]+distanceTraveled,0)}if(drag.right){frameAfterDrag[1]=Math.min(frameAfterDrag[1]+distanceTraveled,self.previewWidth)}var currentFrameWidth=frameAfterDrag[1]-frameAfterDrag[0];if(currentFrameWidth<=minimumFrameWidth){if(drag.left){frameAfterDrag[0]=frameAfterDrag[1]-minimumFrameWidth}if(drag.right){frameAfterDrag[1]=frameAfterDrag[0]+minimumFrameWidth}if(frameAfterDrag[0]<=0){frameAfterDrag[1]-=frameAfterDrag[0];frameAfterDrag[0]=0}if(frameAfterDrag[1]>=self.previewWidth){frameAfterDrag[0]-=frameAfterDrag[1]-self.previewWidth;frameAfterDrag[1]=self.previewWidth}}self.graphs.forEach(function(graph){var domainScale=d3.scale.linear().interpolate(d3.interpolateNumber).domain([0,self.previewWidth]).range(graph.dataDomain());var windowAfterDrag=[domainScale(frameAfterDrag[0]),domainScale(frameAfterDrag[1])];self.slideCallbacks.forEach(function(callback){callback(graph,windowAfterDrag[0],windowAfterDrag[1])});if(frameAfterDrag[0]===0){windowAfterDrag[0]=undefined}if(frameAfterDrag[1]===self.previewWidth){windowAfterDrag[1]=undefined}graph.window.xMin=windowAfterDrag[0];graph.window.xMax=windowAfterDrag[1];graph.update()})}function onMousedown(){drag.target=d3.event.target;drag.start=self._getClientXFromEvent(d3.event,drag);self.frameBeforeDrag=self.currentFrame.slice();d3.event.preventDefault?d3.event.preventDefault():d3.event.returnValue=false;d3.select(document).on("mousemove.rickshaw_range_slider_preview",onMousemove);d3.select(document).on("mouseup.rickshaw_range_slider_preview",onMouseup);d3.select(document).on("touchmove.rickshaw_range_slider_preview",onMousemove);d3.select(document).on("touchend.rickshaw_range_slider_preview",onMouseup);d3.select(document).on("touchcancel.rickshaw_range_slider_preview",onMouseup)}function onMousedownLeftHandle(datum,index){drag.left=true;onMousedown()}function onMousedownRightHandle(datum,index){drag.right=true;onMousedown()}function onMousedownMiddleHandle(datum,index){drag.left=true;drag.right=true;drag.rigid=true;onMousedown()}function onMouseup(datum,index){d3.select(document).on("mousemove.rickshaw_range_slider_preview",null);d3.select(document).on("mouseup.rickshaw_range_slider_preview",null);d3.select(document).on("touchmove.rickshaw_range_slider_preview",null);d3.select(document).on("touchend.rickshaw_range_slider_preview",null);d3.select(document).on("touchcancel.rickshaw_range_slider_preview",null);delete self.frameBeforeDrag;drag.left=false;drag.right=false;drag.rigid=false}element.select("rect.left_handle").on("mousedown",onMousedownLeftHandle);element.select("rect.right_handle").on("mousedown",onMousedownRightHandle);element.select("rect.middle_handle").on("mousedown",onMousedownMiddleHandle);element.select("rect.left_handle").on("touchstart",onMousedownLeftHandle);element.select("rect.right_handle").on("touchstart",onMousedownRightHandle);element.select("rect.middle_handle").on("touchstart",onMousedownMiddleHandle)},_getClientXFromEvent:function(event,drag){switch(event.type){case"touchstart":case"touchmove":var touchList=event.changedTouches;var touch=null;for(var touchIndex=0;touchIndex<touchList.length;touchIndex++){if(touchList[touchIndex].target===drag.target){touch=touchList[touchIndex];break}}return touch!==null?touch.clientX:undefined;default:return event.clientX}}});Rickshaw.namespace("Rickshaw.Graph.Renderer");Rickshaw.Graph.Renderer=Rickshaw.Class.create({initialize:function(args){this.graph=args.graph;this.tension=args.tension||this.tension;this.configure(args)},seriesPathFactory:function(){},seriesStrokeFactory:function(){},defaults:function(){return{tension:.8,strokeWidth:2,unstack:true,padding:{top:.01,right:0,bottom:.01,left:0},stroke:false,fill:false,opacity:1}},domain:function(data){var stackedData=data||this.graph.stackedData||this.graph.stackData();stackedData=stackedData.filter(function(a){return a&&a.length!==0});var xMin=+Infinity;var xMax=-Infinity;var yMin=+Infinity;var yMax=-Infinity;stackedData.forEach(function(series){series.forEach(function(d){if(d.y==null)return;var y=d.y+d.y0;if(y<yMin)yMin=y;if(y>yMax)yMax=y});if(!series.length)return;if(series[0].x<xMin)xMin=series[0].x;if(series[series.length-1].x>xMax)xMax=series[series.length-1].x});xMin-=(xMax-xMin)*this.padding.left;xMax+=(xMax-xMin)*this.padding.right;yMin=this.graph.min==="auto"?yMin:this.graph.min||0;yMax=this.graph.max===undefined?yMax:this.graph.max;if(this.graph.min==="auto"||yMin<0){yMin-=(yMax-yMin)*this.padding.bottom}if(this.graph.max===undefined){yMax+=(yMax-yMin)*this.padding.top}return{x:[xMin,xMax],y:[yMin,yMax]}},render:function(args){args=args||{};var graph=this.graph;var series=args.series||graph.series;var vis=args.vis||graph.vis;vis.selectAll("*").remove();var data=series.filter(function(s){return!s.disabled}).map(function(s){return s.stack});var pathNodes=vis.selectAll("path.path").data(data).enter().append("svg:path").classed("path",true).attr("d",this.seriesPathFactory());if(this.stroke){var strokeNodes=vis.selectAll("path.stroke").data(data).enter().append("svg:path").classed("stroke",true).attr("d",this.seriesStrokeFactory())}var i=0;series.forEach(function(series){if(series.disabled)return;series.path=pathNodes[0][i];if(this.stroke)series.stroke=strokeNodes[0][i];this._styleSeries(series);i++},this)},_styleSeries:function(series){var fill=this.fill?series.color:"none";var stroke=this.stroke?series.color:"none";var strokeWidth=series.strokeWidth?series.strokeWidth:this.strokeWidth;var opacity=series.opacity?series.opacity:this.opacity;series.path.setAttribute("fill",fill);series.path.setAttribute("stroke",stroke);series.path.setAttribute("stroke-width",strokeWidth);series.path.setAttribute("opacity",opacity);if(series.className){d3.select(series.path).classed(series.className,true)}if(series.className&&this.stroke){d3.select(series.stroke).classed(series.className,true)}},configure:function(args){args=args||{};Rickshaw.keys(this.defaults()).forEach(function(key){if(!args.hasOwnProperty(key)){this[key]=this[key]||this.graph[key]||this.defaults()[key];return}if(typeof this.defaults()[key]=="object"){Rickshaw.keys(this.defaults()[key]).forEach(function(k){this[key][k]=args[key][k]!==undefined?args[key][k]:this[key][k]!==undefined?this[key][k]:this.defaults()[key][k]},this)}else{this[key]=args[key]!==undefined?args[key]:this[key]!==undefined?this[key]:this.graph[key]!==undefined?this.graph[key]:this.defaults()[key]}},this)},setStrokeWidth:function(strokeWidth){if(strokeWidth!==undefined){this.strokeWidth=strokeWidth}},setTension:function(tension){if(tension!==undefined){this.tension=tension}}});Rickshaw.namespace("Rickshaw.Graph.Renderer.Line");Rickshaw.Graph.Renderer.Line=Rickshaw.Class.create(Rickshaw.Graph.Renderer,{name:"line",defaults:function($super){return Rickshaw.extend($super(),{unstack:true,fill:false,stroke:true})},seriesPathFactory:function(){var graph=this.graph;var factory=d3.svg.line().x(function(d){return graph.x(d.x)}).y(function(d){return graph.y(d.y)}).interpolate(this.graph.interpolation).tension(this.tension);factory.defined&&factory.defined(function(d){return d.y!==null});return factory}});Rickshaw.namespace("Rickshaw.Graph.Renderer.Stack");Rickshaw.Graph.Renderer.Stack=Rickshaw.Class.create(Rickshaw.Graph.Renderer,{name:"stack",defaults:function($super){return Rickshaw.extend($super(),{fill:true,stroke:false,unstack:false})},seriesPathFactory:function(){var graph=this.graph;var factory=d3.svg.area().x(function(d){return graph.x(d.x)}).y0(function(d){return graph.y(d.y0)}).y1(function(d){return graph.y(d.y+d.y0)}).interpolate(this.graph.interpolation).tension(this.tension);factory.defined&&factory.defined(function(d){return d.y!==null});return factory}});Rickshaw.namespace("Rickshaw.Graph.Renderer.Bar");Rickshaw.Graph.Renderer.Bar=Rickshaw.Class.create(Rickshaw.Graph.Renderer,{name:"bar",defaults:function($super){var defaults=Rickshaw.extend($super(),{gapSize:.05,unstack:false,opacity:1});delete defaults.tension;return defaults},initialize:function($super,args){args=args||{};this.gapSize=args.gapSize||this.gapSize;$super(args)},domain:function($super){var domain=$super();var frequentInterval=this._frequentInterval(this.graph.stackedData.slice(-1).shift());domain.x[1]+=Number(frequentInterval.magnitude);return domain},barWidth:function(series){var frequentInterval=this._frequentInterval(series.stack);var barWidth=this.graph.x.magnitude(frequentInterval.magnitude)*(1-this.gapSize);return barWidth},render:function(args){args=args||{};var graph=this.graph;var series=args.series||graph.series;var vis=args.vis||graph.vis;vis.selectAll("*").remove();var barWidth=this.barWidth(series.active()[0]);var barXOffset=0;var activeSeriesCount=series.filter(function(s){return!s.disabled}).length;var seriesBarWidth=this.unstack?barWidth/activeSeriesCount:barWidth;var transform=function(d){var matrix=[1,0,0,d.y<0?-1:1,0,d.y<0?graph.y.magnitude(Math.abs(d.y))*2:0];return"matrix("+matrix.join(",")+")"};series.forEach(function(series){if(series.disabled)return;var barWidth=this.barWidth(series);
|
16
16
|
var nodes=vis.selectAll("path").data(series.stack.filter(function(d){return d.y!==null})).enter().append("svg:rect").attr("x",function(d){return graph.x(d.x)+barXOffset}).attr("y",function(d){return graph.y(d.y0+Math.abs(d.y))*(d.y<0?-1:1)}).attr("width",seriesBarWidth).attr("height",function(d){return graph.y.magnitude(Math.abs(d.y))}).attr("opacity",series.opacity).attr("transform",transform);Array.prototype.forEach.call(nodes[0],function(n){n.setAttribute("fill",series.color)});if(this.unstack)barXOffset+=seriesBarWidth},this)},_frequentInterval:function(data){var intervalCounts={};for(var i=0;i<data.length-1;i++){var interval=data[i+1].x-data[i].x;intervalCounts[interval]=intervalCounts[interval]||0;intervalCounts[interval]++}var frequentInterval={count:0,magnitude:1};var keysSorted=Rickshaw.keys(intervalCounts).sort(function asc(a,b){return Number(a)-Number(b)});keysSorted.forEach(function(i){if(frequentInterval.count<intervalCounts[i]){frequentInterval={count:intervalCounts[i],magnitude:i}}});return frequentInterval}});Rickshaw.namespace("Rickshaw.Graph.Renderer.Area");Rickshaw.Graph.Renderer.Area=Rickshaw.Class.create(Rickshaw.Graph.Renderer,{name:"area",defaults:function($super){return Rickshaw.extend($super(),{unstack:false,fill:false,stroke:false})},seriesPathFactory:function(){var graph=this.graph;var factory=d3.svg.area().x(function(d){return graph.x(d.x)}).y0(function(d){return graph.y(d.y0)}).y1(function(d){return graph.y(d.y+d.y0)}).interpolate(graph.interpolation).tension(this.tension);factory.defined&&factory.defined(function(d){return d.y!==null});return factory},seriesStrokeFactory:function(){var graph=this.graph;var factory=d3.svg.line().x(function(d){return graph.x(d.x)}).y(function(d){return graph.y(d.y+d.y0)}).interpolate(graph.interpolation).tension(this.tension);factory.defined&&factory.defined(function(d){return d.y!==null});return factory},render:function(args){args=args||{};var graph=this.graph;var series=args.series||graph.series;var vis=args.vis||graph.vis;vis.selectAll("*").remove();var method=this.unstack?"append":"insert";var data=series.filter(function(s){return!s.disabled}).map(function(s){return s.stack});var nodes=vis.selectAll("path").data(data).enter()[method]("svg:g","g");nodes.append("svg:path").attr("d",this.seriesPathFactory()).attr("class","area");if(this.stroke){nodes.append("svg:path").attr("d",this.seriesStrokeFactory()).attr("class","line")}var i=0;series.forEach(function(series){if(series.disabled)return;series.path=nodes[0][i++];this._styleSeries(series)},this)},_styleSeries:function(series){if(!series.path)return;d3.select(series.path).select(".area").attr("fill",series.color);if(this.stroke){d3.select(series.path).select(".line").attr("fill","none").attr("stroke",series.stroke||d3.interpolateRgb(series.color,"black")(.125)).attr("stroke-width",this.strokeWidth)}if(series.className){series.path.setAttribute("class",series.className)}}});Rickshaw.namespace("Rickshaw.Graph.Renderer.ScatterPlot");Rickshaw.Graph.Renderer.ScatterPlot=Rickshaw.Class.create(Rickshaw.Graph.Renderer,{name:"scatterplot",defaults:function($super){return Rickshaw.extend($super(),{unstack:true,fill:true,stroke:false,padding:{top:.01,right:.01,bottom:.01,left:.01},dotSize:4})},initialize:function($super,args){$super(args)},render:function(args){args=args||{};var graph=this.graph;var series=args.series||graph.series;var vis=args.vis||graph.vis;var dotSize=this.dotSize;vis.selectAll("*").remove();series.forEach(function(series){if(series.disabled)return;var opacity=series.opacity?series.opacity:1;var nodes=vis.selectAll("path").data(series.stack.filter(function(d){return d.y!==null})).enter().append("svg:circle").attr("cx",function(d){return graph.x(d.x)}).attr("cy",function(d){return graph.y(d.y)}).attr("r",function(d){return"r"in d?d.r:dotSize}).attr("opacity",function(d){return"opacity"in d?d.opacity:opacity});if(series.className){nodes.classed(series.className,true)}Array.prototype.forEach.call(nodes[0],function(n){n.setAttribute("fill",series.color)})},this)}});Rickshaw.namespace("Rickshaw.Graph.Renderer.Multi");Rickshaw.Graph.Renderer.Multi=Rickshaw.Class.create(Rickshaw.Graph.Renderer,{name:"multi",initialize:function($super,args){$super(args)},defaults:function($super){return Rickshaw.extend($super(),{unstack:true,fill:false,stroke:true})},configure:function($super,args){args=args||{};this.config=args;$super(args)},domain:function($super){this.graph.stackData();var domains=[];var groups=this._groups();this._stack(groups);groups.forEach(function(group){var data=group.series.filter(function(s){return!s.disabled}).map(function(s){return s.stack});if(!data.length)return;var domain=null;if(group.renderer&&group.renderer.domain){domain=group.renderer.domain(data)}else{domain=$super(data)}domains.push(domain)});var xMin=d3.min(domains.map(function(d){return d.x[0]}));var xMax=d3.max(domains.map(function(d){return d.x[1]}));var yMin=d3.min(domains.map(function(d){return d.y[0]}));var yMax=d3.max(domains.map(function(d){return d.y[1]}));return{x:[xMin,xMax],y:[yMin,yMax]}},_groups:function(){var graph=this.graph;var renderGroups={};graph.series.forEach(function(series){if(series.disabled)return;if(!renderGroups[series.renderer]){var ns="http://www.w3.org/2000/svg";var vis=document.createElementNS(ns,"g");graph.vis[0][0].appendChild(vis);var renderer=graph._renderers[series.renderer];var config={};var defaults=[this.defaults(),renderer.defaults(),this.config,this.graph];defaults.forEach(function(d){Rickshaw.extend(config,d)});renderer.configure(config);renderGroups[series.renderer]={renderer:renderer,series:[],vis:d3.select(vis)}}renderGroups[series.renderer].series.push(series)},this);var groups=[];Object.keys(renderGroups).forEach(function(key){var group=renderGroups[key];groups.push(group)});return groups},_stack:function(groups){groups.forEach(function(group){var series=group.series.filter(function(series){return!series.disabled});var data=series.map(function(series){return series.stack});if(!group.renderer.unstack){var layout=d3.layout.stack();var stackedData=Rickshaw.clone(layout(data));series.forEach(function(series,index){series._stack=Rickshaw.clone(stackedData[index])})}},this);return groups},render:function(){this.graph.series.forEach(function(series){if(!series.renderer){throw new Error("Each series needs a renderer for graph 'multi' renderer")}});this.graph.vis.selectAll("*").remove();var groups=this._groups();groups=this._stack(groups);groups.forEach(function(group){var series=group.series.filter(function(series){return!series.disabled});series.active=function(){return series};group.renderer.render({series:series,vis:group.vis});series.forEach(function(s){s.stack=s._stack||s.stack||s.data})})}});Rickshaw.namespace("Rickshaw.Graph.Renderer.LinePlot");Rickshaw.Graph.Renderer.LinePlot=Rickshaw.Class.create(Rickshaw.Graph.Renderer,{name:"lineplot",defaults:function($super){return Rickshaw.extend($super(),{unstack:true,fill:false,stroke:true,padding:{top:.01,right:.01,bottom:.01,left:.01},dotSize:3,strokeWidth:2})},seriesPathFactory:function(){var graph=this.graph;var factory=d3.svg.line().x(function(d){return graph.x(d.x)}).y(function(d){return graph.y(d.y)}).interpolate(this.graph.interpolation).tension(this.tension);factory.defined&&factory.defined(function(d){return d.y!==null});return factory},render:function(args){args=args||{};var graph=this.graph;var series=args.series||graph.series;var vis=args.vis||graph.vis;var dotSize=this.dotSize;vis.selectAll("*").remove();var data=series.filter(function(s){return!s.disabled}).map(function(s){return s.stack});var nodes=vis.selectAll("path").data(data).enter().append("svg:path").attr("d",this.seriesPathFactory());var i=0;series.forEach(function(series){if(series.disabled)return;series.path=nodes[0][i++];this._styleSeries(series)},this);series.forEach(function(series){if(series.disabled)return;var nodes=vis.selectAll("x").data(series.stack.filter(function(d){return d.y!==null})).enter().append("svg:circle").attr("cx",function(d){return graph.x(d.x)}).attr("cy",function(d){return graph.y(d.y)}).attr("r",function(d){return"r"in d?d.r:dotSize});Array.prototype.forEach.call(nodes[0],function(n){if(!n)return;n.setAttribute("data-color",series.color);n.setAttribute("fill","white");n.setAttribute("stroke",series.color);n.setAttribute("stroke-width",this.strokeWidth)}.bind(this))},this)}});Rickshaw.namespace("Rickshaw.Graph.Smoother");Rickshaw.Graph.Smoother=Rickshaw.Class.create({initialize:function(args){this.graph=args.graph;this.element=args.element;this.aggregationScale=1;this.build();this.graph.stackData.hooks.data.push({name:"smoother",orderPosition:50,f:this.transformer.bind(this)})},build:function(){var self=this;var $=jQuery;if(this.element){$(function(){$(self.element).slider({min:1,max:100,slide:function(event,ui){self.setScale(ui.value)}})})}},setScale:function(scale){if(scale<1){throw"scale out of range: "+scale}this.aggregationScale=scale;this.graph.update()},transformer:function(data){if(this.aggregationScale==1)return data;var aggregatedData=[];data.forEach(function(seriesData){var aggregatedSeriesData=[];while(seriesData.length){var avgX=0,avgY=0;var slice=seriesData.splice(0,this.aggregationScale);slice.forEach(function(d){avgX+=d.x/slice.length;avgY+=d.y/slice.length});aggregatedSeriesData.push({x:avgX,y:avgY})}aggregatedData.push(aggregatedSeriesData)}.bind(this));return aggregatedData}});Rickshaw.namespace("Rickshaw.Graph.Socketio");Rickshaw.Graph.Socketio=Rickshaw.Class.create(Rickshaw.Graph.Ajax,{request:function(){var socket=io.connect(this.dataURL);var self=this;socket.on("rickshaw",function(data){self.success(data)})}});Rickshaw.namespace("Rickshaw.Series");Rickshaw.Series=Rickshaw.Class.create(Array,{initialize:function(data,palette,options){options=options||{};this.palette=new Rickshaw.Color.Palette(palette);this.timeBase=typeof options.timeBase==="undefined"?Math.floor((new Date).getTime()/1e3):options.timeBase;var timeInterval=typeof options.timeInterval=="undefined"?1e3:options.timeInterval;this.setTimeInterval(timeInterval);if(data&&typeof data=="object"&&Array.isArray(data)){data.forEach(function(item){this.addItem(item)},this)}},addItem:function(item){if(typeof item.name==="undefined"){throw"addItem() needs a name"}item.color=item.color||this.palette.color(item.name);item.data=item.data||[];if(item.data.length===0&&this.length&&this.getIndex()>0){this[0].data.forEach(function(plot){item.data.push({x:plot.x,y:0})})}else if(item.data.length===0){item.data.push({x:this.timeBase-(this.timeInterval||0),y:0})}this.push(item);if(this.legend){this.legend.addLine(this.itemByName(item.name))}},addData:function(data,x){var index=this.getIndex();Rickshaw.keys(data).forEach(function(name){if(!this.itemByName(name)){this.addItem({name:name})}},this);this.forEach(function(item){item.data.push({x:x||(index*this.timeInterval||1)+this.timeBase,y:data[item.name]||0})},this)},getIndex:function(){return this[0]&&this[0].data&&this[0].data.length?this[0].data.length:0},itemByName:function(name){for(var i=0;i<this.length;i++){if(this[i].name==name)return this[i]}},setTimeInterval:function(iv){this.timeInterval=iv/1e3},setTimeBase:function(t){this.timeBase=t},dump:function(){var data={timeBase:this.timeBase,timeInterval:this.timeInterval,items:[]};this.forEach(function(item){var newItem={color:item.color,name:item.name,data:[]};item.data.forEach(function(plot){newItem.data.push({x:plot.x,y:plot.y})});data.items.push(newItem)});return data},load:function(data){if(data.timeInterval){this.timeInterval=data.timeInterval}if(data.timeBase){this.timeBase=data.timeBase}if(data.items){data.items.forEach(function(item){this.push(item);if(this.legend){this.legend.addLine(this.itemByName(item.name))}},this)}}});Rickshaw.Series.zeroFill=function(series){Rickshaw.Series.fill(series,0)};Rickshaw.Series.fill=function(series,fill){var x;var i=0;var data=series.map(function(s){return s.data});while(i<Math.max.apply(null,data.map(function(d){return d.length}))){x=Math.min.apply(null,data.filter(function(d){return d[i]}).map(function(d){return d[i].x}));data.forEach(function(d){if(!d[i]||d[i].x!=x){d.splice(i,0,{x:x,y:fill})}});i++}};Rickshaw.namespace("Rickshaw.Series.FixedDuration");Rickshaw.Series.FixedDuration=Rickshaw.Class.create(Rickshaw.Series,{initialize:function(data,palette,options){options=options||{};if(typeof options.timeInterval==="undefined"){throw new Error("FixedDuration series requires timeInterval")}if(typeof options.maxDataPoints==="undefined"){throw new Error("FixedDuration series requires maxDataPoints")}this.palette=new Rickshaw.Color.Palette(palette);this.timeBase=typeof options.timeBase==="undefined"?Math.floor((new Date).getTime()/1e3):options.timeBase;this.setTimeInterval(options.timeInterval);if(this[0]&&this[0].data&&this[0].data.length){this.currentSize=this[0].data.length;this.currentIndex=this[0].data.length}else{this.currentSize=0;this.currentIndex=0}this.maxDataPoints=options.maxDataPoints;if(data&&typeof data=="object"&&Array.isArray(data)){data.forEach(function(item){this.addItem(item)},this);this.currentSize+=1;this.currentIndex+=1}this.timeBase-=(this.maxDataPoints-this.currentSize)*this.timeInterval;if(typeof this.maxDataPoints!=="undefined"&&this.currentSize<this.maxDataPoints){for(var i=this.maxDataPoints-this.currentSize-1;i>1;i--){this.currentSize+=1;this.currentIndex+=1;this.forEach(function(item){item.data.unshift({x:((i-1)*this.timeInterval||1)+this.timeBase,y:0,i:i})},this)}}},addData:function($super,data,x){$super(data,x);this.currentSize+=1;this.currentIndex+=1;if(this.maxDataPoints!==undefined){while(this.currentSize>this.maxDataPoints){this.dropData()}}},dropData:function(){this.forEach(function(item){item.data.splice(0,1)});this.currentSize-=1},getIndex:function(){return this.currentIndex}});return Rickshaw});
|
17
17
|
|
18
|
+
Sidekiq = {};
|
19
|
+
|
20
|
+
var nf = new Intl.NumberFormat();
|
18
21
|
var poller;
|
19
22
|
var realtimeGraph = function(updatePath) {
|
20
|
-
var timeInterval = parseInt(localStorage.
|
23
|
+
var timeInterval = parseInt(localStorage.sidekiqTimeInterval) || 5000;
|
21
24
|
var graphElement = document.getElementById("realtime");
|
22
25
|
|
23
26
|
var graph = new Rickshaw.Graph( {
|
@@ -41,7 +44,7 @@ var realtimeGraph = function(updatePath) {
|
|
41
44
|
|
42
45
|
graph.render();
|
43
46
|
|
44
|
-
var legend = document.
|
47
|
+
var legend = document.getElementById('realtime-legend');
|
45
48
|
var Hover = Rickshaw.Class.create(Rickshaw.Graph.HoverDetail, {
|
46
49
|
render: function(args) {
|
47
50
|
legend.innerHTML = "";
|
@@ -61,7 +64,7 @@ var realtimeGraph = function(updatePath) {
|
|
61
64
|
|
62
65
|
var label = document.createElement('div');
|
63
66
|
label.className = 'tag';
|
64
|
-
label.innerHTML = d.name + ": " + Math.floor(d.formattedYValue)
|
67
|
+
label.innerHTML = d.name + ": " + nf.format(Math.floor(d.formattedYValue));
|
65
68
|
|
66
69
|
line.appendChild(swatch);
|
67
70
|
line.appendChild(label);
|
@@ -82,7 +85,9 @@ var realtimeGraph = function(updatePath) {
|
|
82
85
|
|
83
86
|
var i = 0;
|
84
87
|
poller = setInterval(function() {
|
85
|
-
|
88
|
+
var url = document.getElementById("history").getAttribute("data-update-url");
|
89
|
+
|
90
|
+
fetch(url).then(response => response.json()).then(data => {
|
86
91
|
if (i === 0) {
|
87
92
|
var processed = data.sidekiq.processed;
|
88
93
|
var failed = data.sidekiq.failed;
|
@@ -113,10 +118,11 @@ var realtimeGraph = function(updatePath) {
|
|
113
118
|
}
|
114
119
|
|
115
120
|
var historyGraph = function() {
|
116
|
-
|
117
|
-
|
121
|
+
var h = document.getElementById("history");
|
122
|
+
processed = createSeries(h.getAttribute("data-processed"));
|
123
|
+
failed = createSeries(h.getAttribute("data-failed"));
|
118
124
|
|
119
|
-
var graphElement =
|
125
|
+
var graphElement = h;
|
120
126
|
var graph = new Rickshaw.Graph( {
|
121
127
|
element: graphElement,
|
122
128
|
width: responsiveWidth(),
|
@@ -144,7 +150,7 @@ var historyGraph = function() {
|
|
144
150
|
|
145
151
|
graph.render();
|
146
152
|
|
147
|
-
var legend = document.
|
153
|
+
var legend = document.getElementById('history-legend');
|
148
154
|
var Hover = Rickshaw.Class.create(Rickshaw.Graph.HoverDetail, {
|
149
155
|
render: function(args) {
|
150
156
|
legend.innerHTML = "";
|
@@ -164,7 +170,7 @@ var historyGraph = function() {
|
|
164
170
|
|
165
171
|
var label = document.createElement('div');
|
166
172
|
label.className = 'tag';
|
167
|
-
label.innerHTML = d.name + ": " + Math.floor(d.formattedYValue)
|
173
|
+
label.innerHTML = d.name + ": " + nf.format(Math.floor(d.formattedYValue));
|
168
174
|
|
169
175
|
line.appendChild(swatch);
|
170
176
|
line.appendChild(label);
|
@@ -184,8 +190,9 @@ var historyGraph = function() {
|
|
184
190
|
var hover = new Hover( { graph: graph } );
|
185
191
|
}
|
186
192
|
|
187
|
-
var createSeries = function(
|
188
|
-
var
|
193
|
+
var createSeries = function(data) {
|
194
|
+
var obj = JSON.parse(data);
|
195
|
+
var series = [];
|
189
196
|
for (var date in obj) {
|
190
197
|
var value = obj[date];
|
191
198
|
var point = { x: Date.parse(date)/1000, y: value };
|
@@ -195,43 +202,32 @@ var createSeries = function(obj) {
|
|
195
202
|
};
|
196
203
|
|
197
204
|
var updateStatsSummary = function(data) {
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
+
document.getElementById("txtProcessed").innerText = nf.format(data.processed);
|
206
|
+
document.getElementById("txtFailed").innerText = nf.format(data.failed);
|
207
|
+
document.getElementById("txtBusy").innerText = nf.format(data.busy);
|
208
|
+
document.getElementById("txtScheduled").innerText = nf.format(data.scheduled);
|
209
|
+
document.getElementById("txtRetries").innerText = nf.format(data.retries);
|
210
|
+
document.getElementById("txtEnqueued").innerText = nf.format(data.enqueued);
|
211
|
+
document.getElementById("txtDead").innerText = nf.format(data.dead);
|
205
212
|
}
|
206
213
|
|
207
214
|
var updateRedisStats = function(data) {
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
215
|
+
document.getElementById('redis_version').innerText = data.redis_version;
|
216
|
+
document.getElementById('uptime_in_days').innerText = data.uptime_in_days;
|
217
|
+
document.getElementById('connected_clients').innerText = data.connected_clients;
|
218
|
+
document.getElementById('used_memory_human').innerText = data.used_memory_human;
|
219
|
+
document.getElementById('used_memory_peak_human').innerText = data.used_memory_peak_human;
|
213
220
|
}
|
214
221
|
|
215
222
|
var updateFooterUTCTime = function(time) {
|
216
|
-
|
223
|
+
document.getElementById('serverUtcTime').innerText = time;
|
217
224
|
}
|
218
225
|
|
219
|
-
var pulseBeacon = function(){
|
220
|
-
|
221
|
-
|
222
|
-
});
|
226
|
+
var pulseBeacon = function() {
|
227
|
+
document.getElementById('beacon').classList.add('pulse');
|
228
|
+
window.setTimeout(() => { document.getElementById('beacon').classList.remove('pulse'); }, 1000);
|
223
229
|
}
|
224
230
|
|
225
|
-
Number.prototype.numberWithDelimiter = function(delimiter) {
|
226
|
-
var number = this + '', delimiter = delimiter || ',';
|
227
|
-
var split = number.split('.');
|
228
|
-
split[0] = split[0].replace(
|
229
|
-
/(\d)(?=(\d\d\d)+(?!\d))/g,
|
230
|
-
'$1' + delimiter
|
231
|
-
);
|
232
|
-
return split.join('.');
|
233
|
-
};
|
234
|
-
|
235
231
|
// Render graphs
|
236
232
|
var renderGraphs = function() {
|
237
233
|
realtimeGraph();
|
@@ -239,28 +235,33 @@ var renderGraphs = function() {
|
|
239
235
|
};
|
240
236
|
|
241
237
|
var setSliderLabel = function(val) {
|
242
|
-
|
243
|
-
|
238
|
+
document.getElementById('sldr-text').innerText = Math.round(parseFloat(val) / 1000) + ' sec';
|
239
|
+
}
|
240
|
+
|
241
|
+
var ready = (callback) => {
|
242
|
+
if (document.readyState != "loading") callback();
|
243
|
+
else document.addEventListener("DOMContentLoaded", callback);
|
244
244
|
}
|
245
245
|
|
246
|
-
|
246
|
+
ready(() => {
|
247
247
|
renderGraphs();
|
248
248
|
|
249
|
-
|
250
|
-
|
251
|
-
|
249
|
+
var sldr = document.getElementById('sldr');
|
250
|
+
if (typeof localStorage.sidekiqTimeInterval !== 'undefined') {
|
251
|
+
sldr.value = localStorage.sidekiqTimeInterval;
|
252
|
+
setSliderLabel(localStorage.sidekiqTimeInterval);
|
252
253
|
}
|
253
254
|
|
254
|
-
|
255
|
+
sldr.addEventListener("change", event => {
|
255
256
|
clearInterval(poller);
|
256
|
-
localStorage.
|
257
|
-
setSliderLabel(
|
257
|
+
localStorage.sidekiqTimeInterval = sldr.value;
|
258
|
+
setSliderLabel(sldr.value);
|
258
259
|
resetGraphs();
|
259
260
|
renderGraphs();
|
260
261
|
});
|
261
262
|
|
262
|
-
|
263
|
-
setSliderLabel(
|
263
|
+
sldr.addEventListener("mousemove", event => {
|
264
|
+
setSliderLabel(sldr.value);
|
264
265
|
});
|
265
266
|
});
|
266
267
|
|
@@ -271,8 +272,7 @@ var resetGraphs = function() {
|
|
271
272
|
};
|
272
273
|
|
273
274
|
// Resize graphs after resizing window
|
274
|
-
var debounce = function(fn, timeout)
|
275
|
-
{
|
275
|
+
var debounce = function(fn, timeout) {
|
276
276
|
var timeoutID = -1;
|
277
277
|
return function() {
|
278
278
|
if (timeoutID > -1) {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
html, body {
|
2
|
-
background-color: #
|
3
|
-
color: #
|
2
|
+
background-color: #171717 !important;
|
3
|
+
color: #DEDEDE;
|
4
4
|
}
|
5
5
|
|
6
6
|
a,
|
@@ -8,12 +8,12 @@ a,
|
|
8
8
|
.summary_bar ul .count,
|
9
9
|
span.current-interval,
|
10
10
|
.navbar .navbar-brand {
|
11
|
-
color: #
|
11
|
+
color: #d04;
|
12
12
|
}
|
13
13
|
|
14
|
-
.history-graph
|
14
|
+
.history-graph.active,
|
15
15
|
.beacon .dot {
|
16
|
-
background-color: #
|
16
|
+
background-color: #d04;
|
17
17
|
}
|
18
18
|
|
19
19
|
.navbar .navbar-brand:hover {
|
@@ -30,15 +30,15 @@ span.current-interval,
|
|
30
30
|
|
31
31
|
.navbar-inverse {
|
32
32
|
background-color: #222;
|
33
|
-
border-color: #
|
33
|
+
border-color: #444;
|
34
34
|
}
|
35
35
|
|
36
36
|
table {
|
37
|
-
background-color: #
|
37
|
+
background-color: #1D1D1D;
|
38
38
|
}
|
39
39
|
|
40
40
|
.table-striped > tbody > tr:nth-of-type(odd) {
|
41
|
-
background-color: #
|
41
|
+
background-color: #2E2E2E;
|
42
42
|
}
|
43
43
|
|
44
44
|
.table-bordered,
|
@@ -48,7 +48,7 @@ table {
|
|
48
48
|
.table-bordered > tfoot > tr > th,
|
49
49
|
.table-bordered > thead > tr > td,
|
50
50
|
.table-bordered > thead > tr > th {
|
51
|
-
border: 1px solid #
|
51
|
+
border: 1px solid #444;
|
52
52
|
}
|
53
53
|
|
54
54
|
.table-hover > tbody > tr:hover {
|
@@ -72,9 +72,7 @@ table {
|
|
72
72
|
background-color: #31708f;
|
73
73
|
}
|
74
74
|
|
75
|
-
a:link,
|
76
|
-
a:active,
|
77
|
-
a:hover {
|
75
|
+
a:link, a:active, a:hover, a:visited {
|
78
76
|
color: #ddd;
|
79
77
|
}
|
80
78
|
|
@@ -85,15 +83,13 @@ input {
|
|
85
83
|
}
|
86
84
|
|
87
85
|
.summary_bar .summary {
|
88
|
-
background-color: #
|
89
|
-
border: 1px solid #
|
90
|
-
|
91
|
-
box-shadow: 0 0 5px rgba(255, 255, 255, 0.1);
|
86
|
+
background-color: #232323;
|
87
|
+
border: 1px solid #444;
|
92
88
|
}
|
93
89
|
|
94
90
|
.navbar-default {
|
95
|
-
background-color: #
|
96
|
-
border-color: #
|
91
|
+
background-color: #0F0F0F;
|
92
|
+
border-color: #444;
|
97
93
|
}
|
98
94
|
|
99
95
|
.navbar-default .navbar-nav > .active > a,
|
@@ -112,7 +108,7 @@ input {
|
|
112
108
|
.pagination > li > span {
|
113
109
|
color: #ddd;
|
114
110
|
background-color: #333;
|
115
|
-
border-color: #
|
111
|
+
border-color: #444;
|
116
112
|
}
|
117
113
|
.pagination > .disabled > a,
|
118
114
|
.pagination > .disabled > a:focus,
|
@@ -122,18 +118,18 @@ input {
|
|
122
118
|
.pagination > .disabled > span:hover {
|
123
119
|
color: #ddd;
|
124
120
|
background-color: #333;
|
125
|
-
border-color: #
|
121
|
+
border-color: #444;
|
126
122
|
}
|
127
123
|
|
128
124
|
.stat {
|
129
|
-
border: 1px solid
|
125
|
+
border: 1px solid #888;
|
130
126
|
}
|
131
127
|
|
132
128
|
.rickshaw_graph .detail {
|
133
|
-
background:
|
129
|
+
background: #888;
|
134
130
|
}
|
135
131
|
.rickshaw_graph .x_tick {
|
136
|
-
border-color:
|
132
|
+
border-color: #888;
|
137
133
|
}
|
138
134
|
|
139
135
|
.rickshaw_graph .y_ticks.glow text {
|
@@ -21,7 +21,7 @@ body {
|
|
21
21
|
a {
|
22
22
|
color: #b1003e;
|
23
23
|
}
|
24
|
-
a:active, a:hover {
|
24
|
+
a:active, a:hover, a:focus {
|
25
25
|
color: #4b001a;
|
26
26
|
}
|
27
27
|
|
@@ -89,19 +89,18 @@ header.row .pagination {
|
|
89
89
|
.summary_bar .summary {
|
90
90
|
margin-top: 12px;
|
91
91
|
background-color: #fff;
|
92
|
-
box-shadow: 0 0 5px rgba(50, 50, 50, 0.25);
|
93
92
|
border-radius: 4px;
|
93
|
+
border: 1px solid rgba(0, 0, 0, 0.1);
|
94
94
|
padding: 8px;
|
95
95
|
margin-bottom: 10px;
|
96
|
-
border-width: 0;
|
97
96
|
}
|
98
97
|
.poll-wrapper {
|
99
98
|
margin: 9px;
|
100
99
|
}
|
101
|
-
|
100
|
+
.live-poll.active {
|
102
101
|
background-color: #009300;
|
103
102
|
}
|
104
|
-
|
103
|
+
.live-poll.active:hover {
|
105
104
|
background-color: #777;
|
106
105
|
}
|
107
106
|
.summary_bar ul {
|
@@ -266,18 +265,6 @@ table .table-checkbox label {
|
|
266
265
|
.navbar .poll-wrapper {
|
267
266
|
margin: 4px 4px 0 0;
|
268
267
|
}
|
269
|
-
|
270
|
-
.navbar .dropdown-menu {
|
271
|
-
min-width: 120px;
|
272
|
-
}
|
273
|
-
|
274
|
-
.navbar .dropdown-menu a {
|
275
|
-
text-align: left;
|
276
|
-
}
|
277
|
-
}
|
278
|
-
|
279
|
-
.nav .dropdown {
|
280
|
-
display: none;
|
281
268
|
}
|
282
269
|
|
283
270
|
.navbar-footer .navbar ul.nav {
|
@@ -362,6 +349,7 @@ img.smallogo {
|
|
362
349
|
text-align: center;
|
363
350
|
margin-right: 20px;
|
364
351
|
border: 1px solid rgba(0, 0, 0, 0.1);
|
352
|
+
border-radius: 4px;
|
365
353
|
padding: 5px;
|
366
354
|
width: 150px;
|
367
355
|
margin-bottom: 20px;
|
@@ -417,8 +405,6 @@ span.current-interval {
|
|
417
405
|
|
418
406
|
div.interval-slider input {
|
419
407
|
width: 160px;
|
420
|
-
height: 3px;
|
421
|
-
margin-top: 5px;
|
422
408
|
border-radius: 2px;
|
423
409
|
background: currentcolor;
|
424
410
|
}
|
@@ -502,7 +488,7 @@ div.interval-slider input {
|
|
502
488
|
|
503
489
|
@keyframes beacon-dot-pulse {
|
504
490
|
from {
|
505
|
-
background-color: #
|
491
|
+
background-color: #50002d;
|
506
492
|
box-shadow: 0 0 9px #666;
|
507
493
|
}
|
508
494
|
50% {
|
@@ -510,7 +496,7 @@ div.interval-slider input {
|
|
510
496
|
box-shadow: 0 0 18px #666;
|
511
497
|
}
|
512
498
|
to {
|
513
|
-
background-color: #
|
499
|
+
background-color: #50002d;
|
514
500
|
box-shadow: 0 0 9px #666;
|
515
501
|
}
|
516
502
|
}
|
@@ -549,7 +535,6 @@ div.interval-slider input {
|
|
549
535
|
}
|
550
536
|
|
551
537
|
.history-graph {
|
552
|
-
font-size: 0.8em;
|
553
538
|
padding: 3px;
|
554
539
|
border-radius: 3px;
|
555
540
|
}
|
@@ -633,7 +618,7 @@ div.interval-slider input {
|
|
633
618
|
position: absolute;
|
634
619
|
top: 0;
|
635
620
|
z-index: 2;
|
636
|
-
background: rgba(0, 0, 0, .
|
621
|
+
background: rgba(0, 0, 0, .9);
|
637
622
|
bottom: 0;
|
638
623
|
width: 1px;
|
639
624
|
transition: opacity .25s linear;
|
@@ -739,96 +724,16 @@ div.interval-slider input {
|
|
739
724
|
top: 0;
|
740
725
|
bottom: 0;
|
741
726
|
width: 0;
|
742
|
-
border-left: 1px dotted rgba(0, 0, 0, .
|
727
|
+
border-left: 1px dotted rgba(0, 0, 0, .5);
|
743
728
|
pointer-events: none
|
744
729
|
}
|
745
730
|
.rickshaw_graph .x_tick .title {
|
746
731
|
position: absolute;
|
747
|
-
font-size: 12px;
|
748
732
|
font-family: Arial, sans-serif;
|
749
|
-
opacity: .5;
|
750
733
|
white-space: nowrap;
|
751
734
|
margin-left: 3px;
|
752
735
|
bottom: 1px
|
753
736
|
}
|
754
|
-
.rickshaw_annotation_timeline {
|
755
|
-
height: 1px;
|
756
|
-
border-top: 1px solid #e0e0e0;
|
757
|
-
margin-top: 10px;
|
758
|
-
position: relative
|
759
|
-
}
|
760
|
-
.rickshaw_annotation_timeline .annotation {
|
761
|
-
position: absolute;
|
762
|
-
height: 6px;
|
763
|
-
width: 6px;
|
764
|
-
margin-left: -2px;
|
765
|
-
top: -3px;
|
766
|
-
border-radius: 5px;
|
767
|
-
background-color: rgba(0, 0, 0, .25)
|
768
|
-
}
|
769
|
-
.rickshaw_graph .annotation_line {
|
770
|
-
position: absolute;
|
771
|
-
top: 0;
|
772
|
-
bottom: -6px;
|
773
|
-
width: 0;
|
774
|
-
border-left: 2px solid rgba(0, 0, 0, .3);
|
775
|
-
display: none
|
776
|
-
}
|
777
|
-
.rickshaw_graph .annotation_line.active {
|
778
|
-
display: block
|
779
|
-
}
|
780
|
-
.rickshaw_graph .annotation_range {
|
781
|
-
background: rgba(0, 0, 0, .1);
|
782
|
-
display: none;
|
783
|
-
position: absolute;
|
784
|
-
top: 0;
|
785
|
-
bottom: -6px
|
786
|
-
}
|
787
|
-
.rickshaw_graph .annotation_range.active {
|
788
|
-
display: block
|
789
|
-
}
|
790
|
-
.rickshaw_graph .annotation_range.active.offscreen {
|
791
|
-
display: none
|
792
|
-
}
|
793
|
-
.rickshaw_annotation_timeline .annotation .content {
|
794
|
-
background: #fff;
|
795
|
-
color: #000;
|
796
|
-
opacity: .9;
|
797
|
-
padding: 5px;
|
798
|
-
box-shadow: 0 0 2px rgba(0, 0, 0, .8);
|
799
|
-
border-radius: 3px;
|
800
|
-
position: relative;
|
801
|
-
z-index: 20;
|
802
|
-
font-size: 12px;
|
803
|
-
padding: 6px 8px 8px;
|
804
|
-
top: 18px;
|
805
|
-
left: -11px;
|
806
|
-
width: 160px;
|
807
|
-
display: none;
|
808
|
-
cursor: pointer
|
809
|
-
}
|
810
|
-
.rickshaw_annotation_timeline .annotation .content:before {
|
811
|
-
content: "\25b2";
|
812
|
-
position: absolute;
|
813
|
-
top: -11px;
|
814
|
-
color: #fff;
|
815
|
-
text-shadow: 0 -1px 1px rgba(0, 0, 0, .8)
|
816
|
-
}
|
817
|
-
.rickshaw_annotation_timeline .annotation.active,
|
818
|
-
.rickshaw_annotation_timeline .annotation:hover {
|
819
|
-
background-color: rgba(0, 0, 0, .8);
|
820
|
-
cursor: none
|
821
|
-
}
|
822
|
-
.rickshaw_annotation_timeline .annotation .content:hover {
|
823
|
-
z-index: 50
|
824
|
-
}
|
825
|
-
.rickshaw_annotation_timeline .annotation.active .content {
|
826
|
-
display: block
|
827
|
-
}
|
828
|
-
.rickshaw_annotation_timeline .annotation:hover .content {
|
829
|
-
display: block;
|
830
|
-
z-index: 50
|
831
|
-
}
|
832
737
|
.rickshaw_graph .y_axis,
|
833
738
|
.rickshaw_graph .x_axis_d3 {
|
834
739
|
fill: none
|
@@ -880,7 +785,6 @@ div.interval-slider input {
|
|
880
785
|
}
|
881
786
|
.rickshaw_legend {
|
882
787
|
font-family: Arial;
|
883
|
-
font-size: 12px;
|
884
788
|
color: #fff;
|
885
789
|
background: #404040;
|
886
790
|
display: inline-block;
|
@@ -923,10 +827,8 @@ div.interval-slider input {
|
|
923
827
|
}
|
924
828
|
.rickshaw_legend .action {
|
925
829
|
margin-right: .2em;
|
926
|
-
|
927
|
-
opacity: .2;
|
830
|
+
opacity: .5;
|
928
831
|
cursor: pointer;
|
929
|
-
font-size: 14px
|
930
832
|
}
|
931
833
|
.rickshaw_legend .line.disabled {
|
932
834
|
opacity: .4
|
data/web/locales/en.yml
CHANGED
@@ -27,7 +27,7 @@ en: # <---- change this to your locale code
|
|
27
27
|
Delete: Delete
|
28
28
|
AddToQueue: Add to queue
|
29
29
|
AreYouSureDeleteJob: Are you sure you want to delete this job?
|
30
|
-
AreYouSureDeleteQueue: Are you sure you want to delete the %{queue} queue?
|
30
|
+
AreYouSureDeleteQueue: Are you sure you want to delete the %{queue} queue? This will delete all jobs within the queue, it will reappear if you push more jobs to it in the future.
|
31
31
|
Queues: Queues
|
32
32
|
Size: Size
|
33
33
|
Actions: Actions
|
data/web/views/_footer.erb
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
<p class="navbar-text redis-url" title="<%= redis_connection_and_namespace %>"><%= redis_connection_and_namespace %></p>
|
10
10
|
</li>
|
11
11
|
<li>
|
12
|
-
<p class="navbar-text server-utc-time"><%= server_utc_time %></p>
|
12
|
+
<p id="serverUtcTime" class="navbar-text server-utc-time"><%= server_utc_time %></p>
|
13
13
|
</li>
|
14
14
|
<li>
|
15
15
|
<p class="navbar-text"><a style="color: gray;" href="https://github.com/mperham/sidekiq/wiki">docs</a></p>
|