Skip to content

Commit a2fb97d

Browse files
authored
Merge pull request openshift#3470 from ahardin-rh/extension-properties
Bug 1410292, added information about setting extension properties
2 parents 2ae90b4 + 07393ae commit a2fb97d

File tree

1 file changed

+51
-5
lines changed

1 file changed

+51
-5
lines changed

install_config/web_console_customization.adoc

+51-5
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,22 @@ toc::[]
1313

1414
ifdef::openshift-origin,openshift-enterprise[]
1515
== Overview
16+
1617
Administrators can customize the
17-
xref:../architecture/infrastructure_components/web_console.adoc#architecture-infrastructure-components-web-console[web console]
18-
using extensions, which let you run scripts and load custom stylesheets when the
19-
web console loads. You can change the look and feel of nearly any aspect of the
20-
user interface in this way.
18+
xref:../architecture/infrastructure_components/web_console.adoc#architecture-infrastructure-components-web-console[web
19+
console] using extensions, which let you run scripts and load custom stylesheets
20+
when the web console loads. Extension scripts allow you to override the default
21+
behavior of the web console and customize it for your needs.
22+
23+
For example, extension scripts can be used to add your own
24+
company's branding or to add company-specific capabilities. A common use case
25+
for this is rebranding or white-labelling for different environments. You can
26+
use the same extension code, but provide settings that change the web console.
27+
You can change the look and feel of nearly any aspect of the user interface in
28+
this way.
2129

2230
[[loading-custom-scripts-and-stylesheets]]
23-
== Loading Custom Scripts and Stylesheets
31+
== Loading Extension Scripts and Stylesheets
2432

2533
To add scripts and stylesheets, edit the
2634
xref:../install_config/master_node_configuration.adoc#install-config-master-node-configuration[master configuration
@@ -68,6 +76,44 @@ link:https://github.com/openshift/origin-web-console/tree/master/extensions/exam
6876
Origin] repository on GitHub.
6977
====
7078

79+
[[setting-extension-properties]]
80+
=== Setting Extension Properties
81+
82+
If you have a specific extension, but want to use different text in it for each
83+
of the environments, you can define the environment in the
84+
*_master-config.yaml_* file, and use the same extension script across
85+
environments. Pass settings from the *_master-config.yaml_* file to be used by
86+
the extension using the
87+
xref:../install_config/master_node_configuration.adoc#master-config-asset-config[`extensionProperties`
88+
mechanism]:
89+
90+
====
91+
[source,yaml]
92+
----
93+
assetConfig:
94+
extensionDevelopment: true
95+
extensionProperties:
96+
doc_url: https://docs.openshift.com
97+
key1: value1
98+
key2: value2
99+
extensionScripts:
100+
----
101+
====
102+
103+
This results in a global variable that can be accessed by the extension, as if
104+
the following code was executed:
105+
106+
====
107+
[source, javascript]
108+
----
109+
window.OPENSHIFT_EXTENSION_PROPERTIES = {
110+
doc_url: "https://docs.openshift.com",
111+
key1: "value1",
112+
key2: "value2",
113+
}
114+
----
115+
====
116+
71117
[[customizing-the-logo]]
72118
=== Customizing the Logo
73119

0 commit comments

Comments
 (0)