Skip to content

Commit 7db7133

Browse files
committed
Help users understand the terms of CE
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
1 parent 7803ea1 commit 7db7133

File tree

3 files changed

+126
-0
lines changed

3 files changed

+126
-0
lines changed

gateway/assets/index.html

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,21 @@
2525
<div class="jsonly">
2626
<div layout="column" ng-cloak>
2727

28+
<!-- EULA Banner -->
29+
<div id="eula-banner" class="eula-banner" ng-show="showLicenseBanner">
30+
<div class="eula-banner-content">
31+
<span class="eula-banner-text">
32+
<strong>OpenFaaS CE</strong> is a limited version for personal use or a single 60-day trial.
33+
<button class="eula-banner-button" ng-click="openPricingPage()" aria-label="Learn more about OpenFaaS licensing">Learn more</button>
34+
</span>
35+
<button class="eula-banner-close"
36+
ng-class="{'eula-banner-close-disabled': !bannerCanBeDismissed}"
37+
ng-click="dismissLicenseBanner()"
38+
ng-disabled="!bannerCanBeDismissed"
39+
aria-label="Dismiss banner">×</button>
40+
</div>
41+
</div>
42+
2843
<md-toolbar class="md-theme-indigo" hide-gt-sm>
2944
<div class="md-toolbar-tools no-pad">
3045
<md-button ng-click="toggleSideNav()" class="md-icon-button" aria-label="Menu">

gateway/assets/script/bootstrap.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,24 @@ app.controller("home", ['$scope', '$log', '$http', '$location', '$interval', '$f
2323
contentType: "text"
2424
};
2525

26+
// License banner functionality
27+
$scope.showLicenseBanner = true; // Always show on page load
28+
$scope.bannerCanBeDismissed = false; // Start as non-dismissible
29+
30+
// Enable dismissal after 5 seconds
31+
$interval(function() {
32+
$scope.bannerCanBeDismissed = true;
33+
}, 5000, 1); // Run once after 5 seconds
34+
35+
$scope.dismissLicenseBanner = function() {
36+
if ($scope.bannerCanBeDismissed) {
37+
$scope.showLicenseBanner = false;
38+
}
39+
};
40+
$scope.openPricingPage = function() {
41+
window.open('https://openfaas.com/pricing', '_blank');
42+
};
43+
2644
$scope.baseUrl = $location.absUrl().replace(/\ui\/$/, '');
2745

2846
try {

gateway/assets/style/bootstrap.css

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,99 @@ body {
22
background-color: rgb(243, 244, 250);
33
}
44

5+
/* EULA Banner Styles */
6+
.eula-banner {
7+
background-color: #fff3cd;
8+
border: 1px solid #ffeaa7;
9+
color: #856404;
10+
padding: 0;
11+
position: relative;
12+
z-index: 1000;
13+
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
14+
}
15+
16+
/* Hide banner when modal dialogs are open */
17+
.md-dialog-is-showing .eula-banner {
18+
display: none !important;
19+
}
20+
21+
.eula-banner-content {
22+
display: flex;
23+
align-items: center;
24+
justify-content: space-between;
25+
padding: 12px 16px;
26+
max-width: 100%;
27+
}
28+
29+
.eula-banner-text {
30+
flex: 1;
31+
font-size: 14px;
32+
line-height: 1.4;
33+
}
34+
35+
.eula-banner-button {
36+
background-color: #856404;
37+
border: none;
38+
border-radius: 4px;
39+
color: white;
40+
cursor: pointer;
41+
font-size: 12px;
42+
font-weight: 500;
43+
margin-left: 8px;
44+
padding: 4px 12px;
45+
transition: background-color 0.2s ease;
46+
vertical-align: baseline;
47+
}
48+
49+
.eula-banner-button:hover {
50+
background-color: #533f03;
51+
}
52+
53+
.eula-banner-button:focus {
54+
outline: 2px solid #856404;
55+
outline-offset: 2px;
56+
}
57+
58+
.eula-banner-close {
59+
background: none;
60+
border: none;
61+
color: #856404;
62+
cursor: pointer;
63+
font-size: 20px;
64+
font-weight: bold;
65+
line-height: 1;
66+
margin-left: 16px;
67+
padding: 0;
68+
width: 24px;
69+
height: 24px;
70+
display: flex;
71+
align-items: center;
72+
justify-content: center;
73+
border-radius: 4px;
74+
transition: background-color 0.2s ease, color 0.2s ease;
75+
}
76+
77+
.eula-banner-close:hover:not(:disabled) {
78+
background-color: rgba(133, 100, 4, 0.1);
79+
}
80+
81+
.eula-banner-close:focus:not(:disabled) {
82+
outline: 2px solid #856404;
83+
outline-offset: 2px;
84+
}
85+
86+
.eula-banner-close-disabled,
87+
.eula-banner-close:disabled {
88+
color: #bbb !important;
89+
cursor: not-allowed !important;
90+
opacity: 0.5;
91+
}
92+
93+
.eula-banner-close-disabled:hover,
94+
.eula-banner-close:disabled:hover {
95+
background-color: transparent !important;
96+
}
97+
598
md-content.blankslate {
699
background-color: rgb(243, 244, 250);
7100
padding-top: 50px;

0 commit comments

Comments
 (0)