File tree Expand file tree Collapse file tree 3 files changed +7
-3
lines changed
Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ window.liveSocket = liveSocket;
5151// progressbar.js@1.0.0 version is used
5252// Docs: http://progressbarjs.readthedocs.org/en/1.0.0/
5353
54- window . loadStatusProgressBar = function ( divId ) {
54+ window . loadStatusProgressBar = function ( divId , isDown ) {
5555 console . log ( `Loading bar for id ${ divId } ` ) ;
5656 let bar = new ProgressBar . Circle ( `#${ divId } ` , {
5757 color : "#aaa" ,
@@ -65,7 +65,7 @@ window.loadStatusProgressBar = function(divId) {
6565 autoStyleContainer : false ,
6666 } ,
6767 from : { color : "#aaa" , width : 1 } ,
68- to : { color : "#5cb571" , width : 4 } , // #333
68+ to : { color : isDown ? "#d65c3a" : "#5cb571" , width : 4 } , // #333
6969
7070 // Set default step function for all animate calls
7171 step : function ( state , circle ) {
Original file line number Diff line number Diff line change 1919 </ tr >
2020 < script >
2121 window.addEventListener("load",function(event) {
22- loadStatusProgressBar ( "loading-container-<%= project.id %>" ) ;
22+ loadStatusProgressBar ( "loading-container-<%= project.id %>" , < % = is_down ( downtime ) % > ) ;
2323 } );
2424 </ script >
2525 <% end %>
Original file line number Diff line number Diff line change @@ -8,4 +8,8 @@ defmodule ZoutWeb.ProjectView do
88
99 def render_status ( % Downtime { status: status , start: start } ) ,
1010 do: "#{ status } since #{ DateTime . to_iso8601 ( start ) } "
11+
12+ def is_down ( nil ) , do: false
13+ def is_down ( % Downtime { status: :working } ) , do: false
14+ def is_down ( _ ) , do: true
1115end
You can’t perform that action at this time.
0 commit comments