fix: #8105, fix export json on page load

v1.18.x
Barış Soner Uşaklı 5 years ago
parent 527745310d
commit 5a8217de01

@ -465,7 +465,7 @@ define('admin/general/dashboard', ['semver', 'Chart', 'translator', 'benchpress'
// Update the View as JSON button url
var apiEl = $('#view-as-json');
var newHref = $.param({
units: units,
units: units || 'hours',
until: until,
count: amount,
});

@ -8,7 +8,7 @@ const _ = require('lodash');
const versions = require('../../admin/versions');
const db = require('../../database');
const meta = require('../../meta');
const analytics = require('../../analytics').async;
const analytics = require('../../analytics');
const plugins = require('../../plugins');
const user = require('../../user');
const utils = require('../../utils');
@ -93,7 +93,7 @@ dashboardController.getAnalytics = async (req, res, next) => {
}
const method = req.query.units === 'days' ? analytics.getDailyStatsForSet : analytics.getHourlyStatsForSet;
let payload = await Promise.all(sets.map(async set => method('analytics:' + set, until, count)));
let payload = await Promise.all(sets.map(set => method('analytics:' + set, until, count)));
payload = _.zipObject(sets, payload);
res.json({

Loading…
Cancel
Save