From a0ba6fbbd1aaa0c282cad055b930c09d09188af8 Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Tue, 10 Feb 2026 08:23:04 +0100 Subject: [PATCH] - --- misc/api.func | 8 ++------ misc/data/dashboard.go | 11 +++++------ misc/data/service.go | 16 ++-------------- 3 files changed, 9 insertions(+), 26 deletions(-) diff --git a/misc/api.func b/misc/api.func index a2a178245..87d8891da 100644 --- a/misc/api.func +++ b/misc/api.func @@ -557,7 +557,6 @@ post_tool_to_api() { "random_id": "${uuid}", "type": "tool", "nsapp": "${tool_name}", - "tool_name": "${tool_name}", "status": "${status}", "exit_code": ${exit_code}, "error": "${error}", @@ -580,8 +579,7 @@ EOF # - Arguments: # * $1: addon_name (e.g., "filebrowser", "netdata") # * $2: status ("success" or "failed") -# * $3: parent_ct (optional, name of parent container) -# * $4: exit_code (optional) +# * $3: exit_code (optional) # - For addons installed inside containers # ------------------------------------------------------------------------------ post_addon_to_api() { @@ -590,8 +588,7 @@ post_addon_to_api() { local addon_name="${1:-unknown}" local status="${2:-success}" - local parent_ct="${3:-}" - local exit_code="${4:-0}" + local exit_code="${3:-0}" local error="" error_category="" local uuid duration @@ -623,7 +620,6 @@ post_addon_to_api() { "type": "addon", "nsapp": "${addon_name}", "status": "${status}", - "parent_ct": "${parent_ct}", "exit_code": ${exit_code}, "error": "${error}", "error_category": "${error_category}", diff --git a/misc/data/dashboard.go b/misc/data/dashboard.go index 80f06e465..fb1395a96 100644 --- a/misc/data/dashboard.go +++ b/misc/data/dashboard.go @@ -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++ } diff --git a/misc/data/service.go b/misc/data/service.go index 95ea0f390..99ed18135 100644 --- a/misc/data/service.go +++ b/misc/data/service.go @@ -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,