2013-08-01 23:24:33 +01:00
|
|
|
now = Time.now.utc
|
|
|
|
json.build_lists @build_lists do |build_list|
|
2013-08-03 11:47:23 +01:00
|
|
|
json.(build_list, :id, :status, :project_id, :project_version, :save_to_platform_id, :save_to_repository_id, :user_id, :project_id, :build_for_platform_id, :arch_id)
|
2013-08-02 21:13:59 +01:00
|
|
|
json.commit_hash build_list.commit_hash.first(5)
|
|
|
|
json.last_published_commit_hash build_list.last_published_commit_hash.first(5) if build_list.last_published_commit_hash
|
2013-08-01 23:24:33 +01:00
|
|
|
|
|
|
|
if BuildList::HUMAN_STATUSES[build_list.status].in? [:build_pending, :build_started, :build_publish]
|
|
|
|
json.duration Time.diff(now, build_list.updated_at, '%h:%m')[:diff]
|
|
|
|
json.average_build_time build_list.formatted_average_build_time if build_list.build_started? && (build_list.average_build_time > 0)
|
|
|
|
end
|
|
|
|
|
2013-08-02 15:04:16 +01:00
|
|
|
json.version_release get_version_release(build_list)
|
2013-08-03 11:47:23 +01:00
|
|
|
json.updated_at build_list.updated_at.strftime('%d/%m/%Y')
|
|
|
|
end
|
2013-08-01 23:24:33 +01:00
|
|
|
|
2013-08-03 11:47:23 +01:00
|
|
|
json.dictionary do
|
|
|
|
json.users @build_lists.map(&:user).uniq do |user|
|
|
|
|
json.(user, :id, :uname, :fullname)
|
|
|
|
end
|
|
|
|
json.projects @build_lists.map(&:project).uniq.compact do |project|
|
|
|
|
json.(project, :id, :name_with_owner)
|
|
|
|
end
|
|
|
|
json.platforms (@build_lists.map(&:build_for_platform) | @build_lists.map(&:save_to_platform)) do |platform|
|
|
|
|
json.(platform, :id, :name)
|
|
|
|
json.personal platform.personal?
|
|
|
|
end
|
|
|
|
json.repositories @build_lists.map(&:save_to_repository) do |repository|
|
|
|
|
json.(repository, :id, :name)
|
|
|
|
end
|
|
|
|
json.arches Arch.all do |arch|
|
|
|
|
json.(arch, :id, :name)
|
2013-08-01 23:24:33 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
json.server_status @build_server_status
|
2013-08-02 19:13:41 +01:00
|
|
|
json.filter @filter.try(:options)
|
2013-08-05 13:34:01 +01:00
|
|
|
json.pages angularjs_will_paginate(@bls)
|