1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-23 16:25:22 +03:00

Remove Google Analytics (#3148)

This commit is contained in:
haslinghuis 2022-12-16 04:11:05 +01:00 committed by GitHub
parent 96aeab67f4
commit b6d8efc9f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 30 additions and 743 deletions

View file

@ -2,12 +2,10 @@ import semver from 'semver';
import { i18n } from '../localization';
const configuration = {
analyticsChanges: {},
// intended
};
configuration.initialize = function (callback) {
const self = this;
if (GUI.active_tab != 'configuration') {
GUI.active_tab = 'configuration';
GUI.configuration_loaded = true;
@ -49,8 +47,6 @@ configuration.initialize = function (callback) {
load_serial_config();
function process_html() {
self.analyticsChanges = {};
const features_e = $('.tab-configuration .features');
FC.FEATURE_CONFIG.features.generateElements(features_e);
@ -129,39 +125,15 @@ configuration.initialize = function (callback) {
orientation_mag_e.val(FC.SENSOR_ALIGNMENT.align_mag);
orientation_gyro_e.change(function () {
let value = parseInt($(this).val());
let newValue = undefined;
if (value !== FC.SENSOR_ALIGNMENT.align_gyro) {
newValue = $(this).find('option:selected').text();
}
self.analyticsChanges['GyroAlignment'] = newValue;
FC.SENSOR_ALIGNMENT.align_gyro = value;
FC.SENSOR_ALIGNMENT.align_gyro = parseInt($(this).val());
});
orientation_acc_e.change(function () {
let value = parseInt($(this).val());
let newValue = undefined;
if (value !== FC.SENSOR_ALIGNMENT.align_acc) {
newValue = $(this).find('option:selected').text();
}
self.analyticsChanges['AccAlignment'] = newValue;
FC.SENSOR_ALIGNMENT.align_acc = value;
FC.SENSOR_ALIGNMENT.align_acc = parseInt($(this).val());
});
orientation_mag_e.change(function () {
let value = parseInt($(this).val());
let newValue = undefined;
if (value !== FC.SENSOR_ALIGNMENT.align_mag) {
newValue = $(this).find('option:selected').text();
}
self.analyticsChanges['MagAlignment'] = newValue;
FC.SENSOR_ALIGNMENT.align_mag = value;
FC.SENSOR_ALIGNMENT.align_mag = parseInt($(this).val());
});
// Multi gyro config
@ -205,27 +177,11 @@ configuration.initialize = function (callback) {
$('.gyro_alignment_inputs_notfound').toggle(!detected_gyro_1 && !detected_gyro_2);
orientation_gyro_1_align_e.change(function () {
let value = parseInt($(this).val());
let newValue = undefined;
if (value !== FC.SENSOR_ALIGNMENT.gyro_1_align) {
newValue = $(this).find('option:selected').text();
}
self.analyticsChanges['Gyro1Alignment'] = newValue;
FC.SENSOR_ALIGNMENT.gyro_1_align = value;
FC.SENSOR_ALIGNMENT.gyro_1_align = parseInt($(this).val());
});
orientation_gyro_2_align_e.change(function () {
let value = parseInt($(this).val());
let newValue = undefined;
if (value !== FC.SENSOR_ALIGNMENT.gyro_2_align) {
newValue = $(this).find('option:selected').text();
}
self.analyticsChanges['Gyro2Alignment'] = newValue;
FC.SENSOR_ALIGNMENT.gyro_2_align = value;
FC.SENSOR_ALIGNMENT.gyro_2_align = parseInt($(this).val());
});
// Gyro and PID update
@ -489,20 +445,10 @@ configuration.initialize = function (callback) {
const value = parseInt(pidSelectElement.val());
if (value !== FC.PID_ADVANCED_CONFIG.pid_process_denom) {
const newFrequency = pidSelectElement.find('option:selected').text();
self.analyticsChanges['PIDLoopSettings'] = `denominator: ${value} | frequency: ${newFrequency}`;
} else {
self.analyticsChanges['PIDLoopSettings'] = undefined;
}
FC.PID_ADVANCED_CONFIG.pid_process_denom = value;
FC.RX_CONFIG.fpvCamAngleDegrees = parseInt($('input[name="fpvCamAngleDegrees"]').val());
analytics.sendSaveAndChangeEvents(analytics.EVENT_CATEGORIES.FLIGHT_CONTROLLER, self.analyticsChanges, 'configuration');
self.analyticsChanges = {};
// fill some data
FC.GPS_CONFIG.auto_baud = $('input[name="gps_auto_baud"]').is(':checked') ? 1 : 0;
FC.GPS_CONFIG.auto_config = $('input[name="gps_auto_config"]').is(':checked') ? 1 : 0;