ui

package
v1.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 22, 2026 License: MPL-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BanEntry added in v1.2.3

type BanEntry struct {
	IP          string
	Type        string // "permanent", "temporary", "feed", "geoban"
	Reason      string
	Module      string // login, portscan, ddos, manual, feed
	Country     string
	CountryCode string
	BannedAt    string
	ExpiresAt   string // Empty for permanent
	Source      string // Config file or feed name
}

BanEntry represents a single banned IP

type BansData added in v1.2.3

type BansData struct {
	// Summary stats
	TotalBans int
	BansIPv4  int
	BansIPv6  int
	TempBans  int
	PermBans  int
	FeedBans  int
	GeoBans   int

	// Ban list
	Bans []BanEntry

	// Pagination
	Page       int
	PageSize   int
	TotalPages int

	// Filters
	Filter      string // "all", "temp", "perm", "feed", "geo"
	SearchQuery string
}

BansData holds all ban list information

type BinaryInfo added in v1.1.1

type BinaryInfo struct {
	Name    string
	Path    string
	Version string
	Size    string
}

BinaryInfo represents an installed binary

type ConfigInfo added in v1.1.1

type ConfigInfo struct {
	Name     string
	Path     string
	Modified string
	Size     string
}

ConfigInfo represents a configuration file

type CountryStats added in v1.1.1

type CountryStats struct {
	CountryCode string
	Country     string
	Count       int
	Percent     float64
}

CountryStats for geo distribution

type DashboardData added in v1.1.1

type DashboardData struct {
	// System Identity (Top Left)
	Identity SystemIdentity

	// Security KPIs (Top Right)
	Security SecurityKPIs

	// Hardware Resources
	Resources ResourceStats

	// Module Status Grid
	Modules []ModuleStatus

	// Recent Activity
	RecentBans []RecentBan

	// Theme preference
	Theme string // "dark" or "light"
}

DashboardData contains all dashboard information for zero-refresh updates

type FHSItem added in v1.1.1

type FHSItem struct {
	Path     string
	Expected string
	Actual   string
	Status   string // "ok", "error", "warning"
	Notes    string
}

FHSItem represents a filesystem hierarchy item

type GeoLookupResult added in v1.2.3

type GeoLookupResult struct {
	IP          string
	Country     string
	CountryCode string
	City        string
	Region      string
	ASN         string
	ASNOrg      string
	IsBlocked   bool   // Country is geo-blocked
	BlockReason string // Why blocked (if applicable)
}

GeoLookupResult holds GeoIP lookup results

type HealthCheck added in v1.1.1

type HealthCheck struct {
	Name     string
	Status   string // "ok", "warning", "error"
	ExitCode int
	Message  string
}

HealthCheck represents a single health check category

type HealthData added in v1.1.1

type HealthData struct {
	Timestamp     string
	OverallStatus string // "ok", "warning", "error"
	ExitCode      int
	ErrorCount    int
	WarningCount  int
	Checks        []HealthCheck
	Errors        []string
	Warnings      []string
}

HealthData holds comprehensive health check results

type HealthItem added in v1.1.1

type HealthItem struct {
	Name   string
	Status string // "ok", "warning", "error"
	Detail string // Additional info
}

HealthItem represents a single health check (legacy)

type IPCheckResult added in v1.1.1

type IPCheckResult struct {
	IP          string
	Status      string // "banned", "whitelisted", "clean"
	BannedSince string
	Reason      string
	Module      string
	Country     string
}

IPCheckResult holds the result of an IP lookup

type InventoryData added in v1.1.1

type InventoryData struct {
	Services []ServiceInfo
	Timers   []TimerInfo
	Binaries []BinaryInfo
	Configs  []ConfigInfo
	FHS      []FHSItem
}

InventoryData holds all inventory information

type LogEntry added in v1.2.3

type LogEntry struct {
	Timestamp string
	Level     string // "INFO", "WARN", "ERROR", "BAN", "UNBAN"
	Module    string
	Message   string
	IP        string // Extracted IP if present
}

LogEntry represents a log line for the viewer

type ModuleStatus added in v1.1.1

type ModuleStatus struct {
	Name        string
	Description string
	Status      string // "active", "inactive", "failed", "warning"
	Enabled     bool
	Running     bool

	// Module-specific metrics
	BansProduced int     // How many IPs this module has added
	CPUPercent   float64 // Module-specific CPU (if separate process)
	MemoryMB     float64 // Module-specific memory
	LastSync     string  // Last time module reported in
	ServiceName  string  // Systemd service name for restart
}

ModuleStatus holds individual module information

type ModulesData added in v1.2.3

