mirror of
https://github.com/Heretek-AI/telemetry-service.git
synced 2026-07-01 13:54:38 -04:00
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:
+2
-2
@@ -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
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user