diff --git a/crm/api/__init__.py b/crm/api/__init__.py index 9b282a45..8b8d6f67 100644 --- a/crm/api/__init__.py +++ b/crm/api/__init__.py @@ -2,6 +2,7 @@ from bs4 import BeautifulSoup import frappe from frappe.translate import get_all_translations from frappe.utils import cstr +from frappe.utils.telemetry import POSTHOG_HOST_FIELD, POSTHOG_PROJECT_FIELD @frappe.whitelist(allow_guest=True) @@ -47,6 +48,16 @@ def get_user_signature(): return content +@frappe.whitelist() +def get_posthog_settings(): + return { + "posthog_project_id": frappe.conf.get(POSTHOG_PROJECT_FIELD), + "posthog_host": frappe.conf.get(POSTHOG_HOST_FIELD), + "enable_telemetry": frappe.get_system_settings("enable_telemetry"), + "telemetry_site_age": frappe.utils.telemetry.site_age(), + } + + def check_app_permission(): if frappe.session.user == "Administrator": return True diff --git a/frontend/src/telemetry.ts b/frontend/src/telemetry.ts index 2a9a58b7..c7c93acd 100644 --- a/frontend/src/telemetry.ts +++ b/frontend/src/telemetry.ts @@ -1,6 +1,5 @@ import '../../../frappe/frappe/public/js/lib/posthog.js' import { createResource } from 'frappe-ui' -import { computed } from 'vue' declare global { interface Window {