views

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2025 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigConfig

type ConfigConfig struct {
	Redis  *redis.Client
	Prefix string
	Logger *slog.Logger
}

ConfigConfig holds config view configuration

type ConfigView

type ConfigView struct {
	// contains filtered or unexported fields
}

ConfigView represents the configuration editor view

func NewConfigView

func NewConfigView(config *ConfigConfig) *ConfigView

NewConfigView creates a new config view

func (*ConfigView) GetView

func (v *ConfigView) GetView() tview.Primitive

GetView returns the config view

func (*ConfigView) Refresh

func (v *ConfigView) Refresh(ctx context.Context)

Refresh refreshes the config data

type Dashboard

type Dashboard struct {
	// contains filtered or unexported fields
}

Dashboard represents the main dashboard view

func NewDashboard

func NewDashboard(config *DashboardConfig) *Dashboard

NewDashboard creates a new dashboard view

func (*Dashboard) GetView

func (d *Dashboard) GetView() tview.Primitive

GetView returns the dashboard view

func (*Dashboard) Refresh

func (d *Dashboard) Refresh(ctx context.Context)

Refresh refreshes the dashboard data

type DashboardConfig

type DashboardConfig struct {
	Registry *distributed.Registry
	Redis    *redis.Client
	MongoDB  *mongo.Database
	Logger   *slog.Logger
}

DashboardConfig holds dashboard configuration

type EnhancedLogsConfig

type EnhancedLogsConfig struct {
	Store      logging.Store
	MaxLogs    int
	AutoScroll bool
}

EnhancedLogsConfig holds configuration

type EnhancedLogsView

type EnhancedLogsView struct {
	// contains filtered or unexported fields
}

EnhancedLogsView represents an enhanced logs viewer using the modular logging system

func NewEnhancedLogsView

func NewEnhancedLogsView(config *EnhancedLogsConfig) *EnhancedLogsView

NewEnhancedLogsView creates an enhanced logs view

func (*EnhancedLogsView) GetView

func (v *EnhancedLogsView) GetView() tview.Primitive

GetView returns the view primitive

func (*EnhancedLogsView) SetApp

func (v *EnhancedLogsView) SetApp(app *tview.Application)

SetApp sets the application reference for redraws

func (*EnhancedLogsView) Stop

func (v *EnhancedLogsView) Stop()

Stop stops the logs view

type LogEntry

type LogEntry struct {
	Timestamp time.Time              `json:"timestamp"`
	Level     string                 `json:"level"`
	NodeID    string                 `json:"node_id"`
	Message   string                 `json:"message"`
	Fields    map[string]interface{} `json:"fields"`
}

LogEntry represents a log entry

type LogFilter

type LogFilter struct {
	Level  string
	NodeID string
	Search string
}

LogFilter holds log filtering options

type LogInterceptor

type LogInterceptor struct {
	// contains filtered or unexported fields
}

LogInterceptor intercepts fmt.Printf and similar output and redirects to log view

func NewLogInterceptor

func NewLogInterceptor(view *TaskManagerView) *LogInterceptor

NewLogInterceptor creates a new log interceptor

func (*LogInterceptor) Flush

func (l *LogInterceptor) Flush()

Flush flushes any remaining buffer

func (*LogInterceptor) Printf

func (l *LogInterceptor) Printf(format string, args ...interface{})

Printf logs a formatted message (replacement for fmt.Printf)

func (*LogInterceptor) Println

func (l *LogInterceptor) Println(args ...interface{})

Println logs a message with newline (replacement for fmt.Println)

func (*LogInterceptor) RedirectOutput

func (l *LogInterceptor) RedirectOutput()

RedirectOutput redirects stdout/stderr to the log interceptor

func (*LogInterceptor) Write

func (l *LogInterceptor) Write(p []byte) (n int, err error)

Write implements io.Writer interface

type LogStats

type LogStats struct {
	Total      int
	Levels     map[logging.Level]int
	Sources    map[string]int
	Rate       float64
	LastUpdate time.Time
}

LogStats tracks log statistics

