mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 06:04:11 +08:00
clean up formatting reports
This commit is contained in:
parent
6796b15857
commit
e9ba6e4e99
|
@ -15,7 +15,7 @@
|
||||||
<th style="width: 15%">Hostname:Pid</th>
|
<th style="width: 15%">Hostname:Pid</th>
|
||||||
<th style="width: 15%">Live Slots delta</th>
|
<th style="width: 15%">Live Slots delta</th>
|
||||||
<th style="width: 15%">Started At</th>
|
<th style="width: 15%">Started At</th>
|
||||||
<th style="width: 15%">Duration (ms)</th>
|
<th style="width: 15%">Duration</th>
|
||||||
<th style="width: 15%"></th>
|
<th style="width: 15%"></th>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
@ -28,11 +28,13 @@
|
||||||
<%= stat.live_slots_finish - stat.live_slots_start %>
|
<%= stat.live_slots_finish - stat.live_slots_start %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</td>
|
</td>
|
||||||
<td><%= relative_time stat.started_at %></td>
|
<td><%= sane_time stat.started_at %></td>
|
||||||
<td><%= stat.duration_ms %></td>
|
<td><%= sane_duration stat.duration_ms %></td>
|
||||||
<td>
|
<td>
|
||||||
<% if !stat.success %>
|
<% if stat.success.nil? %>
|
||||||
<span>FAILED</span>
|
RUNNING
|
||||||
|
<% elsif !stat.success %>
|
||||||
|
FAILED
|
||||||
<% end %>
|
<% end %>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
<%= @info.prev_result %>
|
<%= @info.prev_result %>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<%= @info.prev_duration %>
|
<%= sane_duration @info.prev_duration %>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<%= @info.current_owner %>
|
<%= @info.current_owner %>
|
||||||
|
|
|
@ -4,6 +4,23 @@ module Scheduler
|
||||||
VIEWS = File.expand_path('views', File.dirname(__FILE__)) unless defined? VIEWS
|
VIEWS = File.expand_path('views', File.dirname(__FILE__)) unless defined? VIEWS
|
||||||
|
|
||||||
def self.registered(app)
|
def self.registered(app)
|
||||||
|
|
||||||
|
app.helpers do
|
||||||
|
def sane_time(time)
|
||||||
|
return unless time
|
||||||
|
time
|
||||||
|
end
|
||||||
|
|
||||||
|
def sane_duration(duration)
|
||||||
|
return unless duration
|
||||||
|
if duration < 1000
|
||||||
|
"#{duration}ms"
|
||||||
|
elsif duration < 60*1000
|
||||||
|
"#{'%.2f' % (duration/1000.0)} secs"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
app.get "/scheduler" do
|
app.get "/scheduler" do
|
||||||
RailsMultisite::ConnectionManagement.with_connection("default") do
|
RailsMultisite::ConnectionManagement.with_connection("default") do
|
||||||
@manager = Scheduler::Manager.without_runner
|
@manager = Scheduler::Manager.without_runner
|
||||||
|
|
Loading…
Reference in New Issue
Block a user