redhat_access 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (218) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +24 -0
  3. data/LICENSE.txt +620 -0
  4. data/README.rdoc +7 -0
  5. data/Rakefile +131 -0
  6. data/app/assets/javascripts/insights/app.module.js +64 -0
  7. data/app/assets/javascripts/insights/application.js +18 -0
  8. data/app/assets/javascripts/insights/configuration.controller.js +66 -0
  9. data/app/assets/javascripts/insights/configuration.service.js +28 -0
  10. data/app/assets/javascripts/insights/views/configuration.html +85 -0
  11. data/app/assets/javascripts/insights/views/error.html +13 -0
  12. data/app/assets/javascripts/insights/views/help.html +16 -0
  13. data/app/assets/javascripts/redhat_access/analytics_dashboard.js +2 -0
  14. data/app/assets/javascripts/redhat_access/application.js +15 -0
  15. data/app/assets/javascripts/redhat_access/redhat_access.module.js +126 -0
  16. data/app/assets/stylesheets/insights/application.css +14 -0
  17. data/app/assets/stylesheets/insights/insights.css +21 -0
  18. data/app/assets/stylesheets/redhat_access/application.css +14 -0
  19. data/app/assets/stylesheets/redhat_access/telemetry_configuration.css +4 -0
  20. data/app/controllers/redhat_access/analytics_dashboard_controller.rb +12 -0
  21. data/app/controllers/redhat_access/api/api_controller.rb +24 -0
  22. data/app/controllers/redhat_access/api/attachments_controller.rb +40 -0
  23. data/app/controllers/redhat_access/api/logs_controller.rb +49 -0
  24. data/app/controllers/redhat_access/api/machine_telemetry_api_controller.rb +112 -0
  25. data/app/controllers/redhat_access/api/strata_proxy_controller.rb +81 -0
  26. data/app/controllers/redhat_access/api/telemetry_api_controller.rb +179 -0
  27. data/app/controllers/redhat_access/application_controller.rb +2 -0
  28. data/app/controllers/redhat_access/cases_controller.rb +14 -0
  29. data/app/controllers/redhat_access/configuration_controller.rb +21 -0
  30. data/app/controllers/redhat_access/log_viewer_controller.rb +9 -0
  31. data/app/controllers/redhat_access/redhat_access_controller.rb +8 -0
  32. data/app/controllers/redhat_access/search_controller.rb +9 -0
  33. data/app/controllers/redhat_access/strata_credentials_controller.rb +48 -0
  34. data/app/controllers/redhat_access/telemetry_configurations_controller.rb +38 -0
  35. data/app/controllers/redhat_access/telemetry_controller.rb +6 -0
  36. data/app/helpers/redhat_access/analytics_dashboard_helper.rb +13 -0
  37. data/app/helpers/redhat_access/application_helper.rb +4 -0
  38. data/app/helpers/redhat_access/attachments_helper.rb +4 -0
  39. data/app/helpers/redhat_access/cases_helper.rb +4 -0
  40. data/app/helpers/redhat_access/log_viewer_helper.rb +4 -0
  41. data/app/helpers/redhat_access/logs_helper.rb +4 -0
  42. data/app/helpers/redhat_access/redhat_access_helper.rb +4 -0
  43. data/app/helpers/redhat_access/search_helper.rb +4 -0
  44. data/app/helpers/redhat_access/telemetry_configuration_helper.rb +4 -0
  45. data/app/models/redhat_access/concerns/organization_extensions.rb +10 -0
  46. data/app/models/redhat_access/telemetry_configuration.rb +11 -0
  47. data/app/models/redhat_access/telemetry_proxy_credentials.rb +10 -0
  48. data/app/services/redhat_access/authentication/client_authentication.rb +80 -0
  49. data/app/services/redhat_access/telemetry/look_ups.rb +233 -0
  50. data/app/services/redhat_access/telemetry/portal_client.rb +39 -0
  51. data/app/views/redhat_access/analytics_dashboard/configuration.html.erb +85 -0
  52. data/app/views/redhat_access/analytics_dashboard/error.html.erb +13 -0
  53. data/app/views/redhat_access/analytics_dashboard/help.html.erb +16 -0
  54. data/app/views/redhat_access/analytics_dashboard/index.html.erb +69 -0
  55. data/app/views/redhat_access/analytics_dashboard/welcome.html.erb +8 -0
  56. data/app/views/redhat_access/redhat_access/index.html.erb +34 -0
  57. data/ca/rh_cert-api_chain.pem +74 -0
  58. data/config/config.yml.example +15 -0
  59. data/config/environments/development.rb +5 -0
  60. data/config/initializers/load_config.rb +5 -0
  61. data/config/mount_engine.rb +3 -0
  62. data/config/routes.rb +36 -0
  63. data/db/migrate/20141204161152_create_redhat_access_telemetry_proxy_credentials.rb +11 -0
  64. data/db/migrate/20150319153744_create_redhat_access_telemetry_configurations.rb +13 -0
  65. data/db/migrate/20160425175501_add_email_to_telemetry_configurations.rb +5 -0
  66. data/db/seeds.d/200-update-insights-roles.rb +11 -0
  67. data/lib/redhat_access/configuration.rb +8 -0
  68. data/lib/redhat_access/engine.rb +225 -0
  69. data/lib/redhat_access/sos_reports/generator.rb +58 -0
  70. data/lib/redhat_access/strata/client.rb +39 -0
  71. data/lib/redhat_access/version.rb +3 -0
  72. data/lib/redhat_access.rb +5 -0
  73. data/lib/tasks/redhat_access_tasks.rake +41 -0
  74. data/locale/Makefile +62 -0
  75. data/locale/de/LC_MESSAGES/redhat_access.mo +0 -0
  76. data/locale/de/redhat_access.po +589 -0
  77. data/locale/es/LC_MESSAGES/redhat_access.mo +0 -0
  78. data/locale/es/redhat_access.po +589 -0
  79. data/locale/fr/LC_MESSAGES/redhat_access.mo +0 -0
  80. data/locale/fr/redhat_access.po +593 -0
  81. data/locale/gemspec.rb +2 -0
  82. data/locale/it/LC_MESSAGES/redhat_access.mo +0 -0
  83. data/locale/it/redhat_access.po +589 -0
  84. data/locale/ja/LC_MESSAGES/redhat_access.mo +0 -0
  85. data/locale/ja/redhat_access.po +569 -0
  86. data/locale/ko/LC_MESSAGES/redhat_access.mo +0 -0
  87. data/locale/ko/redhat_access.po +570 -0
  88. data/locale/pt/LC_MESSAGES/redhat_access.mo +0 -0
  89. data/locale/pt/redhat_access.po +588 -0
  90. data/locale/redhat_access.pot +34 -0
  91. data/locale/ru/LC_MESSAGES/redhat_access.mo +0 -0
  92. data/locale/ru/redhat_access.po +580 -0
  93. data/locale/zh/LC_MESSAGES/redhat_access.mo +0 -0
  94. data/locale/zh/redhat_access.po +561 -0
  95. data/redhat_access.gemspec +30 -0
  96. data/script/rails +8 -0
  97. data/script/sos_reports/foreman_sosreport.pam +9 -0
  98. data/script/sos_reports/foreman_sosreport_console.apps +3 -0
  99. data/script/sos_reports/foreman_sosreport_wrapper.py +65 -0
  100. data/test/dummy/README.rdoc +261 -0
  101. data/test/dummy/Rakefile +7 -0
  102. data/test/dummy/app/assets/javascripts/application.js +15 -0
  103. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  104. data/test/dummy/app/controllers/application_controller.rb +3 -0
  105. data/test/dummy/app/helpers/application_helper.rb +2 -0
  106. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  107. data/test/dummy/config/application.rb +59 -0
  108. data/test/dummy/config/boot.rb +10 -0
  109. data/test/dummy/config/database.yml +25 -0
  110. data/test/dummy/config/environment.rb +5 -0
  111. data/test/dummy/config/environments/development.rb +37 -0
  112. data/test/dummy/config/environments/production.rb +67 -0
  113. data/test/dummy/config/environments/test.rb +37 -0
  114. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  115. data/test/dummy/config/initializers/inflections.rb +15 -0
  116. data/test/dummy/config/initializers/mime_types.rb +5 -0
  117. data/test/dummy/config/initializers/secret_token.rb +7 -0
  118. data/test/dummy/config/initializers/session_store.rb +8 -0
  119. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  120. data/test/dummy/config/locales/en.yml +5 -0
  121. data/test/dummy/config/routes.rb +4 -0
  122. data/test/dummy/config.ru +4 -0
  123. data/test/dummy/public/404.html +26 -0
  124. data/test/dummy/public/422.html +26 -0
  125. data/test/dummy/public/500.html +25 -0
  126. data/test/dummy/public/favicon.ico +0 -0
  127. data/test/dummy/script/rails +6 -0
  128. data/test/fixtures/redhat_access/telemetry_configurations.yml +11 -0
  129. data/test/fixtures/redhat_access/telemetry_proxy_credentials.yml +11 -0
  130. data/test/functional/redhat_access/analytics_dashboard_controller_test.rb +11 -0
  131. data/test/functional/redhat_access/attachments_controller_test.rb +11 -0
  132. data/test/functional/redhat_access/cases_controller_test.rb +16 -0
  133. data/test/functional/redhat_access/configuration_controller_test.rb +11 -0
  134. data/test/functional/redhat_access/log_viewer_controller_test.rb +11 -0
  135. data/test/functional/redhat_access/logs_controller_test.rb +9 -0
  136. data/test/functional/redhat_access/redhat_access_controller_test.rb +11 -0
  137. data/test/functional/redhat_access/search_controller_test.rb +11 -0
  138. data/test/functional/redhat_access/telemetry_configuration_controller_test.rb +26 -0
  139. data/test/integration/navigation_test.rb +10 -0
  140. data/test/models/redhat_access/telemetry_proxy_credentials_test.rb +9 -0
  141. data/test/redhat_access_test.rb +7 -0
  142. data/test/sos-report-test.rb +32 -0
  143. data/test/test_helper.rb +15 -0
  144. data/test/unit/helpers/redhat_access/analytics_dashboard_helper_test.rb +6 -0
  145. data/test/unit/helpers/redhat_access/attachments_helper_test.rb +6 -0
  146. data/test/unit/helpers/redhat_access/cases_helper_test.rb +6 -0
  147. data/test/unit/helpers/redhat_access/log_viewer_helper_test.rb +6 -0
  148. data/test/unit/helpers/redhat_access/logs_helper_test.rb +6 -0
  149. data/test/unit/helpers/redhat_access/redhat_access_helper_test.rb +6 -0
  150. data/test/unit/helpers/redhat_access/search_helper_test.rb +6 -0
  151. data/test/unit/helpers/redhat_access/telemetry_configuration_helper_test.rb +6 -0
  152. data/test/unit/redhat_access/telemetry_configuration_test.rb +9 -0
  153. data/vendor/assets/fonts/fonts/FontAwesome.otf +0 -0
  154. data/vendor/assets/fonts/fonts/fontawesome-webfont.eot +0 -0
  155. data/vendor/assets/fonts/fonts/fontawesome-webfont.svg +655 -0
  156. data/vendor/assets/fonts/fonts/fontawesome-webfont.ttf +0 -0
  157. data/vendor/assets/fonts/fonts/fontawesome-webfont.woff +0 -0
  158. data/vendor/assets/fonts/fonts/icomoon.eot +0 -0
  159. data/vendor/assets/fonts/fonts/icomoon.svg +22 -0
  160. data/vendor/assets/fonts/fonts/icomoon.ttf +0 -0
  161. data/vendor/assets/fonts/fonts/icomoon.woff +0 -0
  162. data/vendor/assets/fonts/fonts/overpass_bold-web.eot +0 -0
  163. data/vendor/assets/fonts/fonts/overpass_bold-web.svg +454 -0
  164. data/vendor/assets/fonts/fonts/overpass_bold-web.ttf +0 -0
  165. data/vendor/assets/fonts/fonts/overpass_bold-web.woff +0 -0
  166. data/vendor/assets/fonts/fonts/overpass_light-webfont.eot +0 -0
  167. data/vendor/assets/fonts/fonts/overpass_light-webfont.svg +2105 -0
  168. data/vendor/assets/fonts/fonts/overpass_light-webfont.ttf +0 -0
  169. data/vendor/assets/fonts/fonts/overpass_light-webfont.woff +0 -0
  170. data/vendor/assets/fonts/fonts/overpass_regular-web.eot +0 -0
  171. data/vendor/assets/fonts/fonts/overpass_regular-web.svg +454 -0
  172. data/vendor/assets/fonts/fonts/overpass_regular-web.ttf +0 -0
  173. data/vendor/assets/fonts/fonts/overpass_regular-web.woff +0 -0
  174. data/vendor/assets/fonts/fonts/portalicons.eot +0 -0
  175. data/vendor/assets/fonts/fonts/portalicons.svg +145 -0
  176. data/vendor/assets/fonts/fonts/portalicons.ttf +0 -0
  177. data/vendor/assets/fonts/fonts/portalicons.woff +0 -0
  178. data/vendor/assets/images/images/Icon_RH_Document_Blueprint_RGB_Button.png +0 -0
  179. data/vendor/assets/images/images/Icon_RH_Misc_Lifestyle_RGB_Button.png +0 -0
  180. data/vendor/assets/images/images/Icon_RH_Software_Data_CMYK_Button.png +0 -0
  181. data/vendor/assets/images/images/Icon_RH_Software_Transfer-Upload_CMYK_Button.png +0 -0
  182. data/vendor/assets/images/images/bg1.jpg +0 -0
  183. data/vendor/assets/images/images/bg_body.jpg +0 -0
  184. data/vendor/assets/images/images/bg_chart-shadow.png +0 -0
  185. data/vendor/assets/images/images/bg_dount-hole-na.png +0 -0
  186. data/vendor/assets/images/images/bg_glow.jpg +0 -0
  187. data/vendor/assets/images/images/bg_pattern.png +0 -0
  188. data/vendor/assets/images/images/i_chart.png +0 -0
  189. data/vendor/assets/images/images/img-insights-connection-sat.png +0 -0
  190. data/vendor/assets/images/images/img-insights-connection.png +0 -0
  191. data/vendor/assets/images/images/img-sat5-step2-admin.png +0 -0
  192. data/vendor/assets/images/images/img-sat5-step3-completed.png +0 -0
  193. data/vendor/assets/images/images/img-sat5-step3-pending.png +0 -0
  194. data/vendor/assets/images/images/img-sat5-step3-setup.png +0 -0
  195. data/vendor/assets/images/images/img-sat5-step5-overview.png +0 -0
  196. data/vendor/assets/images/images/img-sat5-step5-reports.png +0 -0
  197. data/vendor/assets/images/images/img-sat5-step5-systems.png +0 -0
  198. data/vendor/assets/images/images/img-sat6-step2.jpg +0 -0
  199. data/vendor/assets/images/images/img-sat6-step3.jpg +0 -0
  200. data/vendor/assets/images/images/img-sat6-step3.png +0 -0
  201. data/vendor/assets/images/images/img-sat6-step4.jpg +0 -0
  202. data/vendor/assets/images/images/img-sat6-step5a.jpg +0 -0
  203. data/vendor/assets/images/images/img-sat6-step5b.jpg +0 -0
  204. data/vendor/assets/images/images/img-sat6-step5c.jpg +0 -0
  205. data/vendor/assets/images/images/img-sat6-step5d.jpg +0 -0
  206. data/vendor/assets/images/images/keynote-snap.jpg +0 -0
  207. data/vendor/assets/images/images/keynote-snap.png +0 -0
  208. data/vendor/assets/images/images/splash-gettingstarted.jpg +0 -0
  209. data/vendor/assets/images/images/splash-learnmore.jpg +0 -0
  210. data/vendor/assets/images/images/splash-security.jpg +0 -0
  211. data/vendor/assets/javascripts/angular/angular.js +20131 -0
  212. data/vendor/assets/javascripts/redhat_access/redhat_access_angular_ui-deps.js +14103 -0
  213. data/vendor/assets/javascripts/redhat_access/redhat_access_angular_ui.js +7854 -0
  214. data/vendor/assets/javascripts/telemetry/insights.js +39 -0
  215. data/vendor/assets/stylesheets/redhat_access/redhat_access_angular_ui-deps.css +11 -0
  216. data/vendor/assets/stylesheets/redhat_access/redhat_access_angular_ui.css +1 -0
  217. data/vendor/assets/stylesheets/telemetry/sat6.css +18 -0
  218. metadata +341 -0
