mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 20:36:39 +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%">Live Slots delta</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>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
@ -28,11 +28,13 @@
|
|||
<%= stat.live_slots_finish - stat.live_slots_start %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td><%= relative_time stat.started_at %></td>
|
||||
<td><%= stat.duration_ms %></td>
|
||||
<td><%= sane_time stat.started_at %></td>
|
||||
<td><%= sane_duration stat.duration_ms %></td>
|
||||
<td>
|
||||
<% if !stat.success %>
|
||||
<span>FAILED</span>
|
||||
<% if stat.success.nil? %>
|
||||
RUNNING
|
||||
<% elsif !stat.success %>
|
||||
FAILED
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
<%= @info.prev_result %>
|
||||
</td>
|
||||
<td>
|
||||
<%= @info.prev_duration %>
|
||||
<%= sane_duration @info.prev_duration %>
|
||||
</td>
|
||||
<td>
|
||||
<%= @info.current_owner %>
|
||||
|
|
|
@ -4,6 +4,23 @@ module Scheduler
|
|||
VIEWS = File.expand_path('views', File.dirname(__FILE__)) unless defined? VIEWS
|
||||
|
||||
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
|
||||
RailsMultisite::ConnectionManagement.with_connection("default") do
|
||||
@manager = Scheduler::Manager.without_runner
|
||||
|
|
Loading…
Reference in New Issue
Block a user