1
1
mirror of https://github.com/leon-ai/leon.git synced 2025-01-08 10:47:45 +03:00

feat(server): support isGitpod telemetry

This commit is contained in:
louistiti 2023-04-22 23:51:08 +08:00
parent 094b1218e6
commit 075f4458a0
No known key found for this signature in database
GPG Key ID: 92CD6A2E497E1669
2 changed files with 5 additions and 1 deletions

View File

@ -118,3 +118,4 @@ export const LEON_FILE_PATH = path.join('leon.json')
export const INSTANCE_ID = fs.existsSync(LEON_FILE_PATH)
? JSON.parse(fs.readFileSync(LEON_FILE_PATH, 'utf8')).instanceID
: null
export const IS_GITPOD = process.env['GITPOD_WORKSPACE_URL'] !== undefined

View File

@ -14,6 +14,7 @@ import type {
import {
IS_TELEMETRY_ENABLED,
INSTANCE_ID,
IS_GITPOD,
IS_DEVELOPMENT_ENV,
IS_PRODUCTION_ENV,
LANG,
@ -48,7 +49,8 @@ export class Telemetry {
public static async postInstall(): Promise<PostIntallResponse> {
const { data } = await this.axios.post('/on-post-install', {
instanceID: this.instanceID
instanceID: this.instanceID,
isGitpod: IS_GITPOD
})
return data
@ -60,6 +62,7 @@ export class Telemetry {
const platform = os.platform()
const data = {
isProduction: IS_PRODUCTION_ENV,
isGitpod: IS_GITPOD,
isOnline: true,
language: LANG,
sttProvider: STT_PROVIDER,