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
This commit is contained in:
CanbiZ (MickLesk)
2026-02-17 16:55:53 +01:00
parent cb5017a739
commit 5dbcabdd94
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -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++
}
+2 -2
View File
@@ -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}