Module: ForemanThemeSatellite
- Defined in:
- lib/foreman_theme_satellite/documentation.rb,
lib/foreman_theme_satellite.rb,
lib/foreman_theme_satellite/engine.rb,
lib/foreman_theme_satellite/version.rb,
lib/foreman_theme_satellite/pry_rack.rb,
lib/foreman_theme_satellite/foreman_brand.rb,
app/services/foreman_theme_satellite/lifecycle.rb,
lib/foreman_theme_satellite/replacer_repository.rb,
lib/foreman_theme_satellite/deprecated_templates.rb,
lib/foreman_theme_satellite/rss_checker_branding.rb,
app/services/foreman_theme_satellite/renderer_methods.rb,
lib/generators/foreman_theme_satellite/lib/css_compare.rb,
lib/foreman_theme_satellite/scap_bulk_upload_extensions.rb,
lib/generators/foreman_theme_satellite/lib/color_changer.rb,
lib/generators/foreman_theme_satellite/color_diff_generator.rb
Overview
rubocop:disable Layout/LineLength
Defined Under Namespace
Modules: Documentation, RendererMethods, RssCheckerBranding, ScapBulkUploadExtensions
Classes: ColorDiffGenerator, CssCompare, Engine, Lifecycle, PryRack, ReplacerRepository
Constant Summary
collapse
- METADATA_PATH =
'/usr/share/satellite/metadata.yml'.freeze
- LIFECYCLE_METADATA_PATH =
'/usr/share/satellite/lifecycle-metadata.yml'.freeze
- SATELLITE_VERSION =
this file indicates the satellite version that will be represented on the login page.
get_satellite_version
- SATELLITE_SHORT_VERSION =
this file indicates the satellite version that will be used on links to documentation.
get_satellite_short_version
- VERSION =
'15.0.1'.freeze
- FOREMAN_BRAND =
This list is used for substitution of branded words by both client and server. The server just uses the list as is. The client is consuming it by generated .js.erb file: app/assets/javascripts/theme_client_side_branding.js.erb. For now, modifiers are not supported by the generator. Make sure the regexp works both with Ruby and JavaScript. Entries are processed in order and first wins. Occurrences of “proxy” should be treated as a bug as it is unclear whether the author refers to a HTTP(S) proxy or a Capsule
{
/%{proxy}/ => '%{proxy}',
/%{foreman}/ => '%{foreman}',
/\b[Pp]roxy [Hh][Tt][Tt][Pp]\b(?!-)/ => 'Proxy HTTP', /\b[Pp]roxies [Hh][Tt][Tt][Pp]\b(?!-)/ => 'Proxies HTTP', /\b[Hh][Tt][Tt][Pp](?:\([sS]\))? [Pp]roxy\b(?!-)/ => 'HTTP proxy',
/\b[Hh][Tt][Tt][Pp](?:\([sS]\))? [Pp]roxies\b(?!-)/ => 'HTTP proxies',
/\bHTTP\(S\) proxy\b(?!-)/ => 'HTTP(S) proxy',
/\bIgnore Proxy\b(?!-)/ => 'Ignore Proxy',
/\bIgnore proxy\b(?!-)/ => 'Ignore Proxy',
/\bSystem-wide proxies\b(?!-)/ => 'System-wide proxies',
/\bLeave this blank if no proxy is used\b(?!-)/ => 'Leave this blank if no proxy is used',
/\bbypass proxy settings\b(?!-)/ => 'bypass proxy settings',
/\bURL of the proxy\b(?!-)/ => 'URL of the proxy',
%r{\bhttps://proxy.example.com:8080\b(?!-)} => 'https://proxy.example.com:8080',
/\bproxy for all outgoing HTTP connections\b(?!-)/ => 'proxy for all outgoing HTTP connections',
/\bperform various actions through those proxies\b(?!-)/ => 'perform various actions through those proxies',
/\b[Ff]oreman\b(?!-)/ => 'Satellite',
/\b[Ss]mart[- ]?[Pp]roxy\(ies\)(?!-)/ => 'Capsule(s)',
/\b[Ss]mart[- ]?[pP]roxy\b(?!-)/ => 'Capsule',
/\b[Ss]mart[- ]?[pP]roxies\b(?!-)/ => 'Capsules',
/\b[Pp]roxy\b(?!-)/ => 'Capsule',
/\b[Pp]roxies\b(?!-)/ => 'Capsules',
/\b[Oo][Vv]irt\b(?!-)/ => 'RHV',
/\bFreeIPA\b(?!-)/ => 'Red Hat Identity Management',
/\b[Oo]pen[Ss]tack\b(?!-)/ => 'Red Hat OpenStack Platform',
/\b[Kk]atello 4.0\b(?!-)/ => 'Satellite 6.11',
/\b[Kk]atello 4.10\b(?!-)/ => 'Satellite 6.15',
/\b[Kk]atello 4.11\b(?!-)/ => 'Satellite 6.15',
/\b[Kk]atello 4.12\b(?!-)/ => 'Satellite 6.16',
/\b[Kk]atello 4.13\b(?!-)/ => 'Satellite 6.16',
}.freeze
- DEPRECATED_TEMPLATES =
{
'Satellite Kickstart Default' => 'Kickstart default',
'Satellite Kickstart Default User Data' => 'Kickstart default user data',
'Satellite Kickstart Default Finish' => 'Kickstart default finish',
'idm_register' => 'freeipa_register',
'Satellite Atomic Kickstart Default' => 'Atomic Kickstart default'
}.freeze
- COLOR_REGEX =
/#([0-9A-Fa-f]){3}((?=[^[:alnum:]])|([0-9A-Fa-f]){3,5})/i
- COLOR_REPLACEMENT =
This color translation is copied from previous colors.scss file. When the same source color was translated to multiple destinations, one of the conflicting pairs was commented out and left for future reference. Each line is commented by the corresponding parameter name.
{
'#005c7e' => '#393F44', '#0187b6' => '#5F666C', '#0072a0' => '#474C51', '#005b7e' => '#72757A', '#006289' => '#64686C', '#024d6c' => '#393F44', '#026991' => '#474C51', '#01749d' => '#202020' }.freeze
Class Method Summary
collapse
Class Method Details
.documentation_root ⇒ Object
138
139
140
141
142
|
# File 'lib/foreman_theme_satellite/engine.rb', line 138
def self.documentation_root
@documentation_root ||= begin
"#{documentation_server}/documentation/en-us/red_hat_satellite/#{documentation_version}/html"
end
end
|
.documentation_server ⇒ Object
130
131
132
|
# File 'lib/foreman_theme_satellite/engine.rb', line 130
def self.documentation_server
@documentation_server ||= metadata_field('documentation_server', 'https://docs.redhat.com')
end
|
.documentation_version ⇒ Object
.get_satellite_short_version ⇒ Object
126
127
128
|
# File 'lib/foreman_theme_satellite/engine.rb', line 126
def self.get_satellite_short_version
Foreman::Version.new(SATELLITE_VERSION).short
end
|
.get_satellite_version ⇒ Object
122
123
124
|
# File 'lib/foreman_theme_satellite/engine.rb', line 122
def self.get_satellite_version
metadata_field('version', '6.15.0-development')
end
|
108
109
110
111
112
113
114
115
116
|
# File 'lib/foreman_theme_satellite/engine.rb', line 108
def self.metadata_field(key, default)
value = ENV["SATELLITE_#{key.upcase}"]
return value if value
metadata_path = Rails.env.production? ? METADATA_PATH : "#{__dir__}/../../config/metadata.yml"
@metadata_yaml ||= File.exist?(metadata_path) ? YAML.load_file(metadata_path) : {}
@metadata_yaml.fetch(key, default)
end
|