taskcard

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 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 Model

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

Model 任务卡片组件模型

func New

func New(taskID, title string) Model

New 创建新的任务卡片

func (*Model) AppendOutput

func (m *Model) AppendOutput(line string, isError bool)

AppendOutput 追加输出内容

func (*Model) AppendOutputs added in v0.0.6

func (m *Model) AppendOutputs(lines []types.OutputLine)

AppendOutputs 批量追加输出内容

func (*Model) ClearOutput

func (m *Model) ClearOutput()

ClearOutput 清空输出

func (Model) GetOutputLines

func (m Model) GetOutputLines() []string

GetOutputLines 获取原始输出行(不含样式)

func (Model) GetRawOutputLines

func (m Model) GetRawOutputLines() []string

GetRawOutputLines 获取未格式化的输出行

func (Model) GetStatus

func (m Model) GetStatus() types.TaskStatus

GetStatus 获取任务状态

func (Model) GetTaskID

func (m Model) GetTaskID() string

GetTaskID 获取任务 ID

func (Model) Init

func (m Model) Init() tea.Cmd

Init 实现 tea.Model 接口

func (Model) RenderCompact

func (m Model) RenderCompact() string

RenderCompact 紧凑模式渲染(不显示输出内容)

func (*Model) SetProgress

func (m *Model) SetProgress(current, total int)

SetProgress 设置进度

func (*Model) SetSize

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

SetSize 设置卡片尺寸

func (*Model) SetStatus

func (m *Model) SetStatus(status types.TaskStatus)

SetStatus 设置任务状态

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