@@ -13,14 +13,22 @@ toc::[]
13
13
14
14
ifdef::openshift-origin,openshift-enterprise[]
15
15
== Overview
16
+
16
17
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.
21
29
22
30
[[loading-custom-scripts-and-stylesheets]]
23
- == Loading Custom Scripts and Stylesheets
31
+ == Loading Extension Scripts and Stylesheets
24
32
25
33
To add scripts and stylesheets, edit the
26
34
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
68
76
Origin] repository on GitHub.
69
77
====
70
78
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
+
71
117
[[customizing-the-logo]]
72
118
=== Customizing the Logo
73
119
0 commit comments