Adapt dashboard to show idle and used runners
This commit is contained in:
@ -15,7 +15,18 @@ module Admin
|
||||
end
|
||||
|
||||
ExecutionEnvironment.order(:id).select(:id, :pool_size).map do |execution_environment|
|
||||
execution_environment.attributes.merge(quantity: pool_size[execution_environment.id])
|
||||
# Fetch the actual values (ID is stored as a symbol) or get an empty hash for merge
|
||||
actual = pool_size[execution_environment.id.to_s.to_sym] || {}
|
||||
|
||||
template = {
|
||||
id: execution_environment.id,
|
||||
prewarmingPoolSize: execution_environment.pool_size,
|
||||
idleRunners: 0,
|
||||
usedRunners: 0,
|
||||
}
|
||||
|
||||
# Existing values in the template get replaced with actual values
|
||||
template.merge(actual)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user