mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Add Support Grist page and nudge
Summary: Adds a new Support Grist page (accessible only in grist-core), containing options to opt in to telemetry and sponsor Grist Labs on GitHub. A nudge is also shown in the doc menu, which can be collapsed or permanently dismissed. Test Plan: Browser and server tests. Reviewers: paulfitz, dsagal Reviewed By: paulfitz Subscribers: jarek, dsagal Differential Revision: https://phab.getgrist.com/D3926
This commit is contained in:
@@ -6,7 +6,7 @@ import { applyPatch } from 'app/gen-server/lib/TypeORMPatches';
|
||||
import { getMigrations, getOrCreateConnection, getTypeORMSettings,
|
||||
undoLastMigration, updateDb } from 'app/server/lib/dbUtils';
|
||||
import { getDatabaseUrl } from 'app/server/lib/serverUtils';
|
||||
import { getTelemetryLevel } from 'app/server/lib/Telemetry';
|
||||
import { getTelemetryPrefs } from 'app/server/lib/Telemetry';
|
||||
import { Gristifier } from 'app/server/utils/gristify';
|
||||
import { pruneActionHistory } from 'app/server/utils/pruneActionHistory';
|
||||
import * as commander from 'commander';
|
||||
@@ -81,12 +81,14 @@ export function addSettingsCommand(program: commander.Command,
|
||||
.action(showTelemetry);
|
||||
}
|
||||
|
||||
function showTelemetry(options: {
|
||||
async function showTelemetry(options: {
|
||||
json?: boolean,
|
||||
all?: boolean,
|
||||
}) {
|
||||
const contracts = TelemetryContracts;
|
||||
const levelName = getTelemetryLevel();
|
||||
const db = await getHomeDBManager();
|
||||
const prefs = await getTelemetryPrefs(db);
|
||||
const levelName = prefs.telemetryLevel.value;
|
||||
const level = Level[levelName];
|
||||
if (options.json) {
|
||||
console.log(JSON.stringify({
|
||||
|
||||
Reference in New Issue
Block a user