type ModulesData struct {
	Modules       []ModuleStatus
	TotalModules  int
	EnabledCount  int
	DisabledCount int
	RunningCount  int
}

ModulesData holds modules page information

type NavItem struct {
	Name   string
	Path   string
	Icon   string
	Active bool
}

NavItem represents a navigation menu item

type RecentBan added in v1.1.1

type RecentBan struct {
	IP          string
	Country     string
	CountryCode string
	Reason      string
	Module      string // Which module triggered the ban
	Timestamp   string
}

RecentBan represents a recent ban entry

type ResourceStats added in v1.1.1

type ResourceStats struct {
	// CPU
	CPUPercent   float64
	CPULoadAvg1  float64
	CPULoadAvg5  float64
	CPULoadAvg15 float64

	// RAM
	RAMUsedGB  float64
	RAMTotalGB float64
	RAMPercent float64

	// Disk (focus on log partition)
	DiskUsedGB  float64
	DiskTotalGB float64
	DiskPercent float64
	DiskPath    string // Which partition we're monitoring

	// NFTBan Process specifically
	NFTBanCPU    float64
	NFTBanMemMB  float64
	NFTBanUptime string
}

ResourceStats holds system resource information

type SearchMatch added in v1.2.3

type SearchMatch struct {
	SetName     string // "blacklist_ipv4", "whitelist_ipv4", "feed_spamhaus", etc.
	SetType     string // "blacklist", "whitelist", "feed", "geoban"
	EntryType   string // "exact", "cidr_match", "range"
	MatchedCIDR string // If CIDR match, show the network
	AddedAt     string
	Reason      string
}

SearchMatch represents where an IP was found

type SearchResult added in v1.2.3

type SearchResult struct {
	IP           string
	Found        bool
	FoundIn      []SearchMatch
	TotalMatches int
}

SearchResult holds cross-set search results

type SecurityKPIs added in v1.1.1

type SecurityKPIs struct {
	// Active Bans
	BansTotal int
	BansIPv4  int
	BansIPv6  int

	// Whitelist
	WhitelistTotal int
	WhitelistIPv4  int
	WhitelistIPv6  int

	// Network Stats
	NetworkInMbps  float64
	NetworkOutMbps float64
	PacketDropRate int // Packets rejected per second

	// Event counts
	EventsLastHour int
	TotalBansEver  int
}

SecurityKPIs holds security statistics

type ServiceInfo added in v1.1.1

type ServiceInfo struct {
	Name        string
	Description string
	Status      string // "active", "inactive", "failed"
	PID         int
	MemoryMB    float64
	Uptime      string
}

ServiceInfo represents a systemd service

type SystemIdentity added in v1.1.1

type SystemIdentity struct {
	Hostname      string
	Kernel        string
	Uptime        string
	UptimeSeconds int64 // For JS counter
	NFTBanVersion string
	PanelMode     string // "active", "warning", "error"
	Heartbeat     bool   // Backend responding
}

SystemIdentity holds system identification info

type TimerInfo added in v1.1.1

type TimerInfo struct {
	Name        string
	Description string
	Status      string // "active", "inactive", "enabled"
	NextRun     string
	LastRun     string
}

TimerInfo represents a systemd timer

type ToolsData added in v1.2.3

type ToolsData struct {
	// Last lookup results (if any)
	LastIPCheck   *IPCheckResult
	LastGeoLookup *GeoLookupResult
	LastSearch    *SearchResult

	// Log viewer
	RecentLogs []LogEntry

	// Quick stats for tools context
	TotalBans      int
	TotalWhitelist int
	TotalFeeds     int
}

ToolsData holds diagnostic tools data

type UserInfo

type UserInfo struct {
	Username string
	Role     string
}

UserInfo holds current user session info

type WhitelistData added in v1.2.3

type WhitelistData struct {
	// Summary stats
	TotalEntries int
	IPv4Count    int
	IPv6Count    int
	NetworkCount int // CIDR ranges

	// Whitelist entries
	Entries []WhitelistEntry

	// Sources breakdown
	Sources []WhitelistSource
}

WhitelistData holds all whitelist information

type WhitelistEntry added in v1.2.3

type WhitelistEntry struct {
	IP      string
	Type    string // "ip", "network", "range"
	Comment string
	Source  string // Config file name
	AddedAt string
	AddedBy string // "manual", "system", "api"
}

WhitelistEntry represents a single whitelisted IP/network

type WhitelistSource added in v1.2.3

type WhitelistSource struct {
	Name       string
	Path       string
	EntryCount int
	Editable   bool // System files not editable
}

WhitelistSource represents a whitelist source file

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL