mirror of
https://github.com/wavetermdev/waveterm.git
synced 2024-12-21 16:38:23 +01:00
send autoupdate enabled/channel w/ telemetry
This commit is contained in:
parent
ec6a5bbeb3
commit
63f41c146c
@ -78,6 +78,16 @@ func IsTelemetryEnabled() bool {
|
||||
return settings.Settings.TelemetryEnabled
|
||||
}
|
||||
|
||||
func IsAutoUpdateEnabled() bool {
|
||||
settings := wconfig.GetWatcher().GetFullConfig()
|
||||
return settings.Settings.AutoUpdateEnabled
|
||||
}
|
||||
|
||||
func AutoUpdateChannel() string {
|
||||
settings := wconfig.GetWatcher().GetFullConfig()
|
||||
return settings.Settings.AutoUpdateChannel
|
||||
}
|
||||
|
||||
func IsAllowedRenderer(renderer string) bool {
|
||||
return allowedRenderers[renderer]
|
||||
}
|
||||
|
@ -130,7 +130,15 @@ func SendTelemetry(ctx context.Context, clientId string) error {
|
||||
}
|
||||
log.Printf("[wcloud] sending telemetry data\n")
|
||||
dayStr := daystr.GetCurDayStr()
|
||||
input := TelemetryInputType{ClientId: clientId, UserId: clientId, CurDay: dayStr, Activity: activity, AppType: "w2"}
|
||||
input := TelemetryInputType{
|
||||
ClientId: clientId,
|
||||
UserId: clientId,
|
||||
AppType: "w2",
|
||||
AutoUpdateEnabled: telemetry.IsAutoUpdateEnabled(),
|
||||
AutoUpdateChannel: telemetry.AutoUpdateChannel(),
|
||||
CurDay: dayStr,
|
||||
Activity: activity,
|
||||
}
|
||||
req, err := makeAnonPostReq(ctx, TelemetryUrl, input)
|
||||
if err != nil {
|
||||
return err
|
||||
|
@ -15,8 +15,9 @@ type NoTelemetryInputType struct {
|
||||
type TelemetryInputType struct {
|
||||
UserId string `json:"userid"`
|
||||
ClientId string `json:"clientid"`
|
||||
AppType string `json:"apptype"`
|
||||
AppType string `json:"apptype,omitempty"`
|
||||
AutoUpdateEnabled bool `json:"autoupdateenabled,omitempty"`
|
||||
AutoUpdateChannel string `json:"autoupdatechannel,omitempty"`
|
||||
CurDay string `json:"curday"`
|
||||
DefaultShell string `json:"defaultshell"`
|
||||
Activity []*telemetry.ActivityType `json:"activity"`
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user