revert: accidentally removed telemetry api

This commit is contained in:
Shariq Ansari 2024-09-01 18:56:24 +05:30
parent 703c3c504f
commit 32764624a8
2 changed files with 11 additions and 1 deletions

View File

@ -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

View File

@ -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 {