-
Notifications
You must be signed in to change notification settings - Fork 302
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Make user analytics optional * Mention analytics in README * Use analytics flag
- Loading branch information
Showing
7 changed files
with
81 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
const xhr = new XMLHttpRequest(); | ||
xhr.onload = function () { | ||
if (xhr.readyState === XMLHttpRequest.DONE) { | ||
const status = JSON.parse(xhr.responseText); | ||
if (status.Analytics && status.version !== "dev") { | ||
enableDD(status.version) | ||
enableHeap() | ||
} | ||
} | ||
} | ||
xhr.open('GET', '/status', true); | ||
xhr.send(null); | ||
|
||
|
||
function enableDD(version) { | ||
(function (h, o, u, n, d) { | ||
h = h[d] = h[d] || { | ||
q: [], onReady: function (c) { | ||
h.q.push(c) | ||
} | ||
} | ||
d = o.createElement(u); | ||
d.async = true; | ||
d.src = n | ||
n = o.getElementsByTagName(u)[0]; | ||
n.parentNode.insertBefore(d, n) | ||
})(window, document, 'script', 'https://www.datadoghq-browser-agent.com/datadog-rum-v4.js', 'DD_RUM') | ||
DD_RUM.onReady(function () { | ||
DD_RUM.init({ | ||
clientToken: 'pub16d64cd1c00cf073ce85af914333bf72', | ||
applicationId: 'e75439e5-e1b3-46ba-a9e9-a2e58579a2e2', | ||
site: 'datadoghq.com', | ||
service: 'helm-dashboard', | ||
version: version, | ||
trackInteractions: true, | ||
trackResources: true, | ||
trackLongTasks: true, | ||
defaultPrivacyLevel: 'mask', | ||
sessionReplaySampleRate: 0 | ||
}) | ||
}) | ||
} | ||
|
||
function enableHeap() { | ||
window.heap = window.heap || [], heap.load = function (e, t) { | ||
window.heap.appid = e, window.heap.config = t = t || {}; | ||
let r = document.createElement("script"); | ||
r.type = "text/javascript", r.async = !0, r.src = "https://cdn.heapanalytics.com/js/heap-" + e + ".js"; | ||
let a = document.getElementsByTagName("script")[0]; | ||
a.parentNode.insertBefore(r, a); | ||
for (let n = function (e) { | ||
return function () { | ||
heap.push([e].concat(Array.prototype.slice.call(arguments, 0))) | ||
} | ||
}, p = ["addEventProperties", "addUserProperties", "clearEventProperties", "identify", "resetIdentity", "removeEventProperty", "setEventProperties", "track", "unsetEventProperty"], o = 0; o < p.length; o++) heap[p[o]] = n(p[o]) | ||
}; | ||
heap.load("3615793373"); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,32 +5,16 @@ | |
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<title>Helm Dashboard</title> | ||
<script src="static/datadog.js"></script> | ||
<script src="static/analytics.js"></script> | ||
<link rel="stylesheet" | ||
href="https://fonts.googleapis.com/css2?family=Roboto&family=Inter&family=Poppins:wght@600&family=Poppins:wght@500&family=Inter:wght@500&family=Roboto+Slab:wght@400&family=Roboto+Slab:wght@700&family=Roboto:wght@700&family=Roboto:wght@500"/> | ||
|
||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" | ||
integrity="sha384-gH2yIJqKdNHPEq0n4Mqa/HGKIhSkIHeL5AyhkYV8i59U5AR6csBvApHHNl/vI1Bx" crossorigin="anonymous"> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css"> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.13.1/styles/lightfair.min.css"/> | ||
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/diff2html/bundles/css/diff2html.min.css"/> | ||
<link href="static/styles-base.css" rel="stylesheet"> | ||
<link href="static/styles.css" rel="stylesheet"> | ||
<script type="text/javascript"> | ||
window.heap = window.heap || [], heap.load = function (e, t) { | ||
window.heap.appid = e, window.heap.config = t = t || {}; | ||
var r = document.createElement("script"); | ||
r.type = "text/javascript", r.async = !0, r.src = "https://cdn.heapanalytics.com/js/heap-" + e + ".js"; | ||
var a = document.getElementsByTagName("script")[0]; | ||
a.parentNode.insertBefore(r, a); | ||
for (var n = function (e) { | ||
return function () { | ||
heap.push([e].concat(Array.prototype.slice.call(arguments, 0))) | ||
} | ||
}, p = ["addEventProperties", "addUserProperties", "clearEventProperties", "identify", "resetIdentity", "removeEventProperty", "setEventProperties", "track", "unsetEventProperty"], o = 0; o < p.length; o++) heap[p[o]] = n(p[o]) | ||
}; | ||
heap.load("3615793373"); | ||
</script> | ||
</head> | ||
<body> | ||
|
||
|
@@ -57,7 +41,8 @@ | |
Help | ||
</a> | ||
<ul class="dropdown-menu fs-80"> | ||
<li><a class="dropdown-item" href="https://join.slack.com/t/komodorkommunity/shared_invite/zt-1dm3cnkue-ov1Yh~_95teA35QNx5yuMg" | ||
<li><a class="dropdown-item" | ||
href="https://join.slack.com/t/komodorkommunity/shared_invite/zt-1dm3cnkue-ov1Yh~_95teA35QNx5yuMg" | ||
target="_blank"><i class="bi-slack"></i> Support Chat</a></li> | ||
<li><a class="dropdown-item" href="https://github.com/komodorio/helm-dashboard" target="_blank"><i | ||
class="bi-github"></i> Project Page</a></li> | ||
|
@@ -68,7 +53,8 @@ | |
</ul> | ||
</li> | ||
<li class="nav-item mx-2 display-none upgrade-possible"> | ||
<a class="nav-link position-relative text-danger" href="https://github.com/komodorio/helm-dashboard#installing" target="_blank"> | ||
<a class="nav-link position-relative text-danger" | ||
href="https://github.com/komodorio/helm-dashboard#installing" target="_blank"> | ||
Upgrade to <span id="toolVersionUpgrade"></span> | ||
</a></li> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters