Class: Katello::SyncManagementController
Instance Method Summary
collapse
#arches, #collect_arches, #collect_minor, #collect_repos, #minors, #pprint_collection
#month, #months, #relative_time_in_words
#authorized, #current_organization, #current_organization=, #default_label, #default_label_assigned, #escape_html, #flash_to_headers, #format_time, #generate_label, #label_overridden, #n_gettext_for_generate_label, #no_env_available_msg, #parse_calendar_date, #permission_denied, #render_correct_nav
Instance Method Details
#destroy ⇒ Object
43
44
45
46
47
|
# File 'app/controllers/katello/sync_management_controller.rb', line 43
def destroy
repo = Repository.where(:id => params[:id]).syncable.first
repo.cancel_dynflow_sync if repo
render :text => ""
end
|
#index ⇒ Object
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'app/controllers/katello/sync_management_controller.rb', line 17
def index
org = current_organization
@products = org.library.products.readable
redhat_products, custom_products = @products.partition(&:redhat?)
redhat_products.sort_by { |p| p.name.downcase }
custom_products.sort_by { |p| p.name.downcase }
@products = redhat_products + custom_products
@product_size = {}
@repo_status = {}
@product_map = collect_repos(@products, org.library, false)
@products.each { |product| get_product_info(product) }
end
|
#section_id ⇒ Object
9
10
11
|
# File 'app/controllers/katello/sync_management_controller.rb', line 9
def section_id
'contents'
end
|
#sync ⇒ Object
32
33
34
35
|
# File 'app/controllers/katello/sync_management_controller.rb', line 32
def sync
tasks = sync_repos(params[:repoids]) || []
render :json => tasks.as_json
end
|
#sync_status ⇒ Object
37
38
39
40
41
|
# File 'app/controllers/katello/sync_management_controller.rb', line 37
def sync_status
repos = Repository.where(:id => params[:repoids]).readable
statuses = repos.map { |repo| format_sync_progress(repo) }
render :json => statuses.flatten.to_json
end
|
#title ⇒ Object
13
14
15
|
# File 'app/controllers/katello/sync_management_controller.rb', line 13
def title
_('Sync Status')
end
|