commit 1566f28d042b730762ebce7cc7318b4d69458188
parent 7d2193c7749c0fd87769a96a5e62873119ccf315
Author: Florian X <flokX@users.noreply.github.com>
Date: Fri, 21 Jun 2019 18:08:15 +0200
Use the latest JavaScript magic
Diffstat:
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/admin/main.js b/admin/main.js
@@ -60,9 +60,16 @@ function getCharts() {
}).then(function (response) {
return response.json();
}).then(function (json) {
- for (let name in json) {
- let data = json[name];
- chartsDiv.insertAdjacentHTML('beforeend', '<div id="card-' + name + '" class="card text-center mb-3"><div class="card-header">' + name + '</div><div class="card-body p-2"><div id="heatmap-' + name + '" class="overflow-auto"></div></div><div class="card-footer text-muted"><a id="export-' + name + '" href="#export" class="card-link">Export chart</a><a id="delete-' + name + '" href="#delete" class="card-link">Delete shortlink and dataset</a></div></div>');
+ for (let [name, data] of Object.entries(json)) {
+ chartsDiv.insertAdjacentHTML('beforeend', `<div id="card-${name}" class="card text-center mb-3">
+ <div class="card-header">${name}</div>
+ <div class="card-body p-2">
+ <div id="heatmap-${name}" class="overflow-auto"></div>
+ </div>
+ <div class="card-footer text-muted">
+ <a id="export-${name}" href="#export" class="card-link">Export chart</a><a id="delete-${name}" href="#delete" class="card-link">Delete shortlink and dataset</a>
+ </div>
+</div>`);
let heatmap = new frappe.Chart('div#heatmap-' + name, {
type: 'heatmap',
title: 'Access statistics for ' + name,