clash-controller 0.2.4__tar.gz → 0.2.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {clash_controller-0.2.4 → clash_controller-0.2.5}/PKG-INFO +3 -7
- {clash_controller-0.2.4 → clash_controller-0.2.5}/README.md +2 -6
- {clash_controller-0.2.4 → clash_controller-0.2.5}/clash_controller/__init__.py +1 -1
- {clash_controller-0.2.4 → clash_controller-0.2.5}/clash_controller/screens/config.py +2 -2
- {clash_controller-0.2.4 → clash_controller-0.2.5}/clash_controller/widgets.py +28 -7
- {clash_controller-0.2.4 → clash_controller-0.2.5}/clash_controller.egg-info/PKG-INFO +3 -7
- {clash_controller-0.2.4 → clash_controller-0.2.5}/pyproject.toml +1 -1
- {clash_controller-0.2.4 → clash_controller-0.2.5}/clash_controller/__main__.py +0 -0
- {clash_controller-0.2.4 → clash_controller-0.2.5}/clash_controller/api.py +0 -0
- {clash_controller-0.2.4 → clash_controller-0.2.5}/clash_controller/app.py +0 -0
- {clash_controller-0.2.4 → clash_controller-0.2.5}/clash_controller/app.tcss +0 -0
- {clash_controller-0.2.4 → clash_controller-0.2.5}/clash_controller/config.py +0 -0
- {clash_controller-0.2.4 → clash_controller-0.2.5}/clash_controller/deploy.py +0 -0
- {clash_controller-0.2.4 → clash_controller-0.2.5}/clash_controller/main.py +0 -0
- {clash_controller-0.2.4 → clash_controller-0.2.5}/clash_controller/screens/__init__.py +0 -0
- {clash_controller-0.2.4 → clash_controller-0.2.5}/clash_controller/screens/home.py +0 -0
- {clash_controller-0.2.4 → clash_controller-0.2.5}/clash_controller/screens/logs.py +0 -0
- {clash_controller-0.2.4 → clash_controller-0.2.5}/clash_controller/screens/overview.py +0 -0
- {clash_controller-0.2.4 → clash_controller-0.2.5}/clash_controller/screens/profiles.py +0 -0
- {clash_controller-0.2.4 → clash_controller-0.2.5}/clash_controller/screens/settings.py +0 -0
- {clash_controller-0.2.4 → clash_controller-0.2.5}/clash_controller/ssh.py +0 -0
- {clash_controller-0.2.4 → clash_controller-0.2.5}/clash_controller/ui.py +0 -0
- {clash_controller-0.2.4 → clash_controller-0.2.5}/clash_controller.egg-info/SOURCES.txt +0 -0
- {clash_controller-0.2.4 → clash_controller-0.2.5}/clash_controller.egg-info/dependency_links.txt +0 -0
- {clash_controller-0.2.4 → clash_controller-0.2.5}/clash_controller.egg-info/entry_points.txt +0 -0
- {clash_controller-0.2.4 → clash_controller-0.2.5}/clash_controller.egg-info/requires.txt +0 -0
- {clash_controller-0.2.4 → clash_controller-0.2.5}/clash_controller.egg-info/top_level.txt +0 -0
- {clash_controller-0.2.4 → clash_controller-0.2.5}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: clash_controller
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.5
|
|
4
4
|
Summary: A Textual TUI for managing Clash proxy instances
|
|
5
5
|
Author-email: Moha-Master <hongkongreporter@outlook.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -31,7 +31,7 @@ Requires-Dist: pytest-asyncio; extra == "dev"
|
|
|
31
31
|
|
|
32
32
|
## 功能特性
|
|
33
33
|
|
|
34
|
-
- **现代 TUI 界面**:统一页面骨架(顶栏返回 / 折叠菜单 / 底部提示栏 + 状态栏),全键盘 +
|
|
34
|
+
- **现代 TUI 界面**:统一页面骨架(顶栏返回 / 折叠菜单 / 底部提示栏 + 状态栏),全键盘 + 全鼠标操作,数据行单击选中、双击执行,非阻塞异步加载与应用内日志。
|
|
35
35
|
- **多端点管理**:
|
|
36
36
|
- 自动保存连接过的 Clash 端点(地址与密钥)。
|
|
37
37
|
- 启动时进入类似首页的居中大 LOGO 档案选择页,支持新增 / 编辑 / 删除。
|
|
@@ -54,7 +54,7 @@ Requires-Dist: pytest-asyncio; extra == "dev"
|
|
|
54
54
|
| **主菜单** | `1` / `2` / `3` / `4` | 直达概览 / 配置管理 / 设置 / 切换端点 |
|
|
55
55
|
| | `↑` / `↓` · `回车` | 移动光标 · 确认 |
|
|
56
56
|
| | `Esc` / `Ctrl+C` | 退出程序(切换端点请按 `4`) |
|
|
57
|
-
| **配置管理** | `↑` / `↓` · `回车` 或
|
|
57
|
+
| **配置管理** | `↑` / `↓` · `回车` 或 **双击行** | 移动光标 · 部署所选提供方 |
|
|
58
58
|
| | `Ctrl+N` / `Ctrl+E` / `Ctrl+D` | 新增 / 编辑 / 删除提供方 |
|
|
59
59
|
| | `Ctrl+R` | 刷新 |
|
|
60
60
|
| **功能页通用** | `Home` / `End` / `PgUp` / `PgDn` | 页面 / 表格滚动 |
|
|
@@ -64,10 +64,6 @@ Requires-Dist: pytest-asyncio; extra == "dev"
|
|
|
64
64
|
| **弹窗** | `回车` | 提交(表单)/ 确认(危险操作需点按「确认」) |
|
|
65
65
|
| | `Esc` / `Ctrl+C` / 「取消」 | 取消并关闭 |
|
|
66
66
|
|
|
67
|
-
> 表单类弹窗统一为三段式:标题栏 / 字段区(单行紧凑输入,密码框留空 = 保持原值,开关为单行 Switch)/ 底部按钮栏 `[取消] [保存] [危险操作置右]`。
|
|
68
|
-
> 焦点进入输入框即切换为**文本编辑模式**:使用控件原生编辑键(`Home`/`End`、`Ctrl+Shift+A` 全选、`Ctrl+X/C/V` 剪切 / 复制 / 粘贴,`TextArea` 另有 `Ctrl+Z/Y` 撤销 / 重做),底部提示栏同步切换,此时 `Ctrl+R` 刷新让位给输入框;`Ctrl+C` 有选中则复制、无选中则返回 / 取消。
|
|
69
|
-
> 「查看应用日志」位于设置页右上角 `菜单 ▾` 折叠浮层中。
|
|
70
|
-
|
|
71
67
|
## 安装
|
|
72
68
|
|
|
73
69
|
```bash
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
## 功能特性
|
|
6
6
|
|
|
7
|
-
- **现代 TUI 界面**:统一页面骨架(顶栏返回 / 折叠菜单 / 底部提示栏 + 状态栏),全键盘 +
|
|
7
|
+
- **现代 TUI 界面**:统一页面骨架(顶栏返回 / 折叠菜单 / 底部提示栏 + 状态栏),全键盘 + 全鼠标操作,数据行单击选中、双击执行,非阻塞异步加载与应用内日志。
|
|
8
8
|
- **多端点管理**:
|
|
9
9
|
- 自动保存连接过的 Clash 端点(地址与密钥)。
|
|
10
10
|
- 启动时进入类似首页的居中大 LOGO 档案选择页,支持新增 / 编辑 / 删除。
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
| **主菜单** | `1` / `2` / `3` / `4` | 直达概览 / 配置管理 / 设置 / 切换端点 |
|
|
28
28
|
| | `↑` / `↓` · `回车` | 移动光标 · 确认 |
|
|
29
29
|
| | `Esc` / `Ctrl+C` | 退出程序(切换端点请按 `4`) |
|
|
30
|
-
| **配置管理** | `↑` / `↓` · `回车` 或
|
|
30
|
+
| **配置管理** | `↑` / `↓` · `回车` 或 **双击行** | 移动光标 · 部署所选提供方 |
|
|
31
31
|
| | `Ctrl+N` / `Ctrl+E` / `Ctrl+D` | 新增 / 编辑 / 删除提供方 |
|
|
32
32
|
| | `Ctrl+R` | 刷新 |
|
|
33
33
|
| **功能页通用** | `Home` / `End` / `PgUp` / `PgDn` | 页面 / 表格滚动 |
|
|
@@ -37,10 +37,6 @@
|
|
|
37
37
|
| **弹窗** | `回车` | 提交(表单)/ 确认(危险操作需点按「确认」) |
|
|
38
38
|
| | `Esc` / `Ctrl+C` / 「取消」 | 取消并关闭 |
|
|
39
39
|
|
|
40
|
-
> 表单类弹窗统一为三段式:标题栏 / 字段区(单行紧凑输入,密码框留空 = 保持原值,开关为单行 Switch)/ 底部按钮栏 `[取消] [保存] [危险操作置右]`。
|
|
41
|
-
> 焦点进入输入框即切换为**文本编辑模式**:使用控件原生编辑键(`Home`/`End`、`Ctrl+Shift+A` 全选、`Ctrl+X/C/V` 剪切 / 复制 / 粘贴,`TextArea` 另有 `Ctrl+Z/Y` 撤销 / 重做),底部提示栏同步切换,此时 `Ctrl+R` 刷新让位给输入框;`Ctrl+C` 有选中则复制、无选中则返回 / 取消。
|
|
42
|
-
> 「查看应用日志」位于设置页右上角 `菜单 ▾` 折叠浮层中。
|
|
43
|
-
|
|
44
40
|
## 安装
|
|
45
41
|
|
|
46
42
|
```bash
|
|
@@ -30,7 +30,7 @@ COLUMN_WEIGHTS = [2, 7]
|
|
|
30
30
|
|
|
31
31
|
class ConfigScreen(PageScreen):
|
|
32
32
|
TITLE = "配置管理"
|
|
33
|
-
HINT = "↑↓ 移动 · 回车 /
|
|
33
|
+
HINT = "↑↓ 移动 · 回车 / 双击 拉取并部署所选 · Ctrl+N 新增 · Ctrl+E 编辑 · Ctrl+D 删除 · Ctrl+R 刷新 · Esc/Ctrl+C 返回"
|
|
34
34
|
|
|
35
35
|
BINDINGS = [
|
|
36
36
|
Binding("ctrl+n", "add_provider", show=False),
|
|
@@ -54,7 +54,7 @@ class ConfigScreen(PageScreen):
|
|
|
54
54
|
yield Button("重载配置", id="reload-api")
|
|
55
55
|
yield Button("更新Provider", id="update-providers")
|
|
56
56
|
yield Static("", classes="fill")
|
|
57
|
-
yield Static("
|
|
57
|
+
yield Static("双击行 = 部署该提供方", classes="fl-label")
|
|
58
58
|
yield make_table("名称", "地址", id="cf-table")
|
|
59
59
|
|
|
60
60
|
def on_mount(self) -> None:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""共享 UI 组件:确认、输入、多字段表单、输出查看、表格与模糊筛选辅助。
|
|
2
2
|
|
|
3
3
|
所有模态均为 ModalScreen 泛型返回值,配合 push_screen_wait / 回调消费;
|
|
4
|
-
数据展示统一使用 DataTable(ClickTable
|
|
4
|
+
数据展示统一使用 DataTable(ClickTable 单击选中、双击执行),不构造字符串伪表格。
|
|
5
5
|
"""
|
|
6
6
|
from __future__ import annotations
|
|
7
7
|
|
|
@@ -627,32 +627,53 @@ class MenuMarquee:
|
|
|
627
627
|
|
|
628
628
|
|
|
629
629
|
class ClickTable(DataTable):
|
|
630
|
-
"""
|
|
630
|
+
"""可操作表格:单击只选中,双击(或 Enter)才执行。
|
|
631
|
+
|
|
632
|
+
``activate="double"``(默认):单击数据格只移动光标(发 ``RowHighlighted``,
|
|
633
|
+
供状态栏 / 控制按钮刷新),``event.chain >= 2``(同格 0.5s 内第二次点击)
|
|
634
|
+
才发 ``RowSelected``。避免误点一下就把详情 / 表单顶到脸上。
|
|
635
|
+
|
|
636
|
+
``activate="click"``:单击即发 ``RowSelected``,用于「选中即生效」的选择器
|
|
637
|
+
(如格式列表、纯选择用途的主从列表)。
|
|
631
638
|
|
|
632
639
|
注意:Textual 沿 MRO 逐类派发事件,重写 `_on_click` 后父类实现仍会被调用一次,
|
|
633
640
|
因此接管分支与回落分支都必须 prevent_default(),防止 RowSelected 双发。
|
|
634
641
|
"""
|
|
635
642
|
|
|
643
|
+
def __init__(self, *, activate: str = "double", **kwargs) -> None:
|
|
644
|
+
super().__init__(**kwargs)
|
|
645
|
+
self.activate_mode = "click" if activate == "click" else "double"
|
|
646
|
+
|
|
636
647
|
async def _on_click(self, event: events.Click) -> None:
|
|
637
648
|
meta = event.style.meta if event.style is not None else {}
|
|
638
649
|
row = meta.get("row", -1)
|
|
639
650
|
col = meta.get("column", -1)
|
|
640
651
|
is_data_cell = (
|
|
641
652
|
self.cursor_type == "row"
|
|
642
|
-
and isinstance(row, int)
|
|
643
|
-
and
|
|
653
|
+
and isinstance(row, int)
|
|
654
|
+
and isinstance(col, int)
|
|
655
|
+
and 0 <= row < self.row_count
|
|
656
|
+
and col >= 0
|
|
644
657
|
and not meta.get("out_of_bounds", False)
|
|
645
658
|
)
|
|
646
659
|
if is_data_cell:
|
|
647
660
|
self.cursor_coordinate = Coordinate(row, col)
|
|
648
|
-
self.
|
|
661
|
+
if self.activate_mode == "click" or event.chain >= 2:
|
|
662
|
+
self._post_selected_message()
|
|
649
663
|
else:
|
|
650
664
|
await super()._on_click(event)
|
|
651
665
|
event.prevent_default()
|
|
652
666
|
|
|
653
667
|
|
|
654
|
-
def make_table(
|
|
655
|
-
|
|
668
|
+
def make_table(
|
|
669
|
+
*headers,
|
|
670
|
+
cursor: str = "row",
|
|
671
|
+
zebra: bool = True,
|
|
672
|
+
classes: str = "tbl",
|
|
673
|
+
activate: str = "double",
|
|
674
|
+
**kwargs,
|
|
675
|
+
) -> ClickTable:
|
|
676
|
+
dt = ClickTable(cursor_type=cursor, zebra_stripes=zebra, classes=classes, activate=activate, **kwargs)
|
|
656
677
|
dt.add_columns(*headers)
|
|
657
678
|
return dt
|
|
658
679
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: clash_controller
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.5
|
|
4
4
|
Summary: A Textual TUI for managing Clash proxy instances
|
|
5
5
|
Author-email: Moha-Master <hongkongreporter@outlook.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -31,7 +31,7 @@ Requires-Dist: pytest-asyncio; extra == "dev"
|
|
|
31
31
|
|
|
32
32
|
## 功能特性
|
|
33
33
|
|
|
34
|
-
- **现代 TUI 界面**:统一页面骨架(顶栏返回 / 折叠菜单 / 底部提示栏 + 状态栏),全键盘 +
|
|
34
|
+
- **现代 TUI 界面**:统一页面骨架(顶栏返回 / 折叠菜单 / 底部提示栏 + 状态栏),全键盘 + 全鼠标操作,数据行单击选中、双击执行,非阻塞异步加载与应用内日志。
|
|
35
35
|
- **多端点管理**:
|
|
36
36
|
- 自动保存连接过的 Clash 端点(地址与密钥)。
|
|
37
37
|
- 启动时进入类似首页的居中大 LOGO 档案选择页,支持新增 / 编辑 / 删除。
|
|
@@ -54,7 +54,7 @@ Requires-Dist: pytest-asyncio; extra == "dev"
|
|
|
54
54
|
| **主菜单** | `1` / `2` / `3` / `4` | 直达概览 / 配置管理 / 设置 / 切换端点 |
|
|
55
55
|
| | `↑` / `↓` · `回车` | 移动光标 · 确认 |
|
|
56
56
|
| | `Esc` / `Ctrl+C` | 退出程序(切换端点请按 `4`) |
|
|
57
|
-
| **配置管理** | `↑` / `↓` · `回车` 或
|
|
57
|
+
| **配置管理** | `↑` / `↓` · `回车` 或 **双击行** | 移动光标 · 部署所选提供方 |
|
|
58
58
|
| | `Ctrl+N` / `Ctrl+E` / `Ctrl+D` | 新增 / 编辑 / 删除提供方 |
|
|
59
59
|
| | `Ctrl+R` | 刷新 |
|
|
60
60
|
| **功能页通用** | `Home` / `End` / `PgUp` / `PgDn` | 页面 / 表格滚动 |
|
|
@@ -64,10 +64,6 @@ Requires-Dist: pytest-asyncio; extra == "dev"
|
|
|
64
64
|
| **弹窗** | `回车` | 提交(表单)/ 确认(危险操作需点按「确认」) |
|
|
65
65
|
| | `Esc` / `Ctrl+C` / 「取消」 | 取消并关闭 |
|
|
66
66
|
|
|
67
|
-
> 表单类弹窗统一为三段式:标题栏 / 字段区(单行紧凑输入,密码框留空 = 保持原值,开关为单行 Switch)/ 底部按钮栏 `[取消] [保存] [危险操作置右]`。
|
|
68
|
-
> 焦点进入输入框即切换为**文本编辑模式**:使用控件原生编辑键(`Home`/`End`、`Ctrl+Shift+A` 全选、`Ctrl+X/C/V` 剪切 / 复制 / 粘贴,`TextArea` 另有 `Ctrl+Z/Y` 撤销 / 重做),底部提示栏同步切换,此时 `Ctrl+R` 刷新让位给输入框;`Ctrl+C` 有选中则复制、无选中则返回 / 取消。
|
|
69
|
-
> 「查看应用日志」位于设置页右上角 `菜单 ▾` 折叠浮层中。
|
|
70
|
-
|
|
71
67
|
## 安装
|
|
72
68
|
|
|
73
69
|
```bash
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{clash_controller-0.2.4 → clash_controller-0.2.5}/clash_controller.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{clash_controller-0.2.4 → clash_controller-0.2.5}/clash_controller.egg-info/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|