From 5dbcabdd941c543f3d112e0a3432077c75cb0d1a Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Tue, 17 Feb 2026 16:55:53 +0100 Subject: [PATCH] fix: rename type 'tool' to 'pve' for PVE scripts, update allowedType - Change allowedType from 'tool' to 'pve' in validation - Update dashboard tracking to match type='pve' - Update TelemetryIn type comment --- dashboard.go | 4 ++-- service.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dashboard.go b/dashboard.go index e131f68..cad13fc 100644 --- a/dashboard.go +++ b/dashboard.go @@ -1731,8 +1731,8 @@ func (p *PBClient) FetchDashboardData(ctx context.Context, days int, repoSource // === Extended metrics tracking === - // Track tool executions (type="tool", tool name is in nsapp) - if r.Type == "tool" && r.NSAPP != "" { + // Track PVE tool executions (type="pve", tool name is in nsapp) + if r.Type == "pve" && r.NSAPP != "" { toolCounts[r.NSAPP]++ data.TotalTools++ } diff --git a/service.go b/service.go index b513e78..f2620e1 100644 --- a/service.go +++ b/service.go @@ -75,7 +75,7 @@ type TelemetryIn struct { // Required RandomID string `json:"random_id"` // Session UUID ExecutionID string `json:"execution_id,omitempty"` // Unique execution ID (unique-indexed in PocketBase) - Type string `json:"type"` // "lxc", "vm", "tool", "addon" + Type string `json:"type"` // "lxc", "vm", "pve", "addon" NSAPP string `json:"nsapp"` // Application name (e.g., "jellyfin") Status string `json:"status"` // "installing", "success", "failed", "aborted", "unknown" @@ -671,7 +671,7 @@ func getClientIP(r *http.Request, pt *ProxyTrust) net.IP { var ( // Allowed values for 'type' field - allowedType = map[string]bool{"lxc": true, "vm": true, "tool": true, "addon": true} + allowedType = map[string]bool{"lxc": true, "vm": true, "pve": true, "addon": true} // Allowed values for 'status' field allowedStatus = map[string]bool{"installing": true, "configuring": true, "success": true, "failed": true, "aborted": true, "unknown": true}