type LogsConfig

type LogsConfig struct {
	Redis  *redis.Client
	Prefix string
	Logger *slog.Logger
}

LogsConfig holds logs view configuration

type LogsView

type LogsView struct {
	// contains filtered or unexported fields
}

LogsView represents the logs viewer

func NewLogsView

func NewLogsView(config *LogsConfig) *LogsView

NewLogsView creates a new logs view

func (*LogsView) GetView

func (v *LogsView) GetView() tview.Primitive

GetView returns the logs view

func (*LogsView) Refresh

func (v *LogsView) Refresh(ctx context.Context)

Refresh refreshes the logs data

type NodesConfig

type NodesConfig struct {
	Registry *distributed.Registry
	Logger   *slog.Logger
}

NodesConfig holds nodes view configuration

type NodesView

type NodesView struct {
	// contains filtered or unexported fields
}

NodesView represents the nodes management view

func NewNodesView

func NewNodesView(config *NodesConfig) *NodesView

NewNodesView creates a new nodes view

func (*NodesView) GetView

func (v *NodesView) GetView() tview.Primitive

GetView returns the nodes view

func (*NodesView) Refresh

func (v *NodesView) Refresh(ctx context.Context)

Refresh refreshes the nodes data

type TaskFilter

type TaskFilter struct {
	Status   string
	Type     string
	Priority int
	NodeID   string
}

TaskFilter holds task filtering options

type TaskManagerConfig

type TaskManagerConfig struct {
	MongoDB *mongo.Database
	Redis   *redis.Client
	Logger  *slog.Logger
}

TaskManagerConfig 任务管理配置

type TaskManagerView

type TaskManagerView struct {
	// contains filtered or unexported fields
}

TaskManagerView 任务管理视图 - 完整的任务CRUD界面

func NewTaskManagerView

func NewTaskManagerView(config *TaskManagerConfig) *TaskManagerView

NewTaskManagerView 创建任务管理视图

func (*TaskManagerView) GetView

func (v *TaskManagerView) GetView() tview.Primitive

GetView 获取视图

func (*TaskManagerView) LogDebug

func (v *TaskManagerView) LogDebug(format string, args ...interface{})

LogDebug logs a debug message

func (*TaskManagerView) LogError

func (v *TaskManagerView) LogError(format string, args ...interface{})

LogError logs an error message

func (*TaskManagerView) LogEvent

func (v *TaskManagerView) LogEvent(level string, message string)

LogEvent logs an event to the log view (public method for external use)

func (*TaskManagerView) LogInfo

func (v *TaskManagerView) LogInfo(format string, args ...interface{})

LogInfo logs an info message

func (*TaskManagerView) LogSuccess

func (v *TaskManagerView) LogSuccess(format string, args ...interface{})

LogSuccess logs a success message

func (*TaskManagerView) LogWarn

func (v *TaskManagerView) LogWarn(format string, args ...interface{})

LogWarn logs a warning message

func (*TaskManagerView) Refresh

func (v *TaskManagerView) Refresh(ctx context.Context)

Refresh 刷新视图

func (*TaskManagerView) RefreshAndFocus

func (v *TaskManagerView) RefreshAndFocus()

RefreshAndFocus 刷新并设置焦点到任务列表

func (*TaskManagerView) SetApp

func (v *TaskManagerView) SetApp(app *tview.Application)

SetApp 设置应用程序引用

type TasksConfig

type TasksConfig struct {
	Redis  *redis.Client
	Prefix string
	Logger *slog.Logger
}

TasksConfig holds tasks view configuration

type TasksView

type TasksView struct {
	// contains filtered or unexported fields
}

TasksView represents the tasks management view

func NewTasksView

func NewTasksView(config *TasksConfig) *TasksView

NewTasksView creates a new tasks view

func (*TasksView) GetView

func (v *TasksView) GetView() tview.Primitive

GetView returns the tasks view

func (*TasksView) Refresh

func (v *TasksView) Refresh(ctx context.Context)

Refresh refreshes the tasks data

Jump to

Keyboard shortcuts

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