fix(telemetry): fix typo 'sucess' -> 'success' everywhere
This commit is contained in:
parent
b5960db4f9
commit
7915237622
@ -105,7 +105,7 @@ func (p *PBClient) FetchDashboardData(ctx context.Context, days int) (*Dashboard
|
||||
data.TotalInstalls++
|
||||
|
||||
switch r.Status {
|
||||
case "sucess":
|
||||
case "success":
|
||||
data.SuccessCount++
|
||||
case "failed":
|
||||
data.FailedCount++
|
||||
@ -155,7 +155,7 @@ func (p *PBClient) FetchDashboardData(ctx context.Context, days int) (*Dashboard
|
||||
// Daily stats (use Created field if available)
|
||||
if r.Created != "" {
|
||||
date := r.Created[:10] // "2026-02-09"
|
||||
if r.Status == "sucess" {
|
||||
if r.Status == "success" {
|
||||
dailySuccess[date]++
|
||||
} else if r.Status == "failed" {
|
||||
dailyFailed[date]++
|
||||
@ -700,7 +700,7 @@ func DashboardHTML() string {
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.status-badge.sucess { background: rgba(63, 185, 80, 0.2); color: var(--accent-green); }
|
||||
.status-badge.success { background: rgba(63, 185, 80, 0.2); color: var(--accent-green); }
|
||||
.status-badge.failed { background: rgba(248, 81, 73, 0.2); color: var(--accent-red); }
|
||||
.status-badge.installing { background: rgba(210, 153, 34, 0.2); color: var(--accent-yellow); }
|
||||
|
||||
@ -1043,7 +1043,7 @@ func DashboardHTML() string {
|
||||
<input type="text" id="filterApp" placeholder="Filter by app..." oninput="filterTable()">
|
||||
<select id="filterStatus" onchange="filterTable()">
|
||||
<option value="">All Status</option>
|
||||
<option value="sucess">Success</option>
|
||||
<option value="success">Success</option>
|
||||
<option value="failed">Failed</option>
|
||||
<option value="installing">Installing</option>
|
||||
</select>
|
||||
|
||||
@ -264,12 +264,12 @@ func fetchPage(page, limit int) ([]OldDataModel, error) {
|
||||
}
|
||||
|
||||
func importRecord(pbURL, collection string, old OldDataModel) error {
|
||||
// Map status: "done" -> "sucess" (note the typo in the original schema)
|
||||
// Map status: "done" -> "success"
|
||||
status := old.Status
|
||||
switch status {
|
||||
case "done":
|
||||
status = "sucess" // Note: original schema has typo "sucess" not "success"
|
||||
case "installing", "failed", "unknown", "sucess":
|
||||
status = "success"
|
||||
case "installing", "failed", "unknown", "success":
|
||||
// keep as-is
|
||||
default:
|
||||
status = "unknown"
|
||||
|
||||
@ -64,7 +64,7 @@ type TelemetryIn struct {
|
||||
RandomID string `json:"random_id"` // Session UUID
|
||||
Type string `json:"type"` // "lxc" or "vm"
|
||||
NSAPP string `json:"nsapp"` // Application name (e.g., "jellyfin")
|
||||
Status string `json:"status"` // "installing", "sucess", "failed", "unknown"
|
||||
Status string `json:"status"` // "installing", "success", "failed", "unknown"
|
||||
|
||||
// Container/VM specs
|
||||
CTType int `json:"ct_type,omitempty"` // 1=unprivileged, 2=privileged/VM
|
||||
@ -319,7 +319,7 @@ func (p *PBClient) UpsertTelemetry(ctx context.Context, payload TelemetryOut) er
|
||||
return p.CreateTelemetry(ctx, payload)
|
||||
}
|
||||
|
||||
// For status updates (sucess/failed/unknown), find and update existing record
|
||||
// For status updates (success/failed/unknown), find and update existing record
|
||||
recordID, err := p.FindRecordByRandomID(ctx, payload.RandomID)
|
||||
if err != nil {
|
||||
// Search failed, log and return error
|
||||
@ -493,8 +493,8 @@ var (
|
||||
// Allowed values for 'type' field
|
||||
allowedType = map[string]bool{"lxc": true, "vm": true}
|
||||
|
||||
// Allowed values for 'status' field (note: "sucess" is intentional, matches PB schema)
|
||||
allowedStatus = map[string]bool{"installing": true, "sucess": true, "failed": true, "unknown": true}
|
||||
// Allowed values for 'status' field
|
||||
allowedStatus = map[string]bool{"installing": true, "success": true, "failed": true, "unknown": true}
|
||||
|
||||
// Allowed values for 'os_type' field
|
||||
allowedOsType = map[string]bool{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user