terminal

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogEntry

type LogEntry struct {
	TaskID   string
	TaskName string
	Line     string
	IsError  bool
}

LogEntry 日志条目

type Model

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

Model 终端组件模型 - 用于展示实时日志输出

func New

func New() Model

New 创建新的终端组件

func (*Model) AppendLog

func (m *Model) AppendLog(taskID, line string, isError bool)

AppendLog 追加日志条目

func (*Model) AppendLogs added in v0.0.6

func (m *Model) AppendLogs(taskID string, lines []types.OutputLine)

AppendLogs 批量追加日志条目

func (*Model) ClearLogs

func (m *Model) ClearLogs()

ClearLogs 清空日志

func (Model) GetLogCount

func (m Model) GetLogCount() int

GetLogCount 获取日志数量

func (Model) Init

func (m Model) Init() tea.Cmd

Init 实现 tea.Model 接口

func (Model) IsAutoScroll

func (m Model) IsAutoScroll() bool

IsAutoScroll 是否自动滚动

func (*Model) NextTask added in v0.0.7

func (m *Model) NextTask()

NextTask 切换到下一个任务日志页

func (*Model) PrevTask added in v0.0.7

func (m *Model) PrevTask()

PrevTask 切换到上一个任务日志页

func (*Model) RegisterTask

func (m *Model) RegisterTask(taskID, taskName string)

RegisterTask 注册任务名称映射

func (Model) RenderCompact

func (m Model) RenderCompact(lines int) string

RenderCompact 紧凑模式渲染(只显示最后几行)

func (Model) RenderWithTitle

func (m Model) RenderWithTitle(title string) string

RenderWithTitle 带标题渲染

func (*Model) ResumeAutoScroll added in v0.1.0

func (m *Model) ResumeAutoScroll()

ResumeAutoScroll 重新开启自动滚动并跳到底部(保持当前页)

func (*Model) SetSize

func (m *Model) SetSize(width, height int)

SetSize 设置组件尺寸

func (*Model) ShowAll added in v0.1.0

func (m *Model) ShowAll()

ShowAll 回到“全部日志”并置底

func (*Model) ToggleAutoScroll

func (m *Model) ToggleAutoScroll()

ToggleAutoScroll 切换自动滚动

func (Model) Update

func (m Model) Update(msg tea.Msg) (Model, tea.Cmd)

Update 实现 tea.Model 接口

func (Model) View

func (m Model) View() string

View 渲染终端组件

Jump to

Keyboard shortcuts

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