Documentation
¶
Index ¶
- func GetOverallStatusIcon(status OverallSyncStatus) string
- func GetStatusIcon(status ServiceStatus, hasInCaddy bool) string
- type KeyMap
- type Model
- type OverallSyncStatus
- type ServiceStatus
- type StatusFilters
- type StyleConfig
- type SyncStatus
- type SyncStatusDashboard
- type SyncStatusRenderer
- type SyncSummary
- type UI
- func (ui *UI) RenderDescription(description string) string
- func (ui *UI) RenderDryRun() string
- func (ui *UI) RenderError(err error) string
- func (ui *UI) RenderHostname(hostname string) string
- func (ui *UI) RenderIP(ip string) string
- func (ui *UI) RenderInfo(message string) string
- func (ui *UI) RenderKeyValue(key, value string) string
- func (ui *UI) RenderSection(title string) string
- func (ui *UI) RenderSeparator() string
- func (ui *UI) RenderSuccess(message string) string
- func (ui *UI) RenderTitle(title string, emoji string) string
- func (ui *UI) RenderWarning(message string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetOverallStatusIcon ¶ added in v0.1.0
func GetOverallStatusIcon(status OverallSyncStatus) string
GetOverallStatusIcon returns an icon for the overall status
func GetStatusIcon ¶ added in v0.1.0
func GetStatusIcon(status ServiceStatus, hasInCaddy bool) string
GetStatusIcon returns an icon representing the sync status
Types ¶
type KeyMap ¶
type KeyMap struct {
Up key.Binding
Down key.Binding
Add key.Binding
Edit key.Binding
Delete key.Binding
Apply key.Binding
Quit key.Binding
Help key.Binding
}
KeyMap defines the keybindings for the TUI
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model represents the state of the TUI application
type OverallSyncStatus ¶ added in v0.1.0
type OverallSyncStatus int
OverallSyncStatus represents the overall sync state
const ( FullyInSync OverallSyncStatus = iota PartiallyInSync OutOfSync CaddyOnly )
type ServiceStatus ¶ added in v0.1.0
type ServiceStatus struct {
Present bool // Is the entry present in this system?
IP string // What IP does it point to?
Description string // Entry description
UUID string // UUID (for UnboundDNS)
InSync bool // Does the IP match Caddy's IP?
}
ServiceStatus represents the status of a service in a particular DNS system
type StatusFilters ¶ added in v0.1.0
type StatusFilters struct {
ShowOnlyOutOfSync bool
ShowOnlyUnbound bool
ShowOnlyAdguard bool
HostnameFilter string
}
StatusFilters defines filtering options for the dashboard
type StyleConfig ¶
type StyleConfig struct {
// General styles
Header lipgloss.Style
Section lipgloss.Style
Title lipgloss.Style
Subtitle lipgloss.Style
Normal lipgloss.Style
Bold lipgloss.Style
Dimmed lipgloss.Style
// Status styles
Success lipgloss.Style
Warning lipgloss.Style
Error lipgloss.Style
Info lipgloss.Style
// Action styles
Add lipgloss.Style
Update lipgloss.Style
Remove lipgloss.Style
Count lipgloss.Style
// Content styles
Hostname lipgloss.Style
IP lipgloss.Style
Description lipgloss.Style
DryRun lipgloss.Style
// Table styles
TableStyles table.Styles
}
StyleConfig contains all the styles used in the application
func DefaultStyles ¶
func DefaultStyles() StyleConfig
DefaultStyles returns the default style configuration
type SyncStatus ¶ added in v0.1.0
type SyncStatus struct {
Hostname string
CaddyIP string // IP from Caddy config (source of truth)
UnboundStatus ServiceStatus // Status in UnboundDNS
AdguardStatus ServiceStatus // Status in AdguardHome
Overall OverallSyncStatus // Overall sync status
}
SyncStatus represents the sync status of a hostname across all systems
type SyncStatusDashboard ¶ added in v0.1.0
type SyncStatusDashboard struct {
// contains filtered or unexported fields
}
SyncStatusDashboard manages the 3-way sync status display
func NewSyncStatusDashboard ¶ added in v0.1.0
func NewSyncStatusDashboard() *SyncStatusDashboard
NewSyncStatusDashboard creates a new sync status dashboard
func (*SyncStatusDashboard) GetFilteredStatuses ¶ added in v0.1.0
func (d *SyncStatusDashboard) GetFilteredStatuses() []SyncStatus
GetFilteredStatuses returns statuses that match current filters
func (*SyncStatusDashboard) GetSummary ¶ added in v0.1.0
func (d *SyncStatusDashboard) GetSummary() SyncSummary
GetSummary returns a summary of the sync status
func (*SyncStatusDashboard) LoadSyncData ¶ added in v0.1.0
func (d *SyncStatusDashboard) LoadSyncData( caddyClient *api.CaddyClient, unboundClient *api.Client, adguardClient *api.AdguardClient, ) error
LoadSyncData fetches data from all three systems and builds the sync status
func (*SyncStatusDashboard) SetFilters ¶ added in v0.1.0
func (d *SyncStatusDashboard) SetFilters(filters StatusFilters)
SetFilters updates the current filters
type SyncStatusRenderer ¶ added in v0.1.0
type SyncStatusRenderer struct {
// contains filtered or unexported fields
}
SyncStatusRenderer handles the visual rendering of the sync status dashboard
func NewSyncStatusRenderer ¶ added in v0.1.0
func NewSyncStatusRenderer(dashboard *SyncStatusDashboard) *SyncStatusRenderer
NewSyncStatusRenderer creates a new renderer for the sync status dashboard
func (*SyncStatusRenderer) RenderCompactSummary ¶ added in v0.1.0
func (r *SyncStatusRenderer) RenderCompactSummary() string
RenderCompactSummary renders a one-line summary for quick status checks
func (*SyncStatusRenderer) RenderDashboard ¶ added in v0.1.0
func (r *SyncStatusRenderer) RenderDashboard() string
RenderDashboard renders the complete sync status dashboard
func (*SyncStatusRenderer) SetShowIPs ¶ added in v0.1.0
func (r *SyncStatusRenderer) SetShowIPs(show bool)
SetShowIPs controls whether to show IP addresses in the table
func (*SyncStatusRenderer) SetWidth ¶ added in v0.1.0
func (r *SyncStatusRenderer) SetWidth(width int)
SetWidth sets the rendering width
type SyncSummary ¶ added in v0.1.0
type SyncSummary struct {
Total int
FullyInSync int
PartiallyInSync int
OutOfSync int
CaddyOnly int
InCaddy int
InUnbound int
InAdguard int
}
SyncSummary provides statistics about the sync status
type UI ¶
type UI struct {
Styles StyleConfig
}
UI provides common UI rendering functions for all commands
func (*UI) RenderDescription ¶
RenderDescription renders a description
func (*UI) RenderDryRun ¶
RenderDryRun renders a dry run indicator
func (*UI) RenderError ¶
RenderError renders an error message
func (*UI) RenderHostname ¶
RenderHostname renders a hostname
func (*UI) RenderInfo ¶
RenderInfo renders an info message
func (*UI) RenderKeyValue ¶
RenderKeyValue renders a key-value pair
func (*UI) RenderSection ¶
RenderSection renders a section title
func (*UI) RenderSeparator ¶
RenderSeparator renders a horizontal separator line
func (*UI) RenderSuccess ¶
RenderSuccess renders a success message
func (*UI) RenderTitle ¶
RenderTitle renders a title with optional emoji
func (*UI) RenderWarning ¶
RenderWarning renders a warning message