feat(flows): ren statusfunktion + farver til Flows-listen
This commit is contained in:
@@ -166,3 +166,22 @@ function ADFlowView.wrapText(text, maxChars)
|
||||
if line ~= indent then table.insert(lines, line) end
|
||||
return lines
|
||||
end
|
||||
|
||||
-- ---- status pr. flow (Flows-listen) ----
|
||||
|
||||
ADFlowView.LEVEL_COLORS = {
|
||||
running = {0.30, 0.75, 0.35, 1},
|
||||
waiting = {0.95, 0.80, 0.25, 1},
|
||||
error = {0.90, 0.35, 0.30, 1},
|
||||
stopped = {0.55, 0.55, 0.55, 1},
|
||||
}
|
||||
|
||||
-- s = {running, total, stopped, canStop, warning, reason, lastStartFailed} -> "running"|"waiting"|"error"|"stopped"
|
||||
function ADFlowView.flowStatus(s)
|
||||
if s.stopped then return "stopped" end
|
||||
if s.warning ~= nil then return "error" end
|
||||
if (s.running or 0) == 0 and s.lastStartFailed then return "error" end
|
||||
if (s.running or 0) > 0 and s.reason == nil then return "running" end
|
||||
if (s.running or 0) > 0 or s.canStop then return "waiting" end
|
||||
return "stopped"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user