This repository has been archived by the owner on Apr 4, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into che#15552
- Loading branch information
Showing
40 changed files
with
858 additions
and
546 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
extensions/eclipse-che-theia-plugin-ext/src/browser/che-telemetry-main.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/********************************************************************* | ||
* Copyright (c) 2020 Red Hat, Inc. | ||
* | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
**********************************************************************/ | ||
|
||
import { interfaces } from 'inversify'; | ||
import { CheTelemetryMain } from '../common/che-protocol'; | ||
import { CheApiService } from '../common/che-protocol'; | ||
|
||
export class CheTelemetryMainImpl implements CheTelemetryMain { | ||
|
||
private readonly cheApiService: CheApiService; | ||
|
||
constructor(container: interfaces.Container) { | ||
this.cheApiService = container.get(CheApiService); | ||
} | ||
|
||
async $event(id: string, ownerId: string, properties: [string, string][]): Promise<void> { | ||
// TODO : get the infos from the browser | ||
const ip = ''; | ||
|
||
let agent = ''; | ||
let resolution = ''; | ||
const navigator = window.navigator; | ||
if (navigator) { | ||
agent = navigator.userAgent; | ||
} | ||
const screen = window.screen; | ||
if (screen) { | ||
const width = screen.width; | ||
const height = screen.height; | ||
if (height && width) { | ||
resolution = '' + width + 'x' + height; | ||
} | ||
} | ||
|
||
return this.cheApiService.submitTelemetryEvent(id, ownerId, ip, agent, resolution, properties); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.