data/Rakefile ADDED
@@ -0,0 +1,131 @@
1
+ #!/usr/bin/env rake
2
+ begin
3
+ require 'bundler/setup'
4
+ rescue LoadError
5
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
6
+ end
7
+ begin
8
+ require 'rdoc/task'
9
+ rescue LoadError
10
+ require 'rdoc/rdoc'
11
+ require 'rake/rdoctask'
12
+ RDoc::Task = Rake::RDocTask
13
+ end
14
+
15
+ RDoc::Task.new(:rdoc) do |rdoc|
16
+ rdoc.rdoc_dir = 'rdoc'
17
+ rdoc.title = 'RedhatAccess'
18
+ rdoc.options << '--line-numbers'
19
+ rdoc.rdoc_files.include('README.rdoc')
20
+ rdoc.rdoc_files.include('lib/**/*.rb')
21
+ end
22
+
23
+ APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
24
+ load 'rails/tasks/engine.rake'
25
+
26
+
27
+
28
+ Bundler::GemHelper.install_tasks
29
+
30
+ require 'rake/testtask'
31
+
32
+ #----Temp lifted from https://github.com/ejholmes/sprockets-gem-paths ....#
33
+ def self.rubygems_latest_specs
34
+ # If newer Rubygems
35
+ if ::Gem::Specification.respond_to? :latest_specs
36
+ ::Gem::Specification.latest_specs
37
+ else
38
+ ::Gem.source_index.latest_specs
39
+ end
40
+ end
41
+
42
+ def append_gem_paths env
43
+ try_paths = [
44
+ %w{ assets },
45
+ %w{ app },
46
+ %w{ app assets },
47
+ %w{ vendor },
48
+ %w{ vendor assets },
49
+ %w{ lib },
50
+ %w{ lib assets }
51
+ ].inject([]) do |sum, v|
52
+ sum + [
53
+ File.join(v, 'javascripts'),
54
+ File.join(v, 'stylesheets'),
55
+ File.join(v, 'images'),
56
+ File.join(v, 'fonts')
57
+ ]
58
+ end
59
+ (rubygems_latest_specs.map(&:full_gem_path)).each do |root_path|
60
+ try_paths.map {|p| File.join(root_path, p) }.
61
+ select {|p| File.directory?(p) }.
62
+ each {|path| env.append_path(path) }
63
+ end
64
+ end
65
+ #-----end lift
66
+
67
+ Rake::TestTask.new(:test) do |t|
68
+ t.libs << 'lib'
69
+ t.libs << 'test'
70
+ t.pattern = 'test/**/*_test.rb'
71
+ t.verbose = false
72
+ end
73
+
74
+ desc 'Compile stand alone engine assets'
75
+
76
+ task 'a:c' do
77
+ #Alias for commandline execution
78
+ Rake::Task['assets:precompile:engine'].invoke
79
+ end
80
+
81
+ task 'assets:precompile:engine' do
82
+ require 'sprockets'
83
+ require 'sprockets/railtie'
84
+ require 'uglifier'
85
+ require 'sass/rails/compressor'
86
+ require 'angular-rails-templates'
87
+ Sprockets::Engines #force autoloading
88
+ Sprockets.register_engine '.html', AngularRailsTemplates::Template
89
+
90
+ precompile = [
91
+ 'redhat_access/application.js',
92
+ 'redhat_access/application.css',
93
+ 'proactive_support/application.js',
94
+ 'insights/application.js',
95
+ 'insights/application.css'
96
+ ]
97
+
98
+ env = Sprockets::Environment.new(RedhatAccess::Engine.root)
99
+ env.js_compressor = Uglifier.new(:mangle=>false)
100
+ env.css_compressor = Sass::Rails::CssCompressor.new
101
+
102
+ paths = [
103
+ 'app/assets/stylesheets',
104
+ 'app/assets/javascripts',
105
+ 'vendor/assets/javascripts',
106
+ 'vendor/assets/stylesheets'
107
+ ]
108
+
109
+ paths.each do |path|
110
+ env.append_path(path)
111
+ end
112
+ append_gem_paths(env)
113
+
114
+ target = File.join(RedhatAccess::Engine.root, 'public', 'assets')
115
+ rm_rf target
116
+ compiler = Sprockets::StaticCompiler.new(env,
117
+ target,
118
+ precompile,
119
+ :manifest_path => File.join(target),
120
+ :digest => true,
121
+ :manifest => true)
122
+ puts 'Compiling assets'
123
+ compiler.compile
124
+ end
125
+
126
+ # task 'build' do
127
+ # Rake::Task['assets:precompile:engine'].invoke
128
+ # gem build 'redhat_access.gemspec'
129
+ # end
130
+
131
+ task :default => :test
@@ -0,0 +1,64 @@
1
+ (function() {
2
+ 'use strict';
3
+ angular.module('RedhatAccessInsights', [
4
+ 'ui.router',
5
+ 'ui.bootstrap',
6
+ 'insights',
7
+ 'templates'
8
+ ])
9
+ .config(['$httpProvider', '$stateProvider', '$urlRouterProvider', '$locationProvider', '$provide', 'InsightsConfigProvider', '$injector',
10
+ function($httpProvider, $stateProvider, $urlRouterProvider, $locationProvider, $provide, InsightsConfigProvider, $injector) {
11
+ $httpProvider.defaults.headers.common = {
12
+ 'X-CSRF-TOKEN': $('meta[name=csrf-token]').attr('content')
13
+ };
14
+ $provide.factory('AuthInterceptor', ['$injector',
15
+ function($injector) {
16
+ return {
17
+ responseError: function(response) {
18
+ var $q = $injector.get('$q');
19
+ var $window = $injector.get('$window');
20
+ if (response.status === 401) {
21
+ $window.location.reload();
22
+ } else
23
+ if (response.status === 403) {
24
+ var message = 'You are not authorized to perform this action.';
25
+ response.data.errors = [message];
26
+ response.data.displayMessage = message;
27
+ $window.location.reload();
28
+ }
29
+ return $q.reject(response);
30
+ }
31
+ };
32
+ }
33
+ ]);
34
+ $httpProvider.interceptors.push('AuthInterceptor');
35
+ $stateProvider.state('manage', {
36
+ url: '/manage',
37
+ templateUrl: '/redhat_access/insights/templates/configuration', //TODO HACK!
38
+ controller: 'ConfigurationCtrl'
39
+ });
40
+ $stateProvider.state('help', {
41
+ url: '/help',
42
+ templateUrl: '/redhat_access/insights/templates/help' //TODO HACK
43
+ });
44
+ $stateProvider.state('serviceerror', {
45
+ url: '/proxyerror',
46
+ templateUrl: '/redhat_access/insights/templates/error' //TODO HACK
47
+ });
48
+ $urlRouterProvider.otherwise('/overview');
49
+ $locationProvider.html5Mode(true);
50
+
51
+ // Insights UI configuration
52
+ InsightsConfigProvider.setApiPrefix('/redhat_access/r/insights/view/api/');
53
+ InsightsConfigProvider.setCanUnregisterSystems(REDHAT_ACCESS_SETTINGS.Insights.canUnregisterSystems);
54
+ InsightsConfigProvider.setCanIgnoreRules(REDHAT_ACCESS_SETTINGS.Insights.canIgnoreRules);
55
+ InsightsConfigProvider.setGettingStartedLink('https://access.redhat.com/insights/getting-started/satellite/6/');
56
+ InsightsConfigProvider.setAllowExport(true);
57
+ }
58
+ ]).value('SAT_CONFIG', {
59
+ enableBasicAuth: REDHAT_ACCESS_SETTINGS.Insights.allowBasicAuth,
60
+ isOrgSelected: REDHAT_ACCESS_SETTINGS.Insights.isOrgSelected,
61
+ isSubscribedToRedhat: REDHAT_ACCESS_SETTINGS.Insights.isSubscribedToRedhat,
62
+ isOrgDisconnected: REDHAT_ACCESS_SETTINGS.Insights.isOrgDisconnected,
63
+ }).value('currentLocale', REDHAT_ACCESS_SETTINGS.currentLocale);
64
+ })();
@@ -0,0 +1,18 @@
1
+ /* Copyright 2015 Red Hat, Inc.
2
+ *
3
+ * This software is licensed to you under the GNU General Public
4
+ * License as published by the Free Software Foundation; either version
5
+ * 2 of the License (GPLv2) or (at your option) any later version.
6
+ * There is NO WARRANTY for this software, express or implied,
7
+ * including the implied warranties of MERCHANTABILITY,
8
+ * NON-INFRINGEMENT, or FITNESS FOR A PARTICULAR PURPOSE. You should
9
+ * have received a copy of GPLv2 along with this software; if not, see
10
+ * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
11
+ *
12
+ */
13
+ //= require "telemetry/insights"
14
+ //= require "angular-rails-templates"
15
+ //= require_tree ./views
16
+ //= require "insights/app.module"
17
+ //= require "insights/configuration.service"
18
+ //= require "insights/configuration.controller"
@@ -0,0 +1,66 @@
1
+ /*global angular, $scope */
2
+
3
+ (function() {
4
+ 'use strict';
5
+
6
+ angular.module('RedhatAccessInsights')
7
+ .controller('ConfigurationCtrl', ['$scope', '$http', 'ConfigurationService', 'SAT_CONFIG',
8
+ function($scope, $http, ConfigurationService, SAT_CONFIG) {
9
+ $scope.loading = true;
10
+ $scope.accountLoading = true;
11
+ $scope.env = {
12
+ enableBasicAuth: SAT_CONFIG.enableBasicAuth
13
+ };
14
+ $scope.config = {};
15
+ $scope.portalAccount = {};
16
+ $scope.load = function() {
17
+ ConfigurationService.getConfig().success(function(data) {
18
+ //$scope.index();
19
+ $scope.loading = false;
20
+ $scope.config = data;
21
+ $scope.originalConfig = angular.copy(data);
22
+ //console.log("Loaded...");
23
+ });
24
+ };
25
+ $scope.update = function() {
26
+ $scope.loading = true;
27
+ ConfigurationService.postConfig($scope.config).success(function() {
28
+ //$scope.index();
29
+ $scope.loading = false;
30
+ $scope.originalConfig = angular.copy($scope.config);
31
+ $scope.getAccountInfo();
32
+ }).error(function(response) {
33
+ $scope.getAccountInfo();
34
+ })
35
+
36
+ };
37
+ $scope.disableUpdateButton = function() {
38
+ return $scope.loading || angular.equals($scope.config, $scope.originalConfig);
39
+ };
40
+
41
+ $scope.getAccountInfo = function() {
42
+ $scope.accountLoading = true;
43
+ ConfigurationService.getAccountInfo().success(function(data) {
44
+ $scope.portalAccount = data;
45
+ $scope.accountLoading = false;
46
+ }).
47
+ error(function(data, status, headers, config) {
48
+ $scope.accountLoading = false;
49
+ $scope.portalAccount = {
50
+ connectionStatus: data.connectionStatus,
51
+ account: 'Unknown',
52
+ company: 'Unknown'
53
+ }
54
+ });
55
+ };
56
+
57
+ $scope.showConnectionStatus = function() {
58
+ return $scope.originalConfig ? $scope.originalConfig.enable_telemetry : false ;
59
+ };
60
+
61
+
62
+ $scope.load();
63
+ $scope.getAccountInfo();
64
+ }
65
+ ]);
66
+ }());
@@ -0,0 +1,28 @@
1
+ /*global angular, $scope */
2
+
3
+ (function() {
4
+ 'use strict';
5
+
6
+ var conf_url = '/redhat_access/telemetry_configuration';
7
+
8
+ angular.module('RedhatAccessInsights').factory('ConfigurationService', ['$http','InsightsConfig', function($http,InsightsConfig) {
9
+
10
+ var postConfig = function(data) {
11
+ return $http.put(conf_url, data);
12
+ };
13
+
14
+ var getConfig = function() {
15
+ return $http.get(conf_url);
16
+ };
17
+
18
+ var getAccountInfo = function(){
19
+ return $http.get(InsightsConfig.apiRoot + 'me');
20
+ };
21
+
22
+ return{
23
+ getConfig : getConfig,
24
+ postConfig : postConfig,
25
+ getAccountInfo : getAccountInfo
26
+ };
27
+ }]);
28
+ }());
@@ -0,0 +1,85 @@
1
+ <div class="section">
2
+ <div class="row margin-top">
3
+ <div class="col-sm-12">
4
+ <h1 class="page-title">Manage</h1>
5
+ </div>
6
+ </div>
7
+ <div class="row row-short">
8
+ <div class="col-sm-12">
9
+ <div class="panel panel-default">
10
+ <div class="panel-heading">Access Insights Service Configuration</div>
11
+ <div>
12
+ <i ng-show="loading" class="fa fa-spinner fa-spin fa-1-5x"></i>
13
+ </div>
14
+ <div class="panel-body">
15
+ <form class="form-horizontal">
16
+ <div class="form-group">
17
+ <label for="rha-insights-enabled" class="col-lg-3 control-label">Enable Service </label>
18
+ <div class="col-lg-6">
19
+ <div class="checkbox">
20
+ <input id="rha-insights-enabled" type="checkbox" ng-model="config.enable_telemetry" ng-disabled="loading" />
21
+ </div>
22
+ </div>
23
+ </div>
24
+ <div class="form-group" ng-show="env.enableBasicAuth">
25
+ <label for="rha-insights-password" class="col-lg-3 control-label">Customer Portal Username</label>
26
+ <div class="col-lg-6">
27
+ <input id="rha-insights-password" type="text" size="32" ng-model="config.portal_user" ng-disabled="loading" class="form-control" />
28
+ </div>
29
+ </div>
30
+ <div class="form-group" ng-show="env.enableBasicAuth">
31
+ <label for="rha-insights-password" class="col-lg-3 control-label">Customer Portal Password</label>
32
+ <div class="col-lg-6">
33
+ <input id="rha-insights-password" type="password" size="32" ng-model="config.portal_password" ng-disabled="loading" class="form-control" />
34
+ </div>
35
+ </div>
36
+ <div class="form-group">
37
+ <div class="col-lg-offset-3 col-lg-6">
38
+ <input type="submit" value="Save" ng-click="update()" ng-hide="disableUpdateButton()" class="btn btn-success" />
39
+ </div>
40
+ </div>
41
+ </form>
42
+ </div>
43
+ </div>
44
+ <div class="panel panel-default" ng-show="showConnectionStatus()">
45
+ <div class="panel-heading">Insights Engine Connection</div>
46
+ <div>
47
+ <i ng-show="accountLoading" class="fa fa-spinner fa-spin fa-1-5x"></i>
48
+ </div>
49
+ <div class="panel-body">
50
+ <form class="form-horizontal">
51
+ <div class="form-group">
52
+ <label class="control-label col-sm-2" for="connectionStatus">Status:</label>
53
+ <div class="col-sm-10">
54
+ <p class="form-control-static"> {{portalAccount.connectionStatus}} </p>
55
+ </div>
56
+ </div>
57
+ <div class="form-group">
58
+ <label class="control-label col-sm-2" for="account">Account Number:</label>
59
+ <div class="col-sm-10">
60
+ <p class="form-control-static">{{portalAccount.account}}</p>
61
+ </div>
62
+ </div>
63
+ <div class="form-group" ng-show="portalAccount.company">
64
+ <label class="control-label col-sm-2" for="company">Company:</label>
65
+ <div class="col-sm-10">
66
+ <p class="form-control-static"> {{portalAccount.company}} </p>
67
+ </div>
68
+ </div>
69
+ <div class="form-group" ng-show="portalAccount.orgId">
70
+ <label class="control-label col-sm-2" for="orgid">Organization ID:</label>
71
+ <div class="col-sm-10">
72
+ <p class="form-control-static"> {{portalAccount.orgId}} </p>
73
+ </div>
74
+ </div>
75
+ <div class="form-group">
76
+ <div class="col-sm-offset-2 col-sm-2">
77
+ <input type="submit" value="Check Connection" ng-click="getAccountInfo()" ng-hide="accountLoading" class="btn btn-success" />
78
+ </div>
79
+ </div>
80
+ </form>
81
+ </div>
82
+ </div>
83
+ </div>
84
+ </div>
85
+ </div>
@@ -0,0 +1,13 @@
1
+ <div class="section">
2
+ <section>
3
+ <h3>
4
+ <i ng-class="severityClass" class="fa i-error fa-times-circle"></i>
5
+ Error communicating with Red Hat Access Insights Service
6
+ </h3>
7
+ <p></p>
8
+ <p>
9
+ Please verify that you have a valid subscription manifest in your organization and that your Satellite server is configured to allow HTTPS communications to <i>cert-api.redhat.access.com</i>.
10
+ </p>
11
+
12
+ </section>
13
+ </div>
@@ -0,0 +1,16 @@
1
+ <div class="section">
2
+ <section>
3
+ <h3>
4
+ General Information
5
+ </h3>
6
+ <p>
7
+ For an overview of the Red Hat Insights service, please refer to the <a href="https://access.redhat.com/insights/info/" target="_blank">general information page</a>.
8
+ </p>
9
+ <h3>
10
+ Getting Started
11
+ </h3>
12
+ <p>
13
+ For help with configuring and enabling the Red Hat Insights service in Satellite 6, please refer to the <a href="https://access.redhat.com/insights/getting-started/satellite/6/" target="_blank">Getting Started Guide</a>.
14
+ </p>
15
+ </section>
16
+ </div>
@@ -0,0 +1,2 @@
1
+ // Place all the behaviors and hooks related to the matching controller here.
2
+ // All this logic will automatically be available in application.js.
@@ -0,0 +1,15 @@
1
+ /* Copyright 2013 Red Hat, Inc.
2
+ *
3
+ * This software is licensed to you under the GNU General Public
4
+ * License as published by the Free Software Foundation; either version
5
+ * 2 of the License (GPLv2) or (at your option) any later version.
6
+ * There is NO WARRANTY for this software, express or implied,
7
+ * including the implied warranties of MERCHANTABILITY,
8
+ * NON-INFRINGEMENT, or FITNESS FOR A PARTICULAR PURPOSE. You should
9
+ * have received a copy of GPLv2 along with this software; if not, see
10
+ * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
11
+ */
12
+ //= require "angular/angular"
13
+ //= require "redhat_access/redhat_access_angular_ui-deps"
14
+ //= require "redhat_access/redhat_access_angular_ui"
15
+ //= require "redhat_access/redhat_access.module"
@@ -0,0 +1,126 @@
1
+ /**
2
+ * Copyright 2014 Red Hat, Inc.
3
+ *
4
+ * This software is licensed to you under the GNU General Public
5
+ * License as published by the Free Software Foundation; either version
6
+ * 2 of the License (GPLv2) or (at your option) any later version.
7
+ * There is NO WARRANTY for this software, express or implied,
8
+ * including the implied warranties of MERCHANTABILITY,
9
+ * NON-INFRINGEMENT, or FITNESS FOR A PARTICULAR PURPOSE. You should
10
+ * have received a copy of GPLv2 along with this software; if not, see
11
+ * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
12
+ */
13
+
14
+ /**
15
+ *
16
+ */
17
+ angular.module('RedhatAccess', [
18
+ 'ngSanitize',
19
+ 'RedhatAccess.header',
20
+ 'RedhatAccess.template',
21
+ 'RedhatAccess.security',
22
+ 'RedhatAccess.search',
23
+ 'RedhatAccess.cases',
24
+ 'RedhatAccess.logViewer',
25
+ 'ui.router',
26
+ 'ui.bootstrap'
27
+
28
+ ]).config(['$urlRouterProvider',
29
+ '$httpProvider', '$locationProvider', '$provide',
30
+ function($urlRouterProvider, $httpProvider, $locationProvider, $provide) {
31
+ $urlRouterProvider.otherwise('/search');
32
+ $httpProvider.defaults.headers.common = {
33
+ 'X-CSRF-TOKEN': $('meta[name=csrf-token]').attr('content')
34
+ };
35
+ $provide.factory('AuthInterceptor', ['$injector',
36
+ function($injector) {
37
+ return {
38
+ responseError: function(response) {
39
+ var $q = $injector.get('$q');
40
+ var $window = $injector.get('$window');
41
+ if (response.status === 401) {
42
+ $window.location.reload();
43
+ } else
44
+ if (response.status === 403) {
45
+ var message = 'You are not authorized to perform this action.';
46
+ response.data.errors = [message];
47
+ response.data.displayMessage = message;
48
+ }
49
+ return $q.reject(response);
50
+ }
51
+ };
52
+ }
53
+ ]);
54
+ $httpProvider.interceptors.push('AuthInterceptor');
55
+ $locationProvider.html5Mode(true);
56
+ }
57
+ ]).value('LOGIN_VIEW_CONFIG', { verbose: true
58
+ }).value('SECURITY_CONFIG', {
59
+ displayLoginStatus: true,
60
+ autoCheckLogin: true,
61
+ loginURL: '',
62
+ logoutURL: '',
63
+ forceLogin: true
64
+ }).value('NEW_CASE_CONFIG', {
65
+ 'showRecommendations': true,
66
+ 'showAttachments': true,
67
+ 'showServerSideAttachments': false
68
+ }).value('EDIT_CASE_CONFIG', {
69
+ 'showDetails': true,
70
+ 'showDescription': true,
71
+ 'showBugzillas': true,
72
+ 'showAttachments': true,
73
+ 'showRecommendations': true,
74
+ 'showComments': true,
75
+ 'showServerSideAttachments': false,
76
+ 'showEmailNotifications': true
77
+ }).run(['COMMON_CONFIG',
78
+ '$http', 'securityService', 'hideMachinesDropdown', 'NEW_DEFAULTS', 'currentLocale', 'gettextCatalog',
79
+ function(COMMON_CONFIG, $http, securityService, hideMachinesDropdown, NEW_DEFAULTS, currentLocale, gettextCatalog) {
80
+ COMMON_CONFIG.showTitle = true;
81
+ hideMachinesDropdown.value = true;
82
+ NEW_DEFAULTS.product = "Red Hat Satellite or Proxy"; //TODO read from server config
83
+ NEW_DEFAULTS.version = "6.1"; //TODO read from server config
84
+ gettextCatalog.currentLanguage = currentLocale;
85
+ //console.log('Setting language to ' + currentLocale);
86
+ // $http({
87
+ // method: 'GET',
88
+ // url: 'configuration'
89
+ // }).
90
+ // success(function (data, status, headers, config) {
91
+ // if (data) {
92
+ // if (data.strataHostName) {
93
+ // strata.setStrataHostname(data.strataHostName);
94
+ // } else {
95
+ // console.log("Invalid configuration object " + data);
96
+ // }
97
+ // if (data.strataClientId) {
98
+ // strata.setRedhatClientID(data.strataClientId);
99
+ // } else {
100
+ // strata.setRedhatClientID("foreman-strata-client");
101
+ // console.log("Invalid configuration object " + data);
102
+ // }
103
+ // }
104
+ // securityService.validateLogin(false).then(
105
+ // function (authedUser) {
106
+ // console.log("logged in user is " + authedUser)
107
+ // },
108
+ // function (error) {
109
+ // console.log("Unable to get user credentials");
110
+ // });
111
+ // }).
112
+ // error(function (data, status, headers, config) {
113
+ // console.log("Failed to read app configuration");
114
+ // strata.setRedhatClientID("foreman-strata-client");
115
+ // securityService.validateLogin(false).then(
116
+ // function (authedUser) {
117
+ // console.log("logged in user is " + authedUser)
118
+ // },
119
+ // function (error) {
120
+ // console.log("Unable to get user credentials");
121
+ // });
122
+ // });
123
+ }
124
+ ]);
125
+
126
+ //angular.module('RedhatAccess.logViewer').value('hideMachinesDropdown.value);
@@ -0,0 +1,14 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the top of the
9
+ * compiled file, but it's generally better to create a new file per style scope.
10
+ *
11
+ *= require_self
12
+ *= require telemetry/sat6.css
13
+ *= require insights/insights.css
14
+ */
@@ -0,0 +1,21 @@
1
+ .insights-main-content .alert {
2
+ font-weight: 500;
3
+ padding: 7px;
4
+ font-size: 12px;
5
+ }
6
+
7
+ .insights-main-content .alert.alert-danger {
8
+ background: #FFF;
9
+ color: #C00;
10
+ }
11
+
12
+ .alert-dismissable .close {
13
+ right: auto;
14
+ top: auto;
15
+ }
16
+
17
+ .insights-main-content .legend {
18
+ margin-left: 0px;
19
+ width : auto;
20
+ height :auto;
21
+ }
@@ -0,0 +1,14 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the top of the
9
+ * compiled file, but it's generally better to create a new file per style scope.
10
+ *
11
+ *= require_self
12
+ *= require redhat_access/redhat_access_angular_ui-deps.css
13
+ *= require redhat_access/redhat_access_angular_ui.css
14
+ */
@@ -0,0 +1,4 @@
1
+ /*
2
+ Place all the styles related to the matching controller here.
3
+ They will automatically be included in application.css.
4
+ */
@@ -0,0 +1,12 @@
1
+ require_dependency "redhat_access/application_controller"
2
+
3
+ module RedhatAccess
4
+ class AnalyticsDashboardController < ApplicationController
5
+ def index
6
+ end
7
+
8
+ def template
9
+ render template: "redhat_access/analytics_dashboard/#{params[:page]}", :layout => false
10
+ end
11
+ end
12
+ end