Documentation
¶
Index ¶
- Variables
- func FetchMihomoVersion(client *api.Client) tea.Cmd
- func GetSettingValue(cfg *config.Config, index int) string
- func LanguageSettingIndex() int
- func RenderSettingsPage(state PageState, width, height int) string
- type PageState
- type State
- func (s State) ApplyMihomoVersion(version string) State
- func (s State) HandleMouseLeft(pageX, pageY int, cfg *config.Config, configSvc *service.ConfigService) (State, *config.Config, string)
- func (s State) HandleMouseScroll(up bool) State
- func (s State) IsEditing() bool
- func (s State) ToPageState(cfg *config.Config) PageState
- func (s State) Update(msg tea.KeyMsg, cfg *config.Config, configSvc *service.ConfigService) (State, *config.Config, string, tea.Cmd)
Constants ¶
This section is empty.
Variables ¶
View Source
var SettingDescs = []string{
"Clash API 服务地址",
"API 认证密钥",
"用于测试节点延迟的 URL",
"连接超时时间(毫秒)",
"HTTP/SOCKS5 代理地址",
"界面显示语言",
"数据自动刷新间隔(秒)",
}
View Source
var SettingKeys = []string{"api-address", "secret", "test-url", "timeout", "proxy-address", "language", "auto-refresh-interval"}
View Source
var SettingLabels = []string{"API 地址", "密钥", "测速URL", "超时(ms)", "代理地址", "语言", "自动刷新(秒)"}
Functions ¶
func FetchMihomoVersion ¶
FetchMihomoVersion 返回一个拉取 Mihomo 版本信息的 Cmd
func GetSettingValue ¶
GetSettingValue 获取配置值
func LanguageSettingIndex ¶
func LanguageSettingIndex() int
func RenderSettingsPage ¶
RenderSettingsPage 渲染设置页面
Types ¶
type PageState ¶
type PageState struct {
Config *config.Config
SelectedSetting int
EditMode bool
EditValue string
EditCursor int
// Toast 状态
Toast *common.ToastManager
MihomoVersion string
}
PageState 设置页面状态
type State ¶
type State struct {
// contains filtered or unexported fields
}
State 设置页面完整状态
func (State) ApplyMihomoVersion ¶
ApplyMihomoVersion 应用版本信息
func (State) HandleMouseLeft ¶
func (s State) HandleMouseLeft(pageX, pageY int, cfg *config.Config, configSvc *service.ConfigService) (State, *config.Config, string)
HandleMouseLeft 处理 settings 页面左键单击/双击
func (State) HandleMouseScroll ¶
HandleMouseScroll 鼠标滚轮处理
func (State) ToPageState ¶
ToPageState 转换为渲染层所需的 PageState
Click to show internal directories.
Click to hide internal directories.