From fede73efb18ed233082263eedd12f43beeb3d094 Mon Sep 17 00:00:00 2001 From: ansuz Date: Thu, 22 Sep 2022 16:34:35 +0530 Subject: [PATCH] enable admin option to opt-in to aggregate statistics --- lib/stats.js | 8 +++++--- www/admin/inner.js | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/stats.js b/lib/stats.js index 430c11bc7..16c0058e8 100644 --- a/lib/stats.js +++ b/lib/stats.js @@ -73,9 +73,11 @@ Stats.instanceData = function (Env) { //data.archiveRetentionTime = Env.archiveRetentionTime, } - // we won't consider instances for public listings - // unless they opt to provide more info about themselves - if (!Env.provideAggregateStatistics) { return data; } + // Admins can opt-in to providing more detailed information about the extent of the instance's usage + if (!Env.provideAggregateStatistics) { + // check how many instances provide stats before we put more work into it + data.providesAggregateStatistics = true; + } return data; }; diff --git a/www/admin/inner.js b/www/admin/inner.js index 908c8f964..9abae7a80 100644 --- a/www/admin/inner.js +++ b/www/admin/inner.js @@ -105,7 +105,7 @@ define([ 'cp-admin-update-available', 'cp-admin-checkup', 'cp-admin-block-daily-check', - //'cp-admin-provide-aggregate-statistics', + 'cp-admin-provide-aggregate-statistics', 'cp-admin-list-my-instance', 'cp-admin-consent-to-contact',