katello 4.11.1 → 4.12.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of katello might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/app/assets/javascripts/katello/common/katello.global.js +1 -1
- data/app/assets/javascripts/katello/locale/bn/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/bn_IN/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/ca/katello.js +80 -86
- data/app/assets/javascripts/katello/locale/cs/katello.js +79 -85
- data/app/assets/javascripts/katello/locale/cs_CZ/katello.js +91 -88
- data/app/assets/javascripts/katello/locale/de/katello.js +97 -94
- data/app/assets/javascripts/katello/locale/de_AT/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/de_DE/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/el/katello.js +86 -86
- data/app/assets/javascripts/katello/locale/en/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/en_GB/katello.js +88 -85
- data/app/assets/javascripts/katello/locale/en_US/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/es/katello.js +94 -94
- data/app/assets/javascripts/katello/locale/et_EE/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/fr/katello.js +97 -94
- data/app/assets/javascripts/katello/locale/gl/katello.js +80 -86
- data/app/assets/javascripts/katello/locale/gu/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/he_IL/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/hi/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/id/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/it/katello.js +89 -86
- data/app/assets/javascripts/katello/locale/ja/katello.js +97 -94
- data/app/assets/javascripts/katello/locale/ka/katello.js +92 -92
- data/app/assets/javascripts/katello/locale/kn/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/ko/katello.js +91 -94
- data/app/assets/javascripts/katello/locale/locale/katello.js +1051 -1048
- data/app/assets/javascripts/katello/locale/ml_IN/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/mr/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/nl_NL/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/or/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/pa/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/pl/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/pl_PL/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/pt/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/pt_BR/katello.js +94 -94
- data/app/assets/javascripts/katello/locale/ro/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/ro_RO/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/ru/katello.js +91 -94
- data/app/assets/javascripts/katello/locale/sl/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/sv_SE/katello.js +80 -86
- data/app/assets/javascripts/katello/locale/ta/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/ta_IN/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/te/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/tr/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/vi/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/vi_VN/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/zh/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/zh_CN/katello.js +97 -94
- data/app/assets/javascripts/katello/locale/zh_TW/katello.js +91 -94
- data/app/assets/javascripts/katello/sync_management/index.js +0 -1
- data/app/assets/javascripts/katello/sync_management/sync_management.js +365 -308
- data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +1 -0
- data/app/controllers/katello/api/v2/content_views_controller.rb +1 -1
- data/app/controllers/katello/api/v2/debs_controller.rb +4 -0
- data/app/controllers/katello/api/v2/host_debs_controller.rb +13 -1
- data/app/controllers/katello/api/v2/host_subscriptions_controller.rb +13 -0
- data/app/controllers/katello/api/v2/organizations_controller.rb +1 -3
- data/app/controllers/katello/api/v2/repositories_controller.rb +2 -8
- data/app/controllers/katello/concerns/api/v2/registration_commands_controller_extensions.rb +0 -1
- data/app/controllers/katello/concerns/hosts_controller_extensions.rb +7 -3
- data/app/controllers/katello/concerns/organizations_controller_extensions.rb +1 -17
- data/app/helpers/katello/concerns/dashboard_helper_extensions.rb +0 -20
- data/app/lib/actions/katello/capsule_content/sync.rb +1 -1
- data/app/lib/actions/katello/content_view/promote.rb +1 -1
- data/app/lib/actions/katello/content_view/publish.rb +4 -4
- data/app/lib/actions/katello/content_view_version/auto_create_products.rb +4 -4
- data/app/lib/actions/katello/content_view_version/auto_create_redhat_repositories.rb +5 -5
- data/app/lib/actions/katello/content_view_version/auto_create_repositories.rb +5 -5
- data/app/lib/actions/katello/content_view_version/import.rb +14 -13
- data/app/lib/actions/katello/content_view_version/import_library.rb +4 -4
- data/app/lib/actions/katello/content_view_version/import_repository.rb +3 -3
- data/app/lib/actions/katello/content_view_version/reset_content_view_repositories_from_metadata.rb +2 -2
- data/app/lib/actions/katello/host/hypervisors_update.rb +0 -1
- data/app/lib/actions/katello/organization/manifest_delete.rb +1 -1
- data/app/lib/actions/katello/organization/manifest_refresh.rb +16 -16
- data/app/lib/actions/katello/repository/sync.rb +3 -5
- data/app/lib/actions/pulp3/orchestration/content_view_version/export.rb +20 -15
- data/app/lib/actions/pulp3/orchestration/content_view_version/export_library.rb +17 -14
- data/app/lib/actions/pulp3/orchestration/content_view_version/import.rb +11 -11
- data/app/lib/actions/pulp3/orchestration/repository/upload_content.rb +18 -13
- data/app/lib/actions/pulp3/repository/import_upload.rb +13 -5
- data/app/lib/actions/pulp3/repository/save_artifact.rb +23 -12
- data/app/lib/katello/api/v2/error_handling.rb +1 -1
- data/app/lib/katello/lazy_accessor.rb +6 -6
- data/app/lib/katello/resources/candlepin/owner.rb +2 -2
- data/app/mailers/katello/errata_mailer.rb +3 -3
- data/app/models/katello/concerns/host_managed_extensions.rb +74 -94
- data/app/models/katello/concerns/hostgroup_extensions.rb +9 -2
- data/app/models/katello/concerns/organization_extensions.rb +1 -1
- data/app/models/katello/concerns/pulp_database_unit.rb +1 -1
- data/app/models/katello/concerns/subscription_facet_host_extensions.rb +0 -27
- data/app/models/katello/content_view.rb +34 -47
- data/app/models/katello/content_view_version.rb +2 -0
- data/app/models/katello/deb.rb +8 -0
- data/app/models/katello/host/content_facet.rb +19 -14
- data/app/models/katello/host/subscription_facet.rb +0 -19
- data/app/models/katello/host_tracer.rb +9 -5
- data/app/models/katello/installed_deb.rb +13 -0
- data/app/models/katello/repository.rb +7 -2
- data/app/models/katello/trace_status.rb +6 -2
- data/app/overrides/add_organization_attributes.rb +0 -18
- data/app/presenters/katello/host_deb_presenter.rb +23 -0
- data/app/services/katello/candlepin/consumer.rb +0 -4
- data/app/services/katello/candlepin/event_handler.rb +6 -25
- data/app/services/katello/candlepin/message_handler.rb +1 -21
- data/app/services/katello/host/profiles_uploader.rb +17 -6
- data/app/services/katello/host_status_manager.rb +0 -22
- data/app/services/katello/organization_creator.rb +2 -2
- data/app/services/katello/pulp3/api/apt.rb +1 -1
- data/app/services/katello/pulp3/content_view_version/export.rb +2 -2
- data/app/services/katello/pulp3/content_view_version/metadata_generator.rb +1 -0
- data/app/services/katello/pulp3/content_view_version/metadata_map.rb +3 -0
- data/app/services/katello/pulp3/repository/apt.rb +16 -6
- data/app/services/katello/registration_manager.rb +1 -13
- data/app/views/katello/api/v2/content_views/base.json.rabl +0 -1
- data/app/views/katello/api/v2/content_views/show.json.rabl +1 -0
- data/app/views/katello/api/v2/host_debs/base.json.rabl +2 -0
- data/app/views/katello/api/v2/hosts/base.json.rabl +9 -0
- data/app/views/katello/api/v2/subscription_facet/base_with_root.json.rabl +0 -3
- data/app/views/katello/api/v2/subscription_facet/show.json.rabl +3 -0
- data/app/views/katello/sync_management/index.html.erb +14 -13
- data/app/views/overrides/activation_keys/_host_environment_select.html.erb +20 -16
- data/app/views/overrides/activation_keys/_host_synced_content_select.html.erb +7 -5
- data/app/views/overrides/organizations/_edit_override.html.erb +0 -12
- data/db/migrate/20131014225132_add_users_fields.rb +0 -1
- data/db/migrate/20150603045418_remove_user_fields.rb +0 -2
- data/db/migrate/20160404132250_remove_katello_from_notification_name.rb +4 -22
- data/db/migrate/20160505181337_rename_katello_settings.rb +2 -2
- data/db/migrate/20200818192230_update_system_purpose_status.rb +9 -3
- data/db/migrate/20240111032511_add_index_to_host_installed_packages.rb +16 -0
- data/db/migrate/20240123120109_remove_pulp_export_destination_setting.rb +9 -0
- data/db/migrate/20240207191223_remove_entitlement_mode_host_statuses.rb +30 -0
- data/db/seeds.d/111-upgrade_tasks.rb +2 -1
- data/engines/bastion/app/assets/javascripts/bastion/bastion.js +0 -2
- data/engines/bastion/app/views/bastion/layouts/assets.html.erb +6 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-repository-sets.controller.js +3 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/views/activation-key-associations-content-hosts.html +2 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/views/activation-key-details.html +0 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/bastion-katello-bootstrap.js +45 -29
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts-helper.service.js +0 -10
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-details.controller.js +0 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-info.html +2 -21
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-subscriptions.html +0 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts.html +0 -7
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/details/views/erratum-content-hosts.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/views/host-collection-add-hosts.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/views/host-collection-hosts-list.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/bastion_katello.pot +5 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +9 -1
- data/engines/bastion_katello/lib/bastion_katello/engine.rb +0 -6
- data/lib/katello/engine.rb +0 -3
- data/lib/katello/plugin.rb +3 -12
- data/lib/katello/tasks/rubocop.rake +0 -9
- data/lib/katello/tasks/unify_hosts.rake +0 -1
- data/lib/katello/tasks/upgrades/4.12/update_content_access_modes.rake +35 -0
- data/lib/katello/version.rb +1 -1
- data/locale/action_names.rb +12 -6
- data/locale/bn/katello.po +19 -28
- data/locale/bn_IN/katello.po +19 -28
- data/locale/ca/LC_MESSAGES/katello.mo +0 -0
- data/locale/ca/katello.po +20 -29
- data/locale/cs/katello.po +19 -29
- data/locale/cs_CZ/LC_MESSAGES/katello.mo +0 -0
- data/locale/cs_CZ/katello.po +20 -29
- data/locale/de/LC_MESSAGES/katello.mo +0 -0
- data/locale/de/katello.po +20 -29
- data/locale/de_AT/katello.po +19 -28
- data/locale/de_DE/katello.po +19 -28
- data/locale/el/LC_MESSAGES/katello.mo +0 -0
- data/locale/el/katello.po +20 -29
- data/locale/en/katello.po +19 -28
- data/locale/en_GB/LC_MESSAGES/katello.mo +0 -0
- data/locale/en_GB/katello.po +19 -28
- data/locale/en_US/katello.po +19 -28
- data/locale/es/LC_MESSAGES/katello.mo +0 -0
- data/locale/es/katello.po +20 -29
- data/locale/et_EE/katello.po +19 -28
- data/locale/fr/LC_MESSAGES/katello.mo +0 -0
- data/locale/fr/katello.po +20 -29
- data/locale/gl/LC_MESSAGES/katello.mo +0 -0
- data/locale/gl/katello.po +20 -29
- data/locale/gu/katello.po +19 -28
- data/locale/he_IL/katello.po +19 -28
- data/locale/hi/katello.po +19 -28
- data/locale/id/katello.po +19 -28
- data/locale/it/LC_MESSAGES/katello.mo +0 -0
- data/locale/it/katello.po +20 -29
- data/locale/ja/LC_MESSAGES/katello.mo +0 -0
- data/locale/ja/katello.po +20 -29
- data/locale/ka/LC_MESSAGES/katello.mo +0 -0
- data/locale/ka/katello.po +20 -29
- data/locale/katello.pot +363 -348
- data/locale/kn/katello.po +19 -28
- data/locale/ko/LC_MESSAGES/katello.mo +0 -0
- data/locale/ko/katello.po +20 -29
- data/locale/ml_IN/katello.po +19 -28
- data/locale/mr/katello.po +19 -28
- data/locale/nl_NL/katello.po +19 -28
- data/locale/or/katello.po +19 -28
- data/locale/pa/katello.po +19 -28
- data/locale/pl/katello.po +19 -28
- data/locale/pl_PL/katello.po +19 -28
- data/locale/pt/katello.po +19 -28
- data/locale/pt_BR/LC_MESSAGES/katello.mo +0 -0
- data/locale/pt_BR/katello.po +20 -29
- data/locale/ro/katello.po +19 -28
- data/locale/ro_RO/katello.po +19 -28
- data/locale/ru/LC_MESSAGES/katello.mo +0 -0
- data/locale/ru/katello.po +20 -29
- data/locale/sl/katello.po +19 -28
- data/locale/sv_SE/LC_MESSAGES/katello.mo +0 -0
- data/locale/sv_SE/katello.po +20 -29
- data/locale/ta/katello.po +19 -28
- data/locale/ta_IN/katello.po +19 -28
- data/locale/te/katello.po +19 -28
- data/locale/tr/katello.po +19 -28
- data/locale/vi/katello.po +19 -28
- data/locale/vi_VN/katello.po +19 -28
- data/locale/zh/katello.po +19 -28
- data/locale/zh_CN/LC_MESSAGES/katello.mo +0 -0
- data/locale/zh_CN/katello.po +20 -29
- data/locale/zh_TW/LC_MESSAGES/katello.mo +0 -0
- data/locale/zh_TW/katello.po +20 -29
- data/package.json +0 -1
- data/webpack/components/extensions/HostDetails/Tabs/ContentTab/SecondaryTabsRoutes.js +4 -0
- data/webpack/components/extensions/HostDetails/Tabs/ContentTab/constants.js +4 -1
- data/webpack/components/extensions/HostDetails/Tabs/DebsTab/DebInstallModal.js +250 -0
- data/webpack/components/extensions/HostDetails/Tabs/DebsTab/DebInstallModal.scss +3 -0
- data/webpack/components/extensions/HostDetails/Tabs/DebsTab/DebsTab.js +585 -0
- data/webpack/components/extensions/HostDetails/Tabs/DebsTab/DebsTab.scss +12 -0
- data/webpack/components/extensions/HostDetails/Tabs/DebsTab/HostDebsActions.js +13 -0
- data/webpack/components/extensions/HostDetails/Tabs/DebsTab/HostDebsConstants.js +13 -0
- data/webpack/components/extensions/HostDetails/Tabs/DebsTab/HostDebsSelectors.js +16 -0
- data/webpack/components/extensions/HostDetails/Tabs/DebsTab/InstallableDebsActions.js +17 -0
- data/webpack/components/extensions/HostDetails/Tabs/DebsTab/InstallableDebsConstants.js +3 -0
- data/webpack/components/extensions/HostDetails/Tabs/DebsTab/InstallableDebsSelectors.js +16 -0
- data/webpack/components/extensions/HostDetails/Tabs/ModuleStreamsTab/ModuleStreamsTab.js +1 -8
- data/webpack/components/extensions/HostDetails/Tabs/PackagesTab/PackagesTab.js +2 -0
- data/webpack/components/extensions/HostDetails/Tabs/RepositorySetsTab/RepositorySetsActions.js +2 -0
- data/webpack/components/extensions/HostDetails/Tabs/RepositorySetsTab/RepositorySetsTab.js +6 -19
- data/webpack/components/extensions/HostDetails/Tabs/TracesTab/TracesTab.js +13 -5
- data/webpack/components/extensions/HostDetails/Tabs/__tests__/debs.fixtures.json +31 -0
- data/webpack/components/extensions/HostDetails/Tabs/__tests__/debsInstallModal.test.js +226 -0
- data/webpack/components/extensions/HostDetails/Tabs/__tests__/debsTab.test.js +420 -0
- data/webpack/components/extensions/HostDetails/Tabs/__tests__/installableDebs.fixtures.json +63 -0
- data/webpack/components/extensions/HostDetails/Tabs/__tests__/repositorySetsTab.test.js +34 -5
- data/webpack/components/extensions/HostDetails/Tabs/__tests__/traces.fixtures.json +11 -1
- data/webpack/components/extensions/HostDetails/Tabs/__tests__/tracesTab.test.js +63 -3
- data/webpack/scenes/ContentViews/ContentViewsConstants.js +3 -0
- data/webpack/scenes/ContentViews/Delete/__tests__/affectedHosts.fixtures.json +0 -13
- data/webpack/scenes/ContentViews/Details/ContentViewDetailActions.js +23 -1
- data/webpack/scenes/ContentViews/Details/ContentViewDetailSelectors.js +19 -1
- data/webpack/scenes/ContentViews/Details/Versions/BulkDelete/__tests__/hosts.fixtures.json +0 -13
- data/webpack/scenes/ContentViews/Details/Versions/Compare/CVVersionCompareConfig.js +37 -3
- data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersionContent.js +10 -2
- data/webpack/scenes/ContentViews/Details/Versions/Delete/__tests__/cvAffectedHosts.fixture.json +0 -13
- data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionDetailConfig.js +31 -5
- data/webpack/scenes/Organizations/OrganizationSelectors.js +0 -3
- data/webpack/scenes/Subscriptions/Manifest/index.js +1 -4
- data/webpack/scenes/Subscriptions/SubscriptionsPage.js +3 -25
- data/webpack/scenes/Subscriptions/SubscriptionsSelectors.js +0 -3
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionsSelectors.test.js +0 -3
- data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsPage.test.js.snap +0 -22
- data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsSelectors.test.js.snap +0 -3
- data/webpack/scenes/Subscriptions/index.js +1 -2
- metadata +48 -195
- data/app/controllers/katello/concerns/content_facet_hosts_controller_extensions.rb +0 -22
- data/app/models/katello/concerns/widget_extensions.rb +0 -23
- data/app/models/katello/purpose_addons_status.rb +0 -28
- data/app/models/katello/purpose_role_status.rb +0 -28
- data/app/models/katello/purpose_sla_status.rb +0 -28
- data/app/models/katello/purpose_status.rb +0 -71
- data/app/models/katello/purpose_usage_status.rb +0 -28
- data/app/models/katello/subscription_status.rb +0 -71
- data/app/services/katello/candlepin/system_purpose.rb +0 -49
- data/app/views/dashboard/_subscription_status_widget.html.erb +0 -37
- data/app/views/dashboard/_subscription_widget.html.erb +0 -85
- data/app/views/overrides/organizations/_index_header_override.html.erb +0 -3
- data/app/views/overrides/organizations/_index_row_override.html.erb +0 -3
- data/app/views/overrides/organizations/_step_1_override.html.erb +0 -10
- data/config/locales/README +0 -10
- data/config/locales/bn.yml +0 -182
- data/config/locales/compare_upstream.sh +0 -21
- data/config/locales/cs.yml +0 -211
- data/config/locales/de.yml +0 -203
- data/config/locales/en.yml +0 -205
- data/config/locales/es.yml +0 -199
- data/config/locales/fr.yml +0 -222
- data/config/locales/gu.yml +0 -181
- data/config/locales/hi.yml +0 -199
- data/config/locales/it.yml +0 -205
- data/config/locales/ja.yml +0 -197
- data/config/locales/kn.yml +0 -199
- data/config/locales/ko.yml +0 -197
- data/config/locales/mr.yml +0 -178
- data/config/locales/or.yml +0 -181
- data/config/locales/pa.yml +0 -181
- data/config/locales/pt-BR.yml +0 -207
- data/config/locales/pt.yml +0 -207
- data/config/locales/ru.yml +0 -257
- data/config/locales/ta.yml +0 -181
- data/config/locales/te.yml +0 -181
- data/config/locales/update.sh +0 -14
- data/config/locales/zh-CN.yml +0 -199
- data/config/locales/zh-TW.yml +0 -199
- data/engines/bastion/app/assets/javascripts/bastion/bastion-bootstrap.js +0 -17
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/content-access-mode-banner.directive.js +0 -22
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/content-access-mode-banner.html +0 -10
- data/webpack/scenes/Subscriptions/Manifest/SimpleContentAccess.js +0 -96
@@ -1,343 +1,400 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
KT.content = (function () {
|
2
|
+
var draw_syncing = function (repo_id, progress, task_id) {
|
3
|
+
var element = $("#repo-" + repo_id).find(".result"),
|
4
|
+
cancelButton = $("<a/>").attr("class", "cancel_sync").text(katelloI18n.cancel),
|
5
|
+
progressBar = $("<a/>").attr("class", "progress").text(" ");
|
3
6
|
|
4
|
-
|
5
|
-
|
6
|
-
if (status.is_running) {
|
7
|
-
ids.push(repo_id);
|
8
|
-
KT.content.draw_syncing(repo_id, status.progress.progress, status.sync_id);
|
7
|
+
if (task_id !== undefined) {
|
8
|
+
progressBar.attr("href", tfm.tools.foremanUrl("/foreman_tasks/tasks/" + task_id));
|
9
9
|
}
|
10
|
-
});
|
11
|
-
KT.content.reset_products(KT.repo_status);
|
12
|
-
KT.content_actions.addSyncing(ids);
|
13
10
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
11
|
+
progress = progress ? progress : 0;
|
12
|
+
progressBar.progressbar({
|
13
|
+
value: progress,
|
14
|
+
});
|
15
|
+
element.find(".result-info").html("");
|
16
|
+
element.find(".result-info").append(progressBar);
|
17
|
+
element.find(".info-tipsy").addClass("hidden");
|
18
18
|
|
19
|
-
|
20
|
-
|
19
|
+
if (KT.permissions.syncable) {
|
20
|
+
element.find(".result-info").append(cancelButton);
|
21
|
+
}
|
22
|
+
},
|
23
|
+
updateRepo = function (
|
24
|
+
repo_id,
|
25
|
+
starttime,
|
26
|
+
duration,
|
27
|
+
progress,
|
28
|
+
display_size,
|
29
|
+
packages,
|
30
|
+
size,
|
31
|
+
task_id
|
32
|
+
) {
|
33
|
+
var repo = $("#repo-" + repo_id);
|
34
|
+
update_item(repo, starttime, duration, progress, display_size, packages, size, task_id);
|
35
|
+
},
|
36
|
+
finishRepo = function (repo_id, state, duration, raw_state, error_details, task_id) {
|
37
|
+
var element = $("#repo-" + repo_id);
|
38
|
+
var messages = [];
|
39
|
+
var url = tfm.tools.foremanUrl("/foreman_tasks/tasks/" + task_id);
|
40
|
+
state = '<a href="' + url + '">' + state + "</a>";
|
41
|
+
element.find(".result .result-info").html(state);
|
42
|
+
fadeUpdate(element.find(".duration"), duration);
|
21
43
|
|
22
|
-
|
23
|
-
|
24
|
-
KT.content_actions.cancelSync(repo_id, $(this));
|
25
|
-
});
|
44
|
+
if (raw_state === "error") {
|
45
|
+
element.find(".result .info-tipsy").removeClass("hidden");
|
26
46
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
$.each(data, function(index, item){
|
31
|
-
ids.push(item.id);
|
32
|
-
KT.content.draw_syncing(item.id, 0, undefined);
|
33
|
-
KT.content.updateProduct(item.product_id, false, 0);
|
34
|
-
});
|
35
|
-
KT.content_actions.addSyncing(ids);
|
36
|
-
})
|
37
|
-
.bind("ajax:beforeSend",
|
38
|
-
function(evt, data, status, xhr) {
|
39
|
-
if ($("input[name='repoids[]']:checked").length === 0) {
|
40
|
-
return false;
|
41
|
-
}
|
42
|
-
});
|
47
|
+
KT.utils.forEach(error_details["messages"], function (message) {
|
48
|
+
messages.push("<li>" + message + "</li>");
|
49
|
+
});
|
43
50
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
51
|
+
element.find(".result .info-tipsy ul").html(messages.join(""));
|
52
|
+
}
|
53
|
+
},
|
54
|
+
update_item = function (
|
55
|
+
element,
|
56
|
+
starttime,
|
57
|
+
duration,
|
58
|
+
progress,
|
59
|
+
display_size,
|
60
|
+
packages,
|
61
|
+
size,
|
62
|
+
task_id
|
63
|
+
) {
|
64
|
+
var pg = element.find(".progress"),
|
65
|
+
value = pg.find(".ui-progressbar-value");
|
55
66
|
|
56
|
-
|
57
|
-
$(checkbox).click(KT.content.select_repo);
|
58
|
-
});
|
67
|
+
starttime = starttime === null ? katelloI18n.no_start_time : starttime;
|
59
68
|
|
60
|
-
|
69
|
+
if (task_id !== undefined) {
|
70
|
+
pg.attr("href", tfm.tools.foremanUrl("/foreman_tasks/tasks/" + task_id));
|
71
|
+
}
|
61
72
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
73
|
+
fadeUpdate(element.find(".start_time"), starttime);
|
74
|
+
// clear duration during active sync
|
75
|
+
fadeUpdate(element.find(".duration"), "");
|
76
|
+
fadeUpdate(element.find(".size"), display_size);
|
77
|
+
element.find(".size").data("size", size);
|
78
|
+
element
|
79
|
+
.find(".info-tipsy")
|
80
|
+
.attr("href", tfm.tools.foremanUrl("/foreman_tasks/tasks/" + task_id));
|
81
|
+
progress = progress === 100 ? 99 : progress;
|
82
|
+
value.show();
|
83
|
+
value.animate({ width: progress }, { queue: false, duration: "slow", easing: "easeInSine" });
|
67
84
|
},
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
85
|
+
updateProduct = function (prod_id, done, percent, size) {
|
86
|
+
var product_element = $("#product-" + prod_id),
|
87
|
+
element = product_element.find(".result"),
|
88
|
+
oldpg = element.find(".progress");
|
89
|
+
|
90
|
+
if (size) {
|
91
|
+
size = KT.utils.reduce(
|
92
|
+
$("table")
|
93
|
+
.find("[data-product_id=" + prod_id + "]")
|
94
|
+
.find(".size"),
|
95
|
+
function (memo, num) {
|
96
|
+
return $(num).data("size") + memo;
|
97
|
+
},
|
98
|
+
0
|
99
|
+
);
|
100
|
+
fadeUpdate(product_element.find(".size"), KT.common.to_human_readable_bytes(size));
|
101
|
+
} else if (done) {
|
102
|
+
element.html("");
|
103
|
+
} else {
|
104
|
+
if (oldpg.length === 0) {
|
105
|
+
element.html($("<div/>").attr("class", "progress").text(" "));
|
106
|
+
element.find(".progress").progressbar({ value: 0 });
|
107
|
+
} else {
|
108
|
+
var value = oldpg.find(".ui-progressbar-value");
|
109
|
+
percent = percent === 100 ? 99 : percent;
|
110
|
+
value.animate(
|
111
|
+
{ width: percent },
|
112
|
+
{ queue: false, duration: "slow", easing: "easeInSine" }
|
113
|
+
);
|
82
114
|
}
|
83
|
-
},
|
84
|
-
removeSyncing = function(repo_id){
|
85
|
-
syncing.splice($.inArray(repo_id + "", syncing), 1);
|
86
|
-
if (syncing.length === 0 && updater){
|
87
|
-
updater.stop();
|
88
115
|
}
|
89
116
|
},
|
90
|
-
|
91
|
-
|
117
|
+
fadeUpdate = function (element, text) {
|
118
|
+
//element.fadeOut('fast').text(text);
|
119
|
+
//element.fadeIn('fast');
|
120
|
+
element.text(text);
|
92
121
|
},
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
122
|
+
select_all = function () {
|
123
|
+
$("#products_table").find("input[type=checkbox]").prop("checked", true);
|
124
|
+
KT.content.select_repo();
|
125
|
+
},
|
126
|
+
select_none = function () {
|
127
|
+
$("#products_table").find("input[type=checkbox]").removeAttr("checked");
|
128
|
+
KT.content.select_repo();
|
129
|
+
},
|
130
|
+
select_repo = function () {
|
131
|
+
if ($("input[name='repoids[]']:checked").length > 0) {
|
132
|
+
$("#sync_button").removeClass("disabled");
|
133
|
+
} else {
|
134
|
+
$("#sync_button").addClass("disabled");
|
135
|
+
}
|
136
|
+
},
|
137
|
+
reset_products = function (status_set) {
|
138
|
+
var products = {};
|
139
|
+
$.each(status_set, function (index, item) {
|
140
|
+
var pid = item.product_id;
|
141
|
+
if (products[pid] === undefined) {
|
142
|
+
products[pid] = [];
|
143
|
+
}
|
144
|
+
if (item.is_running) {
|
145
|
+
products[pid].push(item.progress.progress);
|
109
146
|
}
|
147
|
+
});
|
148
|
+
$.each(products, function (prod_id, percentages) {
|
149
|
+
var total = 0;
|
150
|
+
$.each(percentages, function (i, val) {
|
151
|
+
total += val;
|
152
|
+
});
|
153
|
+
updateProduct(prod_id, percentages.length === 0, total / percentages.length);
|
154
|
+
});
|
110
155
|
},
|
111
|
-
|
112
|
-
|
113
|
-
|
156
|
+
showOnlySyncing = function () {
|
157
|
+
$("#products_table").find("tbody").find("tr").hide();
|
158
|
+
$.each(KT.content_actions.getSyncing(), function (index, repoid) {
|
159
|
+
var repo = $("#repo-" + repoid);
|
160
|
+
showChain(repo);
|
161
|
+
});
|
162
|
+
},
|
163
|
+
showChain = function (element) {
|
164
|
+
element.show().addClass("expanded").removeClass("collapsed");
|
165
|
+
$.each(element.attr("class").split(" "), function (index, claz) {
|
166
|
+
if (claz.indexOf("child-of-") === 0) {
|
167
|
+
var found = claz.split("child-of-")[1];
|
168
|
+
showChain($("#" + found));
|
114
169
|
}
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
return;
|
125
|
-
}
|
126
|
-
$.each(data, function(index, repo){
|
127
|
-
// Only stop when we reach 100% and the finish_time is done sometimes they are not both complete
|
128
|
-
if (!repo.is_running && (repo.raw_state !== 'waiting')) {
|
129
|
-
removeSyncing(repo.id);
|
130
|
-
KT.content.updateRepo(repo.id, repo.start_time, repo.duration, repo.progress.progress, repo.display_size, repo.packages, repo.size, repo.sync_id);
|
131
|
-
KT.content.finishRepo(repo.id, repo.state, repo.duration, repo.raw_state, repo.error_details, repo.sync_id);
|
132
|
-
KT.content.updateProduct(repo.product_id, false, false, true);
|
133
|
-
}
|
134
|
-
else {
|
135
|
-
KT.content.updateRepo( repo.id,
|
136
|
-
repo.start_time,
|
137
|
-
repo.duration,
|
138
|
-
repo.progress.progress,
|
139
|
-
repo.display_size,
|
140
|
-
repo.packages,
|
141
|
-
repo.size,
|
142
|
-
repo.sync_id);
|
143
|
-
}
|
144
|
-
});
|
145
|
-
KT.content.reset_products(data);
|
146
|
-
},
|
147
|
-
function(){
|
148
|
-
updater.stop();
|
149
|
-
}
|
150
|
-
);
|
170
|
+
});
|
171
|
+
},
|
172
|
+
showAll = function () {
|
173
|
+
var rows = $("#products_table")
|
174
|
+
.find("tbody")
|
175
|
+
.find("tr")
|
176
|
+
.show()
|
177
|
+
.removeClass("expanded")
|
178
|
+
.addClass("collapsed");
|
151
179
|
|
180
|
+
$("#products_table").treeTable({
|
181
|
+
clickableNodeNames: true,
|
182
|
+
indent: 15,
|
183
|
+
});
|
184
|
+
},
|
185
|
+
expand_all = function () {
|
186
|
+
var sync_toggle = $("#sync_toggle");
|
187
|
+
if ($(sync_toggle).is(":checked")) {
|
188
|
+
$(sync_toggle).removeAttr("checked");
|
189
|
+
KT.content.showAll();
|
190
|
+
}
|
191
|
+
$("#products_table")
|
192
|
+
.find("tr")
|
193
|
+
.removeClass("collapsed")
|
194
|
+
.addClass("expanded")
|
195
|
+
.each(function () {
|
196
|
+
$(this).expand();
|
197
|
+
});
|
198
|
+
},
|
199
|
+
collapse_all = function () {
|
200
|
+
$("#products_table")
|
201
|
+
.find("tr")
|
202
|
+
.removeClass("expanded")
|
203
|
+
.addClass("collapsed")
|
204
|
+
.each(function () {
|
205
|
+
$(this).collapse();
|
206
|
+
});
|
152
207
|
};
|
153
208
|
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
209
|
+
return {
|
210
|
+
updateProduct: updateProduct,
|
211
|
+
updateRepo: updateRepo,
|
212
|
+
finishRepo: finishRepo,
|
213
|
+
select_all: select_all,
|
214
|
+
select_none: select_none,
|
215
|
+
select_repo: select_repo,
|
216
|
+
draw_syncing: draw_syncing,
|
217
|
+
reset_products: reset_products,
|
218
|
+
showOnlySyncing: showOnlySyncing,
|
219
|
+
showAll: showAll,
|
220
|
+
expand_all: expand_all,
|
221
|
+
collapse_all: collapse_all,
|
222
|
+
};
|
160
223
|
})();
|
224
|
+
// Setup initial state
|
161
225
|
|
162
|
-
KT.
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
226
|
+
KT.content_actions = (function () {
|
227
|
+
var syncing = [],
|
228
|
+
updater,
|
229
|
+
getOrg = function () {
|
230
|
+
return $("#organization_id").val();
|
231
|
+
},
|
232
|
+
addSyncing = function (repo_ids) {
|
233
|
+
if (repo_ids.length === 0) {
|
234
|
+
return;
|
235
|
+
}
|
236
|
+
//nothing in the list before adding and updater already exists
|
237
|
+
var start = syncing.length === 0 && updater;
|
238
|
+
$.each(repo_ids, function (index, id) {
|
239
|
+
syncing.push(id + "");
|
240
|
+
});
|
241
|
+
if (!updater) {
|
242
|
+
startUpdater();
|
243
|
+
} else if (start) {
|
244
|
+
updater.restart();
|
245
|
+
}
|
246
|
+
},
|
247
|
+
removeSyncing = function (repo_id) {
|
248
|
+
syncing.splice($.inArray(repo_id + "", syncing), 1);
|
249
|
+
if (syncing.length === 0 && updater) {
|
250
|
+
updater.stop();
|
251
|
+
}
|
252
|
+
},
|
253
|
+
getSyncing = function () {
|
254
|
+
return syncing;
|
255
|
+
},
|
256
|
+
cancelSync = function (repo_id) {
|
257
|
+
var button = $("#repo-" + repo_id).find(".result .cancel_sync");
|
172
258
|
|
173
|
-
|
174
|
-
|
175
|
-
value: progress
|
176
|
-
});
|
177
|
-
element.find('.result-info').html("");
|
178
|
-
element.find('.result-info').append(progressBar);
|
179
|
-
element.find('.info-tipsy').addClass('hidden');
|
259
|
+
if (!$(button).hasClass("disabled")) {
|
260
|
+
button.addClass("disabled");
|
180
261
|
|
181
|
-
|
182
|
-
|
183
|
-
|
262
|
+
$.ajax({
|
263
|
+
type: "DELETE",
|
264
|
+
url: tfm.tools.foremanUrl(
|
265
|
+
"/katello/sync_management/" + repo_id + "?organization_id=" + getOrg()
|
266
|
+
),
|
267
|
+
dataType: "json",
|
268
|
+
success: function (data) {},
|
269
|
+
error: function (data) {
|
270
|
+
button.removeClass("disabled");
|
271
|
+
},
|
272
|
+
});
|
273
|
+
}
|
274
|
+
},
|
275
|
+
startUpdater = function () {
|
276
|
+
if (syncing.length === 0) {
|
277
|
+
return;
|
278
|
+
}
|
279
|
+
var url = tfm.tools.foremanUrl("/katello/sync_management/sync_status");
|
280
|
+
updater = $.PeriodicalUpdater(
|
281
|
+
url,
|
282
|
+
{
|
283
|
+
data: function () {
|
284
|
+
return { repoids: getSyncing(), organization_id: getOrg() };
|
285
|
+
},
|
286
|
+
method: "get",
|
287
|
+
type: "json",
|
288
|
+
global: false,
|
184
289
|
},
|
185
|
-
|
186
|
-
|
187
|
-
|
290
|
+
function (data, success) {
|
291
|
+
if (success === "notmodified") {
|
292
|
+
return;
|
293
|
+
}
|
294
|
+
$.each(data, function (index, repo) {
|
295
|
+
// Only stop when we reach 100% and the finish_time is done sometimes they are not both complete
|
296
|
+
if (!repo.is_running && repo.raw_state !== "waiting") {
|
297
|
+
removeSyncing(repo.id);
|
298
|
+
KT.content.updateRepo(
|
299
|
+
repo.id,
|
300
|
+
repo.start_time,
|
301
|
+
repo.duration,
|
302
|
+
repo.progress.progress,
|
303
|
+
repo.display_size,
|
304
|
+
repo.packages,
|
305
|
+
repo.size,
|
306
|
+
repo.sync_id
|
307
|
+
);
|
308
|
+
KT.content.finishRepo(
|
309
|
+
repo.id,
|
310
|
+
repo.state,
|
311
|
+
repo.duration,
|
312
|
+
repo.raw_state,
|
313
|
+
repo.error_details,
|
314
|
+
repo.sync_id
|
315
|
+
);
|
316
|
+
KT.content.updateProduct(repo.product_id, false, false, true);
|
317
|
+
} else {
|
318
|
+
KT.content.updateRepo(
|
319
|
+
repo.id,
|
320
|
+
repo.start_time,
|
321
|
+
repo.duration,
|
322
|
+
repo.progress.progress,
|
323
|
+
repo.display_size,
|
324
|
+
repo.packages,
|
325
|
+
repo.size,
|
326
|
+
repo.sync_id
|
327
|
+
);
|
328
|
+
}
|
329
|
+
});
|
330
|
+
KT.content.reset_products(data);
|
188
331
|
},
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
element.find(".result .result-info").html(state);
|
195
|
-
fadeUpdate(element.find(".duration"), duration);
|
196
|
-
|
197
|
-
if (raw_state === 'error') {
|
198
|
-
element.find('.result .info-tipsy').removeClass('hidden');
|
332
|
+
function () {
|
333
|
+
updater.stop();
|
334
|
+
}
|
335
|
+
);
|
336
|
+
};
|
199
337
|
|
200
|
-
|
201
|
-
|
202
|
-
|
338
|
+
return {
|
339
|
+
cancelSync: cancelSync,
|
340
|
+
addSyncing: addSyncing,
|
341
|
+
startUpdater: startUpdater,
|
342
|
+
getSyncing: function () {
|
343
|
+
return syncing;
|
344
|
+
},
|
345
|
+
};
|
346
|
+
})();
|
203
347
|
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
348
|
+
var ids = [];
|
349
|
+
$.each(KT.repo_status, function (repo_id, status) {
|
350
|
+
if (status.is_running) {
|
351
|
+
ids.push(repo_id);
|
352
|
+
KT.content.draw_syncing(repo_id, status.progress.progress, status.sync_id);
|
353
|
+
}
|
354
|
+
});
|
355
|
+
KT.content.reset_products(KT.repo_status);
|
356
|
+
KT.content_actions.addSyncing(ids);
|
210
357
|
|
211
|
-
|
358
|
+
$("#select_all").click(KT.content.select_all);
|
359
|
+
$("#select_none").click(KT.content.select_none);
|
360
|
+
$("#collapse_all").click(KT.content.collapse_all);
|
361
|
+
$("#expand_all").click(KT.content.expand_all);
|
212
362
|
|
213
|
-
|
214
|
-
|
215
|
-
}
|
363
|
+
KT.content.showAll();
|
364
|
+
KT.content.select_repo();
|
216
365
|
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
element.find('.size').data('size', size);
|
222
|
-
element.find('.info-tipsy').attr('href', tfm.tools.foremanUrl('/foreman_tasks/tasks/' + task_id));
|
223
|
-
progress = progress === 100 ? 99 : progress;
|
224
|
-
value.show();
|
225
|
-
value.animate({'width': progress },{ queue:false,
|
226
|
-
duration:"slow", easing:"easeInSine" });
|
227
|
-
},
|
228
|
-
updateProduct = function (prod_id, done, percent, size) {
|
229
|
-
var product_element = $("#product-" + prod_id),
|
230
|
-
element = product_element.find(".result"),
|
231
|
-
oldpg = element.find('.progress');
|
366
|
+
$("#products_table").delegate(".cancel_sync", "click", function () {
|
367
|
+
var repo_id = $(this).parents("tr").attr("data-id");
|
368
|
+
KT.content_actions.cancelSync(repo_id, $(this));
|
369
|
+
});
|
232
370
|
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
duration:"slow", easing:"easeInSine" });
|
249
|
-
}
|
250
|
-
}
|
251
|
-
},
|
252
|
-
fadeUpdate = function(element, text) {
|
253
|
-
//element.fadeOut('fast').text(text);
|
254
|
-
//element.fadeIn('fast');
|
255
|
-
element.text(text);
|
256
|
-
},
|
257
|
-
select_all = function(){
|
258
|
-
$("#products_table").find("input[type=checkbox]").prop('checked',true);
|
259
|
-
KT.content.select_repo();
|
260
|
-
},
|
261
|
-
select_none = function(){
|
262
|
-
$("#products_table").find("input[type=checkbox]").removeAttr('checked');
|
263
|
-
KT.content.select_repo();
|
264
|
-
},
|
265
|
-
select_repo = function(){
|
266
|
-
if($("input[name='repoids[]']:checked").length > 0) {
|
267
|
-
$("#sync_button").removeClass("disabled");
|
268
|
-
} else {
|
269
|
-
$("#sync_button").addClass("disabled");
|
270
|
-
}
|
271
|
-
},
|
272
|
-
reset_products = function(status_set){
|
273
|
-
var products = {};
|
274
|
-
$.each(status_set, function(index, item){
|
275
|
-
var pid = item.product_id;
|
276
|
-
if(products[pid] === undefined){
|
277
|
-
products[pid] = [];
|
278
|
-
}
|
279
|
-
if (item.is_running){
|
280
|
-
products[pid].push(item.progress.progress);
|
281
|
-
}
|
282
|
-
});
|
283
|
-
$.each(products, function(prod_id, percentages){
|
284
|
-
var total = 0;
|
285
|
-
$.each(percentages, function(i, val){total += val;});
|
286
|
-
updateProduct(prod_id, percentages.length === 0, total/percentages.length);
|
287
|
-
});
|
288
|
-
},
|
289
|
-
showOnlySyncing = function(){
|
290
|
-
$("#products_table").find("tbody").find("tr").hide();
|
291
|
-
$.each(KT.content_actions.getSyncing(), function(index, repoid){
|
292
|
-
var repo = $("#repo-" + repoid);
|
293
|
-
showChain(repo);
|
294
|
-
});
|
295
|
-
},
|
296
|
-
showChain = function(element){
|
297
|
-
element.show().addClass("expanded").removeClass("collapsed");
|
298
|
-
$.each(element.attr("class").split(" "), function(index, claz){
|
299
|
-
if (claz.indexOf("child-of-") === 0){
|
300
|
-
var found = claz.split("child-of-")[1];
|
301
|
-
showChain($("#" + found));
|
302
|
-
}
|
303
|
-
});
|
304
|
-
},
|
305
|
-
showAll = function(){
|
306
|
-
var rows = $("#products_table").find("tbody").find("tr").show().removeClass("expanded").addClass("collapsed");
|
371
|
+
$("#sync_product_form")
|
372
|
+
.bind("ajax:success", function (evt, data, status, xhr) {
|
373
|
+
var ids = [];
|
374
|
+
$.each(data, function (index, item) {
|
375
|
+
ids.push(item.id);
|
376
|
+
KT.content.draw_syncing(item.id, 0, undefined);
|
377
|
+
KT.content.updateProduct(item.product_id, false, 0);
|
378
|
+
});
|
379
|
+
KT.content_actions.addSyncing(ids);
|
380
|
+
})
|
381
|
+
.bind("ajax:beforeSend", function (evt, data, status, xhr) {
|
382
|
+
if ($("input[name='repoids[]']:checked").length === 0) {
|
383
|
+
return false;
|
384
|
+
}
|
385
|
+
});
|
307
386
|
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
}
|
319
|
-
$("#products_table").find("tr").removeClass("collapsed").addClass("expanded").each(function(){
|
320
|
-
$(this).expand();
|
321
|
-
});
|
322
|
-
},
|
323
|
-
collapse_all = function() {
|
324
|
-
$("#products_table").find("tr").removeClass("expanded").addClass("collapsed").each(function(){
|
325
|
-
$(this).collapse();
|
326
|
-
});
|
327
|
-
};
|
387
|
+
$("#sync_toggle").change(function () {
|
388
|
+
var img = "<img src='" + KT.common.spinner_path() + "'>";
|
389
|
+
$("#sync_toggle_cont").append(img);
|
390
|
+
if ($(this).is(":checked")) {
|
391
|
+
KT.content.showOnlySyncing();
|
392
|
+
} else {
|
393
|
+
KT.content.showAll();
|
394
|
+
}
|
395
|
+
$("#sync_toggle_cont").find("img").remove();
|
396
|
+
});
|
328
397
|
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
finishRepo: finishRepo,
|
333
|
-
select_all : select_all,
|
334
|
-
select_none: select_none,
|
335
|
-
select_repo: select_repo,
|
336
|
-
draw_syncing: draw_syncing,
|
337
|
-
reset_products: reset_products,
|
338
|
-
showOnlySyncing: showOnlySyncing,
|
339
|
-
showAll: showAll,
|
340
|
-
expand_all: expand_all,
|
341
|
-
collapse_all: collapse_all
|
342
|
-
};
|
343
|
-
})();
|
398
|
+
$.each($("input[name='repoids[]']"), function (index, checkbox) {
|
399
|
+
$(checkbox).click(KT.content.select_repo);
|
400
|
+
});
|