Documentation
¶
Index ¶
- Constants
- Variables
- func GetBaseStyleHeight() int
- func GetBaseStyleWidth() int
- type BDPan
- func (m *BDPan) AddFileTask(f *model.File, t TaskType) *Task
- func (m *BDPan) AddOrAppendFileTask(f *model.File, tt TaskType) *Task
- func (m *BDPan) AddTask(b TaskBinding) *Task
- func (m *BDPan) CanPreviewFile(f *bdpan.FileInfo) (bool, tea.Cmd)
- func (m *BDPan) CanSelectFile() bool
- func (m *BDPan) ClearCutSelectFileMap()
- func (m *BDPan) ClearLastKey() *BDPan
- func (m *BDPan) ClearSelectFileMap()
- func (m *BDPan) ConfirmFocused() bool
- func (m *BDPan) DisableLoadingFileList() *BDPan
- func (m *BDPan) DoneTask(t *Task, err error) tea.Cmd
- func (m *BDPan) EnableLoadingFileList() *BDPan
- func (m *BDPan) FileContentFocused() bool
- func (m *BDPan) FileListFocus() *BDPan
- func (m *BDPan) FileListModelIsNil() bool
- func (m *BDPan) FileListModelIsNotNil() bool
- func (m *BDPan) FilesIsNotNil() bool
- func (m *BDPan) GetCenterView() string
- func (m *BDPan) GetConfirmTasks() []*Task
- func (m *BDPan) GetConfirmView() string
- func (m *BDPan) GetCurrFiles() []*model.File
- func (m *BDPan) GetCutSelectFilePaths() []string
- func (m *BDPan) GetCutSelectFiles() []*model.File
- func (m *BDPan) GetDirView() string
- func (m *BDPan) GetFileInfoView(f *model.File) string
- func (m *BDPan) GetFileListCursor() int
- func (m *BDPan) GetFileListView() string
- func (m *BDPan) GetFiles(dir string) []*model.File
- func (m *BDPan) GetHeight() int
- func (m *BDPan) GetHelpView() string
- func (m *BDPan) GetInputView() string
- func (m *BDPan) GetLeftWidth() int
- func (m *BDPan) GetMessageView() string
- func (m *BDPan) GetMidHeight() int
- func (m *BDPan) GetMidView() string
- func (m *BDPan) GetMidWidth() int
- func (m *BDPan) GetQuickByKeyStr(k string) *model.Quick
- func (m *BDPan) GetQuickByPath(p string) *model.Quick
- func (m *BDPan) GetQuickKeys() []key.Binding
- func (m *BDPan) GetRightExtModels() []wtea.Model
- func (m *BDPan) GetRightView() string
- func (m *BDPan) GetRightWidth() int
- func (m *BDPan) GetSelectFile() (*model.File, error)
- func (m *BDPan) GetSelectFilePaths() []string
- func (m *BDPan) GetSelectFiles() []*model.File
- func (m *BDPan) GetStatusView() string
- func (m *BDPan) GetTaskByType(tt TaskType) *Task
- func (m *BDPan) GetWidth() int
- func (m *BDPan) Goto(dir string) tea.Cmd
- func (m *BDPan) HasSelectFile() bool
- func (m *BDPan) Init() tea.Cmd
- func (m *BDPan) InputBlur()
- func (m *BDPan) InputFocused() bool
- func (m *BDPan) IsLoadingFileList() bool
- func (m *BDPan) ListenCombKeyMsg(msg tea.Msg) (bool, tea.Cmd)
- func (m *BDPan) ListenFileListKeyMsg(msg tea.Msg) (bool, tea.Cmd)
- func (m *BDPan) ListenKeyMsg(msg tea.Msg) (bool, tea.Cmd)
- func (m *BDPan) ListenOtherMsg(msg tea.Msg) (bool, tea.Cmd)
- func (m *BDPan) ListenRunTaskMsg(msg RunTaskMsg) (bool, tea.Cmd)
- func (m *BDPan) MatcheKeys(msg tea.KeyMsg, b ...key.Binding) bool
- func (m *BDPan) MessageIsNotNil() bool
- func (m *BDPan) NewFileList(files []*model.File) *FileList
- func (m *BDPan) PanIsNil() bool
- func (m *BDPan) PreviewFile(f *bdpan.FileInfo) (bool, tea.Cmd)
- func (m *BDPan) RefreshQuickSelect() *BDPan
- func (m *BDPan) RestoreState(old *BDPan)
- func (m *BDPan) SendClipboardMessage(msg string) tea.Cmd
- func (m *BDPan) SendDeleteQuick(q *model.Quick) tea.Cmd
- func (m *BDPan) SendGoto(dir string) tea.Cmd
- func (m *BDPan) SendLoadingMessage() tea.Cmd
- func (m *BDPan) SendMessage(msg string, a ...any) tea.Cmd
- func (m *BDPan) SendMsg(msg tea.Msg) tea.Cmd
- func (m *BDPan) SendRefreshPan() tea.Cmd
- func (m *BDPan) SendRefreshQuick() tea.Cmd
- func (m *BDPan) SendRefreshUser() tea.Cmd
- func (m *BDPan) SendRunTask(t *Task) tea.Cmd
- func (m *BDPan) SendShowConfirm(title string, data wtea.ExtData, fromModel wtea.Model) tea.Cmd
- func (m *BDPan) SendShowInput(title, text string, task *Task, fromModel wtea.Model) tea.Cmd
- func (m *BDPan) SetFiles(files []*model.File) *BDPan
- func (m *BDPan) SetFilesAndFocus(files []*model.File) *BDPan
- func (m *BDPan) SetLastKey(msg tea.KeyMsg) *BDPan
- func (m *BDPan) SetMessage(msg string, args ...any)
- func (m *BDPan) SetQuicks(q []*model.Quick)
- func (m *BDPan) SetSomeTaskMessage()
- func (m *BDPan) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m *BDPan) UserIsNil() bool
- func (m *BDPan) View() string
- type BlurMsg
- type ChangeFilesMsg
- type ChangePanMsg
- type ChangeUserMsg
- type Confirm
- func (m *Confirm) Blur() *Confirm
- func (m *Confirm) Focus() *Confirm
- func (m *Confirm) Focused() bool
- func (m *Confirm) GetValue() bool
- func (m *Confirm) Init() tea.Cmd
- func (m *Confirm) SetTask(t *Task) *Confirm
- func (m *Confirm) Update(msg tea.Msg) (*Confirm, tea.Cmd)
- func (m *Confirm) View() string
- func (m *Confirm) Width(w int) *Confirm
- type ConfirmKeyMap
- type DeleteQuickMsg
- type Ext
- type FileContent
- type FileContentKeyMap
- type FileInfo
- type FileList
- func (m *FileList) Blur()
- func (m *FileList) Cursor(i int) *FileList
- func (m *FileList) Focus()
- func (m FileList) Focused() bool
- func (m *FileList) GetCursor() int
- func (m FileList) GetKeyMap() FileListKeyMap
- func (m *FileList) GetSelectFile() (*model.File, error)
- func (m *FileList) Init() tea.Cmd
- func (m *FileList) Update(msg tea.Msg) (*FileList, tea.Cmd)
- func (m FileList) View() string
- type FileListArg
- type FileListArgType
- type FileListKeyMap
- type FileListTaskMap
- type FocusMsg
- type GotoMsg
- type Input
- func (m Input) Blur()
- func (m Input) Focus()
- func (m Input) Focused() bool
- func (m *Input) GetFromModel() wtea.Model
- func (m Input) Init() tea.Cmd
- func (m *Input) SetFromModel(model wtea.Model)
- func (m Input) SetHeight(h int)
- func (m Input) SetWidth(w int)
- func (m *Input) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m Input) Value() string
- func (m Input) View() string
- type InputKeyMap
- type KeyMap
- type MessageTimeoutMsg
- type Quick
- func (m *Quick) Blur()
- func (m *Quick) Focus()
- func (m *Quick) Focused() bool
- func (m *Quick) GetKeyMap() QuickKeyMap
- func (m *Quick) GetSelect() *model.Quick
- func (m *Quick) Height(h int) *Quick
- func (m Quick) Init() tea.Cmd
- func (m *Quick) Select(i int) *Quick
- func (m *Quick) SetItems(items []list.Item) *Quick
- func (m *Quick) Update(msg tea.Msg) (*Quick, tea.Cmd)
- func (m Quick) View() string
- func (m *Quick) Width(w int) *Quick
- type QuickKeyMap
- type QuickTaskMap
- type RefreshPanMsg
- type RefreshQuickMsg
- type RefreshUserMsg
- type RunTaskMsg
- type ShowConfirmMsg
- type ShowInputMsg
- type Task
- type TaskBinding
- type TaskStatus
- type TaskType
- type Terminal
Constants ¶
View Source
const ( TypeDelete TaskType = iota TypeDownload TypePaste TypeRename TaskAddQuick StatusWating TaskStatus = iota StatusRunning StatusSuccess StatusFailed )
Variables ¶
View Source
var KeyDelete = key.NewBinding( key.WithKeys("D"), key.WithHelp("D", "删除"), )
View Source
var KeyEnter = key.NewBinding( key.WithKeys("right", "l", "enter"), key.WithHelp("→/l/enter", "确认/打开"), )
Functions ¶
func GetBaseStyleHeight ¶
func GetBaseStyleHeight() int
func GetBaseStyleWidth ¶
func GetBaseStyleWidth() int
Types ¶
type BDPan ¶
type BDPan struct {
Dir string
// 需要离开 bubbles 执行的任务通知
NextAction string
ActionPayload any
Filter string // 过滤信息
KeyMap KeyMap
// contains filtered or unexported fields
}
func (*BDPan) AddOrAppendFileTask ¶
func (*BDPan) AddTask ¶ added in v0.0.3
func (m *BDPan) AddTask(b TaskBinding) *Task
func (*BDPan) CanPreviewFile ¶ added in v0.0.3
func (*BDPan) CanSelectFile ¶
func (*BDPan) ClearLastKey ¶
func (*BDPan) ConfirmFocused ¶
func (*BDPan) DisableLoadingFileList ¶
func (*BDPan) EnableLoadingFileList ¶
func (*BDPan) FileContentFocused ¶ added in v0.0.3
func (*BDPan) FileListFocus ¶
func (*BDPan) FileListModelIsNil ¶
func (*BDPan) FileListModelIsNotNil ¶
func (*BDPan) FilesIsNotNil ¶
func (*BDPan) GetCenterView ¶
func (*BDPan) GetConfirmTasks ¶
func (*BDPan) GetConfirmView ¶
func (*BDPan) GetCurrFiles ¶ added in v0.0.3
func (*BDPan) GetCutSelectFilePaths ¶
获取剪切选中文件的地址列表
func (*BDPan) GetCutSelectFiles ¶
func (*BDPan) GetDirView ¶
func (*BDPan) GetFileListView ¶
func (*BDPan) GetHelpView ¶
func (*BDPan) GetInputView ¶ added in v0.0.3
func (*BDPan) GetLeftWidth ¶
func (*BDPan) GetMessageView ¶
func (*BDPan) GetMidHeight ¶
func (*BDPan) GetMidView ¶
func (*BDPan) GetMidWidth ¶
func (*BDPan) GetQuickKeys ¶
func (*BDPan) GetRightExtModels ¶ added in v0.0.3
func (*BDPan) GetRightView ¶
func (*BDPan) GetRightWidth ¶
func (*BDPan) GetSelectFiles ¶ added in v0.0.3
func (*BDPan) GetStatusView ¶
func (*BDPan) InputFocused ¶ added in v0.0.3
func (*BDPan) IsLoadingFileList ¶
func (*BDPan) ListenCombKeyMsg ¶
ListenCombKeyMsg 监听两个键位的组合
func (*BDPan) ListenFileListKeyMsg ¶ added in v0.0.3
func (*BDPan) ListenRunTaskMsg ¶ added in v0.0.3
func (m *BDPan) ListenRunTaskMsg(msg RunTaskMsg) (bool, tea.Cmd)
func (*BDPan) MessageIsNotNil ¶
func (*BDPan) PreviewFile ¶ added in v0.0.3
func (*BDPan) RefreshQuickSelect ¶
func (*BDPan) SendLoadingMessage ¶
func (*BDPan) SendRefreshPan ¶
func (*BDPan) SendRefreshQuick ¶
func (*BDPan) SendRefreshUser ¶
func (*BDPan) SendShowConfirm ¶
发送显示确认框消息
参数:
- title: 展示标题
- data: 确认框携带的额外信息
- fromModel: 从哪个模型跳转的,方便返回聚焦
func (*BDPan) SendShowInput ¶ added in v0.0.3
发送显示输入框消息
参数:
- title: 展示标题
- text: 展示文本
- task: 任务
- fromModel: 从哪个模型跳转的,方便返回聚焦
func (*BDPan) SetFilesAndFocus ¶ added in v0.0.3
func (*BDPan) SetSomeTaskMessage ¶
func (m *BDPan) SetSomeTaskMessage()
type ChangeFilesMsg ¶
type ChangePanMsg ¶
type ChangeUserMsg ¶
type ConfirmKeyMap ¶
type ConfirmKeyMap struct {
Enter key.Binding
Right key.Binding
Left key.Binding
Confirm key.Binding
Cancel key.Binding
}
func DefaultConfirmKeyMap ¶
func DefaultConfirmKeyMap() ConfirmKeyMap
type DeleteQuickMsg ¶
type FileContent ¶ added in v0.0.3
type FileContent struct {
Model viewport.Model
KeyMap FileContentKeyMap
// contains filtered or unexported fields
}
func NewFileContent ¶ added in v0.0.3
func NewFileContent(filePath string, opts ...any) (*FileContent, error)
func (FileContent) Init ¶ added in v0.0.3
func (m FileContent) Init() tea.Cmd
func (FileContent) View ¶ added in v0.0.3
func (m FileContent) View() string
type FileContentKeyMap ¶ added in v0.0.3
func DefaultFileContentKeyMap ¶ added in v0.0.3
func DefaultFileContentKeyMap() FileContentKeyMap
func (FileContentKeyMap) FullHelp ¶ added in v0.0.3
func (km FileContentKeyMap) FullHelp() [][]key.Binding
FullHelp implements the KeyMap interface.
func (FileContentKeyMap) ShortHelp ¶ added in v0.0.3
func (km FileContentKeyMap) ShortHelp() []key.Binding
ShortHelp implements the KeyMap interface.
type FileList ¶
type FileList struct {
KeyMap FileListKeyMap
TaskMap FileListTaskMap
// contains filtered or unexported fields
}
func NewFileList ¶
func (FileList) GetKeyMap ¶
func (m FileList) GetKeyMap() FileListKeyMap
type FileListArg ¶
type FileListArg struct {
Type FileListArgType
Files []*model.File
}
type FileListArgType ¶
type FileListArgType int
const ( FLTypeSelect FileListArgType = iota FLTypeSelectCut )
type FileListKeyMap ¶
type FileListKeyMap struct {
table.KeyMap
Exit key.Binding
Enter key.Binding
Back key.Binding
Refresh key.Binding
Space key.Binding // 空格,选中
SelectAll key.Binding // 选中全部
Delete key.Binding
Cut key.Binding // 剪切
Paste key.Binding // 黏贴
AddQuick key.Binding // 添加快速访问
Rename key.Binding // 重命名
ShowContent key.Binding // 显示内容
Filter key.Binding // 过滤
}
func DefaultFileListKeyMap ¶
func DefaultFileListKeyMap() FileListKeyMap
func (FileListKeyMap) FullHelp ¶ added in v0.0.3
func (km FileListKeyMap) FullHelp() [][]key.Binding
FullHelp implements the KeyMap interface.
func (FileListKeyMap) ShortHelp ¶ added in v0.0.3
func (km FileListKeyMap) ShortHelp() []key.Binding
ShortHelp implements the KeyMap interface.
type FileListTaskMap ¶ added in v0.0.3
type FileListTaskMap struct {
AddQuick TaskBinding
ShowContent TaskBinding
Filter TaskBinding
}
func DefaultFileListTaskMap ¶ added in v0.0.3
func DefaultFileListTaskMap() FileListTaskMap
type Input ¶ added in v0.0.3
type Input struct {
KeyMap InputKeyMap
// contains filtered or unexported fields
}
func (*Input) GetFromModel ¶ added in v0.0.3
func (*Input) SetFromModel ¶ added in v0.0.3
type InputKeyMap ¶ added in v0.0.3
func DefaultInputKeyMap ¶ added in v0.0.3
func DefaultInputKeyMap() InputKeyMap
func (InputKeyMap) FullHelp ¶ added in v0.0.3
func (km InputKeyMap) FullHelp() [][]key.Binding
FullHelp implements the KeyMap interface.
func (InputKeyMap) ShortHelp ¶ added in v0.0.3
func (km InputKeyMap) ShortHelp() []key.Binding
ShortHelp implements the KeyMap interface.
type KeyMap ¶
type KeyMap struct {
Esc key.Binding
Exit key.Binding
Back key.Binding
// Right key.Binding
// Left key.Binding
Refresh key.Binding
Restore key.Binding
Help key.Binding // 帮助
// Pane
MovePaneLeft key.Binding
MovePaneRight key.Binding
// 复制组合键位
CopyPath key.Binding
CopyDir key.Binding
CopyFilename key.Binding
CopyFilenameWithoutExt key.Binding
CopyFSID key.Binding
// Goto 组合键位
GotoRoot key.Binding
}
func DefaultKeyMap ¶
func DefaultKeyMap() KeyMap
func (KeyMap) FullHelp ¶
FullHelp returns keybindings for the expanded help view. It's part of the key.Map interface.
func (KeyMap) GetCopyKeys ¶
type MessageTimeoutMsg ¶
type MessageTimeoutMsg struct{}
type Quick ¶
type Quick struct {
KeyMap QuickKeyMap
TaskMap QuickTaskMap
// contains filtered or unexported fields
}
func (*Quick) GetKeyMap ¶
func (m *Quick) GetKeyMap() QuickKeyMap
type QuickKeyMap ¶
func DefaultQuickKeyMap ¶
func DefaultQuickKeyMap() QuickKeyMap
func (QuickKeyMap) FullHelp ¶ added in v0.0.3
func (km QuickKeyMap) FullHelp() [][]key.Binding
FullHelp implements the KeyMap interface.
func (QuickKeyMap) ShortHelp ¶ added in v0.0.3
func (km QuickKeyMap) ShortHelp() []key.Binding
ShortHelp implements the KeyMap interface.
type QuickTaskMap ¶ added in v0.0.3
type QuickTaskMap struct {
Edit TaskBinding
}
func DefaultQuickTaskMap ¶ added in v0.0.3
func DefaultQuickTaskMap() QuickTaskMap
type RefreshPanMsg ¶
type RefreshPanMsg struct{}
type RefreshQuickMsg ¶
type RefreshQuickMsg struct{}
type RefreshUserMsg ¶
type RefreshUserMsg struct{}
type RunTaskMsg ¶
type RunTaskMsg struct {
Task *Task
}
type ShowConfirmMsg ¶
type ShowInputMsg ¶ added in v0.0.3
type Task ¶
type Task struct {
ID int
File *model.File
Files []*model.File
Dir string
Type TaskType
Binding TaskBinding
Status TaskStatus
IsConfirm bool
Data Ext
Ext Ext
// contains filtered or unexported fields
}
func (Task) GetStatusString ¶
func (Task) GetTypeString ¶
type TaskBinding ¶ added in v0.0.3
type TaskStatus ¶
type TaskStatus int
Click to show internal directories.
Click to hide internal directories.