Skip to content

Commit 0b891e7

Browse files
committed
Banner with survey link
1 parent 2736777 commit 0b891e7

File tree

1 file changed

+44
-1
lines changed

1 file changed

+44
-1
lines changed

pkg/dashboard/static/index.html

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,8 @@ <h1 class="name float-start">Name</h1>
195195
<button id="btnRollback" class="btn btn-sm btn-light bg-white border border-secondary me-2"
196196
title="Rollback to this revision"><i class="bi-arrow-repeat"></i> <span>Rollback</span>
197197
</button>
198-
<button id="btnTest" class="btn btn-sm btn-light bg-white border border-secondary me-2 display-none"
198+
<button id="btnTest"
199+
class="btn btn-sm btn-light bg-white border border-secondary me-2 display-none"
199200
title="Run tests for this chart"><i class="bi-check-circle"></i> <span>Run tests</span>
200201
</button>
201202
<button id="btnUninstall" class="btn btn-sm btn-light bg-white border border-secondary"
@@ -478,5 +479,47 @@ <h5 class="modal-title" id="ModalLabel">Session Ended</h5>
478479
<script src="static/actions.js"></script>
479480
<script src="static/scripts.js"></script>
480481

482+
<!-- BANNER START -->
483+
<a id="banner"
484+
href="https://helm-dashboard-survey.komodor.com/"
485+
class="display-none position-absolute top-0 start-50 translate-middle-x bg-primary text-light rounded px-2 mt-1 text-decoration-none py-1">Help
486+
shaping the future by participating in user survey <b class="bi-x-lg"></b></a>
487+
<script>
488+
function setCookie(name, value, days) {
489+
let expires = "";
490+
if (days) {
491+
const date = new Date();
492+
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
493+
expires = "; expires=" + date.toUTCString();
494+
}
495+
document.cookie = name + "=" + (value || "") + expires + "; path=/";
496+
}
497+
498+
function getCookie(name) {
499+
const nameEQ = name + "=";
500+
const ca = document.cookie.split(';');
501+
for (let i = 0; i < ca.length; i++) {
502+
const c = ca[i].trim();
503+
if (c.indexOf(nameEQ) === 0) {
504+
return c.substring(nameEQ.length, c.length)
505+
}
506+
}
507+
return null;
508+
}
509+
510+
const cookie = getCookie("hideBanner");
511+
if (cookie == null) {
512+
console.log("show")
513+
$("#banner").show()
514+
}
515+
516+
$("#banner b").click(function (evt) {
517+
evt.preventDefault()
518+
setCookie("hideBanner", "1", 365);
519+
$("#banner").hide()
520+
})
521+
</script>
522+
<!-- /BANNER END -->
523+
481524
</body>
482525
</html>

0 commit comments

Comments
 (0)