Skip to content

Commit 4dc60b8

Browse files
committed
Adding assets from Online repo
1 parent 3744d1e commit 4dc60b8

File tree

7 files changed

+335
-0
lines changed

7 files changed

+335
-0
lines changed

README.md

+10
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,12 @@
11
# online-console-extensions
22
OpenShift Online extensions to the Origin Web Console
3+
4+
This repository contains various CSS, JavaScript, and HTML files used by OpenShift Online to extend the OpenShift Web Console.
5+
6+
These files are built and deployed in an Apache HTTP Server container. This can be tested in an OpenShift cluster with the following command:
7+
8+
`$ oc new-app centos/httpd-24-centos7~https://github.com/openshift/online-console-extensions`
9+
10+
If you run `oc expose svc/online-console-extensions` you will be able to see the files in a web browser under `<route>/ui`
11+
12+
+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<div class="middle surface-shaded">
2+
<div class="middle-content">
3+
<div class="container gutter-top">
4+
<div class="row">
5+
<div class="col-md-12">
6+
<div class="about">
7+
<div class="row">
8+
<div class="col-md-2 about-icon gutter-top hidden-sm hidden-xs">
9+
<img src="images/openshift-logo.svg" />
10+
</div>
11+
<div class="col-md-9">
12+
<h1>Red Hat OpenShift <span class="about-reg">&reg;</span></h1>
13+
<h2>About</h2>
14+
<p><a target="_blank" href="https://openshift.com">OpenShift</a> is Red Hat's Platform-as-a-Service (PaaS) that allows developers to quickly develop, host, and scale applications in a cloud environment.</p>
15+
16+
<h2 id="version">Version</h2>
17+
<dl class="dl-horizontal left">
18+
<dt>OpenShift Master:</dt>
19+
<dd>{{version.master.openshift || 'unknown'}}</dd>
20+
<dt>Kubernetes Master:</dt>
21+
<dd>{{version.master.kubernetes || 'unknown'}}</dd>
22+
</dl>
23+
24+
<h2>Registry</h2>
25+
<p>
26+
You can push images to and pull images from the registry via:
27+
<copy-to-clipboard display-wide="true" clipboard-text="online_registry_url" input-text="online_registry_url" class="ng-isolate-scope"></copy-to-clipboard>
28+
</p>
29+
30+
<p>The <a target="_blank" href="{{'welcome' | helpLink}}">documentation</a> contains information and guides to help you learn about OpenShift and start exploring its features. From getting started with creating your first application, to trying out more advanced build and deployment techniques, it provides what you need to set up and manage your OpenShift environment as an application developer.</p>
31+
32+
<p>With the OpenShift command line interface (CLI), you can create applications and manage OpenShift projects from a terminal. To get started using the CLI, visit <a href="command-line">Command Line Tools</a>.</p>
33+
</div>
34+
</div>
35+
</div>
36+
</div>
37+
</div><!-- /row -->
38+
</div><!-- /container -->
39+
</div><!-- /middle-content -->
40+
</div><!-- /middle -->
+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<default-header class="top-header"></default-header>
2+
<div class="wrap no-sidebar">
3+
<div class="sidebar-left collapse navbar-collapse navbar-collapse-2">
4+
<navbar-utility-mobile></navbar-utility-mobile>
5+
</div>
6+
<div class="middle surface-shaded">
7+
<!-- Middle section -->
8+
<div class="middle-section">
9+
<div class="middle-container">
10+
<div class="middle-content">
11+
<div class="container surface-shaded gutter-top">
12+
<div class="row">
13+
<div class="col-md-12">
14+
<div class="about">
15+
<div class="row">
16+
<div class="col-md-2 about-icon gutter-top hidden-sm hidden-xs">
17+
<img src="images/openshift-logo.svg" />
18+
</div>
19+
<div class="col-md-9">
20+
<h1>Red Hat OpenShift <span class="about-reg">&reg;</span></h1>
21+
<h2>About</h2>
22+
<p><a target="_blank" href="https://openshift.com">OpenShift</a> is Red Hat's Platform-as-a-Service (PaaS) that allows developers to quickly develop, host, and scale applications in a cloud environment.</p>
23+
24+
<h2 id="version">Version</h2>
25+
<dl class="dl-horizontal left">
26+
<dt>OpenShift Master:</dt>
27+
<dd>{{version.master.openshift || 'unknown'}}</dd>
28+
<dt>Kubernetes Master:</dt>
29+
<dd>{{version.master.kubernetes || 'unknown'}}</dd>
30+
</dl>
31+
32+
<h2>Registry</h2>
33+
<p>
34+
You can push images to and pull images from the registry via:
35+
<copy-to-clipboard display-wide="true" clipboard-text="online_registry_url" input-text="online_registry_url" class="ng-isolate-scope"></copy-to-clipboard>
36+
</p>
37+
38+
<p>The <a target="_blank" href="{{'welcome' | helpLink}}">documentation</a> contains information and guides to help you learn about OpenShift and start exploring its features. From getting started with creating your first application, to trying out more advanced build and deployment techniques, it provides what you need to set up and manage your OpenShift environment as an application developer.</p>
39+
40+
<p>With the OpenShift command line interface (CLI), you can create applications and manage OpenShift projects from a terminal. To get started using the CLI, visit <a href="command-line">Command Line Tools</a>.
41+
</p>
42+
43+
</div>
44+
</div>
45+
</div>
46+
</div>
47+
</div>
48+
</div>
49+
</div><!-- /middle-content -->
50+
</div><!-- /middle-container -->
51+
</div><!-- /middle-section -->
52+
</div><!-- /middle -->
53+
</div><!-- /wrap -->
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
(function() {
2+
'use strict';
3+
4+
/*
5+
* Extension for loading the Intercom API widget for tracking and messaging customers
6+
*/
7+
angular
8+
.module('openshiftOnlineConsoleIntercomExtension', ['openshiftConsole'])
9+
.run(function($rootScope, $q, HawtioExtension) {
10+
if (typeof Intercom === "undefined") {
11+
window.Intercom = function() {
12+
Intercom.updateSettings(arguments);
13+
};
14+
Intercom.q = [];
15+
Intercom.updateSettings = function(args) {
16+
Intercom.q.push(args);
17+
};
18+
}
19+
20+
var managedIDAnnotation = "openshift.io/online-managed-id"
21+
var managedUserSecret = "openshift.io/managed-user-secret"
22+
var userAppID = "openshift.io/intercom-app-id"
23+
24+
$rootScope.$watch('user', function(user) {
25+
if (!user) {
26+
return;
27+
}
28+
if (!user.metadata.annotations[managedIDAnnotation] ||
29+
!user.metadata.annotations[managedUserSecret] ||
30+
!user.metadata.annotations[userAppID]) {
31+
return;
32+
}
33+
34+
if ($('#intercom-widget-script').length == 0) {
35+
var userID = user.metadata.annotations[managedIDAnnotation];
36+
var userHash = user.metadata.annotations[managedUserSecret];
37+
var appID = user.metadata.annotations[userAppID];
38+
window.Intercom("boot", {
39+
app_id: appID,
40+
user_id: userID,
41+
user_hash: userHash
42+
});
43+
44+
(function() {
45+
var s = document.createElement("script");
46+
s.type = "text/javascript";
47+
s.async = true;
48+
s.src = "https://widget.intercom.io/widget/"+appID;
49+
s.id = "intercom-widget-script"
50+
var x = document.getElementsByTagName("script")[0];
51+
x.parentNode.insertBefore(s, x);
52+
})();
53+
}
54+
});
55+
56+
// TODO:
57+
// use Angular.js to run this when the view and/or URL changes
58+
// window.Intercom("update");
59+
60+
// use Angular.js to run this when the current user logs out
61+
// window.Intercom("shutdown");
62+
});
63+
64+
hawtioPluginLoader.addModule('openshiftOnlineConsoleIntercomExtension');
65+
})();

ui/assets/extensions/free/online-extensions.css

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)