Add screenshots and update gitignore for alpha release

- Fixed gitignore to allow Screenshots/*.png files
- Added all screenshots for README documentation
- Fixed gitignore to be less restrictive with image files
- Includes dashboard, agent, updates, and docker screenshots
This commit is contained in:
Fimeg
2025-10-16 09:16:05 -04:00
parent a7fad61de2
commit 61294ba514
36 changed files with 3088 additions and 443 deletions

View File

@@ -23,6 +23,22 @@ type Agent struct {
UpdatedAt time.Time `json:"updated_at" db:"updated_at"`
}
// AgentWithLastScan extends Agent with last scan information
type AgentWithLastScan struct {
ID uuid.UUID `json:"id" db:"id"`
Hostname string `json:"hostname" db:"hostname"`
OSType string `json:"os_type" db:"os_type"`
OSVersion string `json:"os_version" db:"os_version"`
OSArchitecture string `json:"os_architecture" db:"os_architecture"`
AgentVersion string `json:"agent_version" db:"agent_version"`
LastSeen time.Time `json:"last_seen" db:"last_seen"`
Status string `json:"status" db:"status"`
Metadata JSONB `json:"metadata" db:"metadata"`
CreatedAt time.Time `json:"created_at" db:"created_at"`
UpdatedAt time.Time `json:"updated_at" db:"updated_at"`
LastScan *time.Time `json:"last_scan" db:"last_scan"`
}
// AgentSpecs represents system specifications for an agent
type AgentSpecs struct {
ID uuid.UUID `json:"id" db:"id"`
@@ -56,6 +72,28 @@ type AgentRegistrationResponse struct {
Config map[string]interface{} `json:"config"`
}
// UTCTime is a time.Time that marshals to ISO format with UTC timezone
type UTCTime time.Time
// MarshalJSON implements json.Marshaler for UTCTime
func (t UTCTime) MarshalJSON() ([]byte, error) {
return json.Marshal(time.Time(t).UTC().Format("2006-01-02T15:04:05.000Z"))
}
// UnmarshalJSON implements json.Unmarshaler for UTCTime
func (t *UTCTime) UnmarshalJSON(data []byte) error {
var s string
if err := json.Unmarshal(data, &s); err != nil {
return err
}
parsed, err := time.Parse("2006-01-02T15:04:05.000Z", s)
if err != nil {
return err
}
*t = UTCTime(parsed)
return nil
}
// JSONB type for PostgreSQL JSONB columns
type JSONB map[string]interface{}

View File

@@ -79,10 +79,87 @@ type UpdateLogRequest struct {
// UpdateFilters for querying updates
type UpdateFilters struct {
AgentID *uuid.UUID
AgentID uuid.UUID
Status string
Severity string
PackageType string
Page int
PageSize int
}
// EVENT SOURCING MODELS
// UpdateEvent represents a single update event in the event sourcing system
type UpdateEvent struct {
ID uuid.UUID `json:"id" db:"id"`
AgentID uuid.UUID `json:"agent_id" db:"agent_id"`
PackageType string `json:"package_type" db:"package_type"`
PackageName string `json:"package_name" db:"package_name"`
VersionFrom string `json:"version_from" db:"version_from"`
VersionTo string `json:"version_to" db:"version_to"`
Severity string `json:"severity" db:"severity"`
RepositorySource string `json:"repository_source" db:"repository_source"`
Metadata JSONB `json:"metadata" db:"metadata"`
EventType string `json:"event_type" db:"event_type"`
CreatedAt time.Time `json:"created_at" db:"created_at"`
}
// UpdateState represents the current state of a package (denormalized for queries)
type UpdateState struct {
ID uuid.UUID `json:"id" db:"id"`
AgentID uuid.UUID `json:"agent_id" db:"agent_id"`
PackageType string `json:"package_type" db:"package_type"`
PackageName string `json:"package_name" db:"package_name"`
CurrentVersion string `json:"current_version" db:"current_version"`
AvailableVersion string `json:"available_version" db:"available_version"`
Severity string `json:"severity" db:"severity"`
RepositorySource string `json:"repository_source" db:"repository_source"`
Metadata JSONB `json:"metadata" db:"metadata"`
LastDiscoveredAt time.Time `json:"last_discovered_at" db:"last_discovered_at"`
LastUpdatedAt time.Time `json:"last_updated_at" db:"last_updated_at"`
Status string `json:"status" db:"status"`
}
// UpdateHistory represents the version history of a package
type UpdateHistory struct {
ID uuid.UUID `json:"id" db:"id"`
AgentID uuid.UUID `json:"agent_id" db:"agent_id"`
PackageType string `json:"package_type" db:"package_type"`
PackageName string `json:"package_name" db:"package_name"`
VersionFrom string `json:"version_from" db:"version_from"`
VersionTo string `json:"version_to" db:"version_to"`
Severity string `json:"severity" db:"severity"`
RepositorySource string `json:"repository_source" db:"repository_source"`
Metadata JSONB `json:"metadata" db:"metadata"`
UpdateInitiatedAt *time.Time `json:"update_initiated_at" db:"update_initiated_at"`
UpdateCompletedAt time.Time `json:"update_completed_at" db:"update_completed_at"`
UpdateStatus string `json:"update_status" db:"update_status"`
FailureReason string `json:"failure_reason" db:"failure_reason"`
}
// UpdateBatch represents a batch of update events
type UpdateBatch struct {
ID uuid.UUID `json:"id" db:"id"`
AgentID uuid.UUID `json:"agent_id" db:"agent_id"`
BatchSize int `json:"batch_size" db:"batch_size"`
ProcessedCount int `json:"processed_count" db:"processed_count"`
FailedCount int `json:"failed_count" db:"failed_count"`
Status string `json:"status" db:"status"`
ErrorDetails JSONB `json:"error_details" db:"error_details"`
CreatedAt time.Time `json:"created_at" db:"created_at"`
CompletedAt *time.Time `json:"completed_at" db:"completed_at"`
}
// UpdateStats represents statistics about updates
type UpdateStats struct {
TotalUpdates int `json:"total_updates" db:"total_updates"`
PendingUpdates int `json:"pending_updates" db:"pending_updates"`
ApprovedUpdates int `json:"approved_updates" db:"approved_updates"`
UpdatedUpdates int `json:"updated_updates" db:"updated_updates"`
FailedUpdates int `json:"failed_updates" db:"failed_updates"`
CriticalUpdates int `json:"critical_updates" db:"critical_updates"`
HighUpdates int `json:"high_updates" db:"high_updates"`
ImportantUpdates int `json:"important_updates" db:"important_updates"`
ModerateUpdates int `json:"moderate_updates" db:"moderate_updates"`
LowUpdates int `json:"low_updates" db:"low_updates"`
}