This commit is contained in:
CanbiZ (MickLesk)
2026-02-10 08:23:04 +01:00
parent 53cf705799
commit a0ba6fbbd1
3 changed files with 9 additions and 26 deletions

View File

@@ -99,9 +99,8 @@ type ToolCount struct {
}
type AddonCount struct {
Addon string `json:"addon"`
ParentCT string `json:"parent_ct"`
Count int `json:"count"`
Addon string `json:"addon"`
Count int `json:"count"`
}
// FetchDashboardData retrieves aggregated data from PocketBase
@@ -193,9 +192,9 @@ func (p *PBClient) FetchDashboardData(ctx context.Context, days int) (*Dashboard
// === Extended metrics tracking ===
// Track tool executions
if r.Type == "tool" && r.ToolName != "" {
toolCounts[r.ToolName]++
// Track tool executions (type="tool", tool name is in nsapp)
if r.Type == "tool" && r.NSAPP != "" {
toolCounts[r.NSAPP]++
data.TotalTools++
}

View File

@@ -82,13 +82,7 @@ type TelemetryIn struct {
Error string `json:"error,omitempty"` // Error description (max 120 chars)
ExitCode int `json:"exit_code,omitempty"` // 0-255
// === NEW FIELDS ===
// Tool telemetry (type="tool")
ToolName string `json:"tool_name,omitempty"` // "microcode", "lxc-update", "post-pve-install", etc.
// Addon telemetry (type="addon")
ParentCT string `json:"parent_ct,omitempty"` // Parent container name (e.g., "jellyfin")
// === EXTENDED FIELDS ===
// GPU Passthrough stats
GPUVendor string `json:"gpu_vendor,omitempty"` // "intel", "amd", "nvidia"
@@ -119,8 +113,6 @@ type TelemetryOut struct {
ExitCode int `json:"exit_code,omitempty"`
// Extended fields
ToolName string `json:"tool_name,omitempty"`
ParentCT string `json:"parent_ct,omitempty"`
GPUVendor string `json:"gpu_vendor,omitempty"`
GPUPassthrough string `json:"gpu_passthrough,omitempty"`
InstallDuration int `json:"install_duration,omitempty"`
@@ -575,9 +567,7 @@ func validate(in *TelemetryIn) error {
in.PveVer = sanitizeShort(in.PveVer, 32)
in.Method = sanitizeShort(in.Method, 32)
// Sanitize new fields
in.ToolName = sanitizeShort(in.ToolName, 64)
in.ParentCT = sanitizeShort(in.ParentCT, 64)
// Sanitize extended fields
in.GPUVendor = strings.ToLower(sanitizeShort(in.GPUVendor, 16))
in.GPUPassthrough = strings.ToLower(sanitizeShort(in.GPUPassthrough, 16))
in.ErrorCategory = strings.ToLower(sanitizeShort(in.ErrorCategory, 32))
@@ -983,8 +973,6 @@ func main() {
Method: in.Method,
Error: in.Error,
ExitCode: in.ExitCode,
ToolName: in.ToolName,
ParentCT: in.ParentCT,
GPUVendor: in.GPUVendor,
GPUPassthrough: in.GPUPassthrough,
InstallDuration: in.InstallDuration,