Skip to content

Commit

Permalink
Banner with survey link
Browse files Browse the repository at this point in the history
  • Loading branch information
undera committed Feb 1, 2023
1 parent 2736777 commit 0b891e7
Showing 1 changed file with 44 additions and 1 deletion.
45 changes: 44 additions & 1 deletion pkg/dashboard/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ <h1 class="name float-start">Name</h1>
<button id="btnRollback" class="btn btn-sm btn-light bg-white border border-secondary me-2"
title="Rollback to this revision"><i class="bi-arrow-repeat"></i> <span>Rollback</span>
</button>
<button id="btnTest" class="btn btn-sm btn-light bg-white border border-secondary me-2 display-none"
<button id="btnTest"
class="btn btn-sm btn-light bg-white border border-secondary me-2 display-none"
title="Run tests for this chart"><i class="bi-check-circle"></i> <span>Run tests</span>
</button>
<button id="btnUninstall" class="btn btn-sm btn-light bg-white border border-secondary"
Expand Down Expand Up @@ -478,5 +479,47 @@ <h5 class="modal-title" id="ModalLabel">Session Ended</h5>
<script src="static/actions.js"></script>
<script src="static/scripts.js"></script>

<!-- BANNER START -->
<a id="banner"
href="https://helm-dashboard-survey.komodor.com/"
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
shaping the future by participating in user survey <b class="bi-x-lg"></b></a>
<script>
function setCookie(name, value, days) {
let expires = "";
if (days) {
const date = new Date();
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
expires = "; expires=" + date.toUTCString();
}
document.cookie = name + "=" + (value || "") + expires + "; path=/";
}

function getCookie(name) {
const nameEQ = name + "=";
const ca = document.cookie.split(';');
for (let i = 0; i < ca.length; i++) {
const c = ca[i].trim();
if (c.indexOf(nameEQ) === 0) {
return c.substring(nameEQ.length, c.length)
}
}
return null;
}

const cookie = getCookie("hideBanner");
if (cookie == null) {
console.log("show")
$("#banner").show()
}

$("#banner b").click(function (evt) {
evt.preventDefault()
setCookie("hideBanner", "1", 365);
$("#banner").hide()
})
</script>
<!-- /BANNER END -->

</body>
</html>

0 comments on commit 0b891e7

Please sign in to comment.