- Agent: WAU registry config check (include/exclude URLs), pending updates count - Backend: /wau/compliance per customer, /wau/compliance/summary all customers - Frontend: compliance badge in customer list, compliance panel in WAU tab - config.js: no longer gitignored (secrets-free, reads from env/window.__RMM_CONFIG__) - vite.config.js: reads backend URL from .env instead of hardcoded value - .env.example added for clean setup
53 lines
2.3 KiB
Go
53 lines
2.3 KiB
Go
package models
|
|
|
|
import "time"
|
|
|
|
type WAURule struct {
|
|
ID int `json:"id"`
|
|
CustomerID int `json:"customer_id"`
|
|
WingetID string `json:"winget_id"`
|
|
DisplayName string `json:"display_name"`
|
|
RuleType string `json:"rule_type"` // "allow" | "block"
|
|
CreatedAt time.Time `json:"created_at"`
|
|
}
|
|
|
|
type WAUSoftwareEntry struct {
|
|
Name string `json:"name"`
|
|
Publisher string `json:"publisher"`
|
|
DeviceCount int `json:"device_count"`
|
|
Versions []string `json:"versions"`
|
|
}
|
|
|
|
// WAUPackageCompliance beschreibt den Compliance-Status eines einzelnen Pakets auf einem Gerät
|
|
type WAUPackageCompliance struct {
|
|
WingetID string `json:"winget_id"`
|
|
DisplayName string `json:"display_name"`
|
|
Installed bool `json:"installed"`
|
|
HasUpdates bool `json:"has_updates"` // true wenn PendingCount > 0 und dieses Paket betroffen
|
|
}
|
|
|
|
// WAUAgentCompliance beschreibt den vollständigen WAU-Compliance-Status eines Agents
|
|
type WAUAgentCompliance struct {
|
|
AgentID string `json:"agent_id"`
|
|
AgentName string `json:"agent_name"`
|
|
WAUInstalled bool `json:"wau_installed"`
|
|
WAUConfigOK bool `json:"wau_config_ok"` // Include/Exclude-URLs korrekt gesetzt
|
|
IncludeURL string `json:"include_url"` // tatsächlich konfigurierte URL
|
|
ExcludeURL string `json:"exclude_url"` // tatsächlich konfigurierte URL
|
|
PendingCount int `json:"pending_updates"`
|
|
Packages []WAUPackageCompliance `json:"packages"`
|
|
Compliant bool `json:"compliant"` // true wenn alles OK
|
|
}
|
|
|
|
// WAUComplianceSummary fasst den Compliance-Status eines Kunden zusammen (für die Kundenliste)
|
|
type WAUComplianceSummary struct {
|
|
CustomerID int `json:"customer_id"`
|
|
TotalAgents int `json:"total_agents"`
|
|
CompliantAgents int `json:"compliant_agents"`
|
|
WAUMissing int `json:"wau_missing"` // Agents ohne WAU
|
|
WAUMisconfigured int `json:"wau_misconfigured"` // WAU installiert, aber falsche URLs
|
|
PackagesMissing int `json:"packages_missing"` // Agents mit fehlenden Pflichtpaketen
|
|
UpdatesPending int `json:"updates_pending"` // Agents mit ausstehenden Updates
|
|
Status string `json:"status"` // "ok" | "warning" | "critical"
|
|
}
|