The current row design has two main drawbacks: - Its width is too large, making it difficult to display on smaller screens. - It shows the runner's display state, but customers without prior knowledge find it hard to understand. I converted some cells to two lines to make it more compact. Additionally, I replaced the display state with a clearer description. It now shows how many seconds the runner has been waiting to pick up a job or is currently running a job or waiting for idle capacity.
16 lines
352 B
Ruby
16 lines
352 B
Ruby
# frozen_string_literal: true
|
|
|
|
class Clover
|
|
def format_time_diff(start_time, end_time)
|
|
diff = (end_time - start_time).to_i
|
|
h, diff = diff.divmod(3600)
|
|
m, s = diff.divmod(60)
|
|
|
|
result = []
|
|
result << "#{h}h" if h > 0
|
|
result << "#{m}m" if m > 0
|
|
result << "#{s}s" if s > 0
|
|
result.empty? ? "0s" : result.join(" ")
|
|
end
|
|
end
|