usmo 0.8.2__tar.gz → 0.8.4__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.
- {usmo-0.8.2 → usmo-0.8.4}/PKG-INFO +1 -1
- {usmo-0.8.2 → usmo-0.8.4}/docs/commands/clash.md +27 -19
- {usmo-0.8.2 → usmo-0.8.4}/scripts/_config.json +2 -2
- {usmo-0.8.2 → usmo-0.8.4}/scripts/clash.py +77 -25
- {usmo-0.8.2 → usmo-0.8.4}/src/usmo/_version.py +2 -2
- {usmo-0.8.2 → usmo-0.8.4}/.github/workflows/docs.yml +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/.github/workflows/release.yml +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/.gitignore +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/.pre-commit-config.yaml +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/README.md +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/dev/bump_version.py +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/docs/architecture.md +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/docs/commands/bench.md +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/docs/commands/blobmount.md +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/docs/commands/builtin.md +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/docs/commands/clip.md +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/docs/commands/cp.md +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/docs/commands/cu122.md +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/docs/commands/gpu.md +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/docs/commands/index.md +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/docs/commands/init.md +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/docs/commands/inject-alias.md +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/docs/commands/notify.md +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/docs/commands/openai-proxy.md +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/docs/commands/port.md +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/docs/commands/proxy.md +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/docs/commands/rsync.md +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/docs/commands/secret.md +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/docs/commands/serve.md +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/docs/commands/share.md +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/docs/commands/sysinfo.md +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/docs/commands/tunnel.md +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/docs/commands/wait.md +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/docs/development.md +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/docs/index.md +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/docs/installation.md +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/mkdocs.yml +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/pyproject.toml +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/scripts/bench.py +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/scripts/blobmount.sh +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/scripts/check_py.sh +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/scripts/clip.py +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/scripts/cp.py +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/scripts/cu122.sh +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/scripts/gpu.py +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/scripts/init.sh +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/scripts/inject_alias.py +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/scripts/install.sh +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/scripts/notify.py +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/scripts/openai_proxy.py +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/scripts/port.py +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/scripts/proxy.py +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/scripts/rsync.py +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/scripts/secret.py +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/scripts/serve.py +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/scripts/share.py +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/scripts/sysinfo.sh +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/scripts/tunnel.py +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/scripts/wait.py +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/src/usmo/__init__.py +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/src/usmo/cli.py +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/src/usmo/core.py +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/tests/conftest.py +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/tests/test_core_alias.py +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/tests/test_core_autocheck.py +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/tests/test_core_hash.py +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/tests/test_core_script.py +0 -0
- {usmo-0.8.2 → usmo-0.8.4}/tests/test_openai_proxy.py +0 -0
|
@@ -32,13 +32,13 @@ manager overrides (port/mode/tun)─┘ │
|
|
|
32
32
|
|
|
33
33
|
| Command | What it does |
|
|
34
34
|
| --- | --- |
|
|
35
|
+
| *(no args)* / `status` | Status dashboard: state, mihomo version, subscription, node, mode, toggles, traffic, dashboard URL. |
|
|
35
36
|
| `on` | Set this machine's system proxy to clash (auto-starts the core if needed). |
|
|
36
37
|
| `off` | Clear the system proxy (the core keeps running). |
|
|
37
|
-
| `up [NAME] [--tun] [--lan] [-p PORT]` | Start the core. If already running, hot-applies the given settings instead. |
|
|
38
|
-
| `down` | Stop the core (and restore system proxy). |
|
|
39
|
-
| `restart` | Restart the core. |
|
|
40
|
-
| `
|
|
41
|
-
| `use [NAME\|#]` | Switch the active subscription — **interactive menu** with no arg. |
|
|
38
|
+
| `core up [NAME] [--tun] [--lan] [-p PORT]` | Start the core. If already running, hot-applies the given settings instead. |
|
|
39
|
+
| `core down` | Stop the core (and restore system proxy). |
|
|
40
|
+
| `core restart` | Restart the core. |
|
|
41
|
+
| `sub use [NAME\|#]` | Switch the active subscription — **interactive menu** with no arg. |
|
|
42
42
|
| `sub add\|ls\|update\|rm` | Add / list (numbered) / refresh / delete subscriptions. |
|
|
43
43
|
| `node [GROUP] [NODE] [-l] [-t]` | Switch the active node (interactive with no arg); `-l` lists, `NAME` switches directly. |
|
|
44
44
|
| `mode [rule\|global\|direct]` | Get or set the routing mode. |
|
|
@@ -46,7 +46,7 @@ manager overrides (port/mode/tun)─┘ │
|
|
|
46
46
|
| `tun on\|off\|status` | Toggle TUN (transparent system-wide capture). |
|
|
47
47
|
| `lan on\|off\|status` | Toggle `allow-lan` (let other devices use this box). |
|
|
48
48
|
| `port [N]` | Get or set the local mixed HTTP+SOCKS port. |
|
|
49
|
-
| `logs [-f] [-n N] [--level L]` | Tail the log file, or stream live via the API. |
|
|
49
|
+
| `logs [-f\|-w] [-n N] [--level L]` | Tail the log file, or stream live via the API. |
|
|
50
50
|
| `conns [-w] [--close]` | Show active connections; `-w` watches live. |
|
|
51
51
|
| `dash [--no-open]` | Open the local web dashboard (metacubexd, served by mihomo). |
|
|
52
52
|
| `enable` / `disable` | Autostart at login via a systemd `--user` unit. |
|
|
@@ -125,39 +125,41 @@ expiry) is parsed and shown in `sub ls`.
|
|
|
125
125
|
Raw base64 node-list links (the generic "v2ray" format) are not supported —
|
|
126
126
|
ask your provider for the Clash link (almost all offer one).
|
|
127
127
|
|
|
128
|
-
Remote subscriptions auto-refresh on `up
|
|
128
|
+
Remote subscriptions auto-refresh on `core up` / `core restart` once older than
|
|
129
129
|
`--interval` hours (default 12; `0` disables).
|
|
130
130
|
|
|
131
131
|
## Running & status
|
|
132
132
|
|
|
133
133
|
```bash
|
|
134
|
-
usm clash up # start with the active subscription
|
|
135
|
-
usm clash up work --lan # switch subscription + allow LAN in one go
|
|
136
|
-
usm clash
|
|
137
|
-
usm clash down
|
|
134
|
+
usm clash core up # start with the active subscription
|
|
135
|
+
usm clash core up work --lan # switch subscription + allow LAN in one go
|
|
136
|
+
usm clash # status dashboard (the default action)
|
|
137
|
+
usm clash core down
|
|
138
138
|
```
|
|
139
139
|
|
|
140
|
-
`
|
|
141
|
-
|
|
140
|
+
`usm clash` with no arguments (the default) prints the status dashboard — the
|
|
141
|
+
running state, mihomo version, current subscription and node, mode, the
|
|
142
|
+
TUN / LAN / system-proxy toggles, the local dashboard URL, and live traffic:
|
|
142
143
|
|
|
143
144
|
```
|
|
144
145
|
status ● running (pid 12345)
|
|
146
|
+
mihomo v1.19.27
|
|
145
147
|
subscription work
|
|
146
148
|
node HK-01 (PROXY)
|
|
147
149
|
mode rule
|
|
148
|
-
|
|
149
|
-
|
|
150
|
+
proxy port 127.0.0.1:7890
|
|
151
|
+
system proxy on
|
|
150
152
|
tun off
|
|
151
153
|
allow-lan on
|
|
152
|
-
system-proxy off
|
|
153
154
|
autostart off
|
|
154
155
|
uptime 3m12s
|
|
155
|
-
|
|
156
|
+
dashboard http://127.0.0.1:9090/ui/#/setup?...
|
|
157
|
+
traffic ↓ 1.2GiB ↑ 88.4MiB · 7 conns
|
|
156
158
|
```
|
|
157
159
|
|
|
158
160
|
Your apps connect to the **mixed port** (`127.0.0.1:7890` by default), which
|
|
159
161
|
speaks **HTTP and SOCKS5 on the same port**. Pick a different port at start
|
|
160
|
-
with `usm clash up -p 7891`.
|
|
162
|
+
with `usm clash core up -p 7891`.
|
|
161
163
|
|
|
162
164
|
## Switching the node, mode, latency tests
|
|
163
165
|
|
|
@@ -227,7 +229,7 @@ source ~/.cache/usm/clash/proxy.env # http_proxy/https_proxy/all_proxy
|
|
|
227
229
|
|
|
228
230
|
```bash
|
|
229
231
|
usm clash logs -n 100 # tail the log file
|
|
230
|
-
usm clash logs -f # stream live logs via the API (
|
|
232
|
+
usm clash logs -f # stream live logs via the API (-w also works)
|
|
231
233
|
usm clash conns # active connections (host, chain, rule, up/down)
|
|
232
234
|
usm clash conns -w # watch them live (full-screen; Ctrl-C to stop)
|
|
233
235
|
usm clash conns --close # drop all connections
|
|
@@ -240,6 +242,12 @@ hosted site. The first `dash` (or `setup`) downloads the dashboard (~1 MB) into
|
|
|
240
242
|
`~/.cache/usm/clash/ui`; `dash` then opens the URL (with host/port/secret
|
|
241
243
|
pre-filled) in your browser, or just prints it with `--no-open`.
|
|
242
244
|
|
|
245
|
+
!!! note "First `dash` restarts the core"
|
|
246
|
+
mihomo only mounts the `external-ui` server at startup, so if the core was
|
|
247
|
+
already running before the dashboard was installed, `dash` restarts it once
|
|
248
|
+
to start serving `/ui/`. After that the dashboard stays available (it's
|
|
249
|
+
served by the core itself), and `usm clash` (status) shows its URL.
|
|
250
|
+
|
|
243
251
|
## State & files
|
|
244
252
|
|
|
245
253
|
Everything lives under `~/.cache/usm/clash/`:
|
|
@@ -196,8 +196,8 @@
|
|
|
196
196
|
"requests>=2.32.4",
|
|
197
197
|
"rich>=13.0"
|
|
198
198
|
],
|
|
199
|
-
"version": "1.0.
|
|
200
|
-
"hash": "sha256:
|
|
199
|
+
"version": "1.0.16",
|
|
200
|
+
"hash": "sha256:ab98519d239c1610f8542617066b5fafdd35d76b59f107cfff9f7bf6c60e162a"
|
|
201
201
|
}
|
|
202
202
|
}
|
|
203
203
|
}
|
|
@@ -13,9 +13,9 @@ Quick start
|
|
|
13
13
|
usm clash # status dashboard
|
|
14
14
|
usm clash node # pick a node (interactive)
|
|
15
15
|
usm clash sub use # switch subscription (interactive)
|
|
16
|
-
usm clash node -l # list groups + nodes
|
|
17
16
|
usm clash mode global # rule | global | direct
|
|
18
17
|
usm clash off # clear system proxy
|
|
18
|
+
usm clash core down # stop the core
|
|
19
19
|
|
|
20
20
|
Most settings (mode, lan, tun, the active subscription) can be changed while
|
|
21
21
|
the core is running — the change is hot-applied immediately and remembered for
|
|
@@ -711,6 +711,36 @@ class ClashAPI:
|
|
|
711
711
|
except requests.RequestException:
|
|
712
712
|
return False
|
|
713
713
|
|
|
714
|
+
def ui_ok(self) -> bool:
|
|
715
|
+
"""True if the core is currently serving the web dashboard at /ui/."""
|
|
716
|
+
try:
|
|
717
|
+
r = requests.get(self.base + "/ui/", headers=self.headers, timeout=3)
|
|
718
|
+
return r.status_code == 200
|
|
719
|
+
except requests.RequestException:
|
|
720
|
+
return False
|
|
721
|
+
|
|
722
|
+
def version(self) -> Optional[str]:
|
|
723
|
+
"""Running mihomo version (e.g. ``v1.19.27``), or None."""
|
|
724
|
+
try:
|
|
725
|
+
r = requests.get(self.base + "/version", headers=self.headers, timeout=2)
|
|
726
|
+
if r.status_code == 200:
|
|
727
|
+
return r.json().get("version")
|
|
728
|
+
except (requests.RequestException, ValueError):
|
|
729
|
+
pass
|
|
730
|
+
return None
|
|
731
|
+
|
|
732
|
+
def ui_url(self) -> str:
|
|
733
|
+
"""Pre-filled metacubexd setup URL served by the core."""
|
|
734
|
+
host, _, port = self.base[len("http://") :].partition(":")
|
|
735
|
+
q = urllib.parse.urlencode(
|
|
736
|
+
{
|
|
737
|
+
"hostname": host,
|
|
738
|
+
"port": port,
|
|
739
|
+
"secret": self.headers.get("Authorization", "")[len("Bearer ") :],
|
|
740
|
+
}
|
|
741
|
+
)
|
|
742
|
+
return f"{self.base}/ui/#/setup?{q}"
|
|
743
|
+
|
|
714
744
|
def wait_ready(self, timeout: float = READY_TIMEOUT) -> bool:
|
|
715
745
|
deadline = time.time() + timeout
|
|
716
746
|
while time.time() < deadline:
|
|
@@ -1137,6 +1167,8 @@ class StatusReport:
|
|
|
1137
1167
|
traffic: Optional[dict] = None
|
|
1138
1168
|
node: Optional[str] = None
|
|
1139
1169
|
group: Optional[str] = None
|
|
1170
|
+
dashboard: Optional[str] = None
|
|
1171
|
+
version: Optional[str] = None
|
|
1140
1172
|
|
|
1141
1173
|
|
|
1142
1174
|
class ClashManager:
|
|
@@ -1249,7 +1281,8 @@ class ClashManager:
|
|
|
1249
1281
|
pid = self.running_pid()
|
|
1250
1282
|
running = pid is not None
|
|
1251
1283
|
traffic = None
|
|
1252
|
-
node = group = None
|
|
1284
|
+
node = group = dashboard = None
|
|
1285
|
+
version = f"v{MIHOMO_VERSION}"
|
|
1253
1286
|
if running:
|
|
1254
1287
|
api = self.api()
|
|
1255
1288
|
try:
|
|
@@ -1258,6 +1291,9 @@ class ClashManager:
|
|
|
1258
1291
|
g = _primary_selector(proxies, self.state.mode)
|
|
1259
1292
|
if g:
|
|
1260
1293
|
node, group = proxies[g].get("now"), g
|
|
1294
|
+
version = api.version() or version
|
|
1295
|
+
if WebUI.installed() and api.ui_ok():
|
|
1296
|
+
dashboard = api.ui_url()
|
|
1261
1297
|
except click.ClickException:
|
|
1262
1298
|
pass
|
|
1263
1299
|
return StatusReport(
|
|
@@ -1268,6 +1304,8 @@ class ClashManager:
|
|
|
1268
1304
|
traffic=traffic,
|
|
1269
1305
|
node=node,
|
|
1270
1306
|
group=group,
|
|
1307
|
+
dashboard=dashboard,
|
|
1308
|
+
version=version,
|
|
1271
1309
|
)
|
|
1272
1310
|
|
|
1273
1311
|
# -- settings (each persists + hot-applies if running) --
|
|
@@ -1366,7 +1404,7 @@ class ClashManager:
|
|
|
1366
1404
|
|
|
1367
1405
|
# Logical grouping for the help / overview (keeps a 20-command CLI readable).
|
|
1368
1406
|
COMMAND_SECTIONS: list[tuple[str, tuple[str, ...]]] = [
|
|
1369
|
-
("Run", ("on", "off", "
|
|
1407
|
+
("Run", ("on", "off", "core")),
|
|
1370
1408
|
("Subscriptions", ("sub",)),
|
|
1371
1409
|
("Proxy", ("node", "mode", "test")),
|
|
1372
1410
|
("Network", ("tun", "lan")),
|
|
@@ -1418,6 +1456,8 @@ def _render_status(rep: StatusReport) -> None:
|
|
|
1418
1456
|
table.add_column(overflow="fold")
|
|
1419
1457
|
dot = "[green]● running[/green]" if rep.running else "[dim]○ stopped[/dim]"
|
|
1420
1458
|
table.add_row("status", dot + (f" [dim](pid {rep.pid})[/dim]" if rep.pid else ""))
|
|
1459
|
+
if rep.version:
|
|
1460
|
+
table.add_row("mihomo", rep.version)
|
|
1421
1461
|
table.add_row("subscription", s.active or "[dim]none[/dim]")
|
|
1422
1462
|
if rep.node:
|
|
1423
1463
|
suffix = f" [dim]({rep.group})[/dim]" if rep.group else ""
|
|
@@ -1432,6 +1472,8 @@ def _render_status(rep: StatusReport) -> None:
|
|
|
1432
1472
|
)
|
|
1433
1473
|
if rep.running and s.started_at and not rep.enabled:
|
|
1434
1474
|
table.add_row("uptime", fmt_uptime(time.time() - s.started_at))
|
|
1475
|
+
if rep.dashboard:
|
|
1476
|
+
table.add_row("dashboard", rep.dashboard)
|
|
1435
1477
|
if rep.traffic is not None:
|
|
1436
1478
|
t = rep.traffic
|
|
1437
1479
|
table.add_row(
|
|
@@ -1758,7 +1800,12 @@ def cmd_sub_use(target):
|
|
|
1758
1800
|
# ---- lifecycle ----
|
|
1759
1801
|
|
|
1760
1802
|
|
|
1761
|
-
@cli.
|
|
1803
|
+
@cli.group("core", short_help="Start / stop / restart the mihomo core.")
|
|
1804
|
+
def core() -> None:
|
|
1805
|
+
pass
|
|
1806
|
+
|
|
1807
|
+
|
|
1808
|
+
@core.command("up", short_help="Start the core (or apply settings if already running).")
|
|
1762
1809
|
@click.argument("name", required=False)
|
|
1763
1810
|
@click.option("--tun/--no-tun", default=None, help="Enable/disable TUN.")
|
|
1764
1811
|
@click.option("--lan/--no-lan", default=None, help="Allow LAN connections.")
|
|
@@ -1827,14 +1874,14 @@ def cmd_up(name, tun, lan, system_proxy, port):
|
|
|
1827
1874
|
console.print(f" [dim]{note}[/dim]")
|
|
1828
1875
|
|
|
1829
1876
|
|
|
1830
|
-
@
|
|
1877
|
+
@core.command("down", short_help="Stop the core.")
|
|
1831
1878
|
def cmd_down():
|
|
1832
1879
|
mgr = ClashManager()
|
|
1833
1880
|
was = mgr.down()
|
|
1834
1881
|
console.print(f"[green]✓[/green] {'stopped' if was else 'already stopped'}.")
|
|
1835
1882
|
|
|
1836
1883
|
|
|
1837
|
-
@
|
|
1884
|
+
@core.command("restart", short_help="Restart the core.")
|
|
1838
1885
|
def cmd_restart():
|
|
1839
1886
|
mgr = ClashManager()
|
|
1840
1887
|
mgr.restart()
|
|
@@ -1844,11 +1891,6 @@ def cmd_restart():
|
|
|
1844
1891
|
mgr._reapply_system_proxy()
|
|
1845
1892
|
|
|
1846
1893
|
|
|
1847
|
-
@cli.command("status", short_help="Show what's running.")
|
|
1848
|
-
def cmd_status():
|
|
1849
|
-
_render_status(ClashManager().status())
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
1894
|
# ---- runtime control ----
|
|
1853
1895
|
|
|
1854
1896
|
|
|
@@ -2091,8 +2133,16 @@ def cmd_lan(action):
|
|
|
2091
2133
|
# ---- observability ----
|
|
2092
2134
|
|
|
2093
2135
|
|
|
2094
|
-
@cli.command("logs", short_help="Show recent logs, or stream live with -f.")
|
|
2095
|
-
@click.option(
|
|
2136
|
+
@cli.command("logs", short_help="Show recent logs, or stream live with -f/-w.")
|
|
2137
|
+
@click.option(
|
|
2138
|
+
"-f",
|
|
2139
|
+
"--follow",
|
|
2140
|
+
"-w",
|
|
2141
|
+
"--watch",
|
|
2142
|
+
"follow",
|
|
2143
|
+
is_flag=True,
|
|
2144
|
+
help="Stream live logs via the API.",
|
|
2145
|
+
)
|
|
2096
2146
|
@click.option("-n", "--lines", type=int, default=50, show_default=True)
|
|
2097
2147
|
@click.option(
|
|
2098
2148
|
"--level",
|
|
@@ -2183,19 +2233,21 @@ def cmd_conns(watch, close):
|
|
|
2183
2233
|
)
|
|
2184
2234
|
def cmd_dash(no_open):
|
|
2185
2235
|
mgr = ClashManager()
|
|
2186
|
-
mgr.require_running()
|
|
2187
|
-
newly = not WebUI.installed()
|
|
2236
|
+
api = mgr.require_running()
|
|
2188
2237
|
WebUI.ensure()
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2238
|
+
# mihomo only mounts external-ui at startup, so a hot reload won't expose
|
|
2239
|
+
# /ui/. If it isn't being served yet, restart the core (the regenerated
|
|
2240
|
+
# config now includes external-ui because the UI is installed).
|
|
2241
|
+
if not api.ui_ok():
|
|
2242
|
+
with _status("enabling dashboard (restarting core) …"):
|
|
2243
|
+
mgr.restart()
|
|
2244
|
+
api = mgr.api()
|
|
2245
|
+
api.wait_ready()
|
|
2246
|
+
if not api.ui_ok():
|
|
2247
|
+
raise click.ClickException(
|
|
2248
|
+
"the core is running but isn't serving /ui/. Check 'usm clash logs'."
|
|
2249
|
+
)
|
|
2250
|
+
url = api.ui_url()
|
|
2199
2251
|
console.print(f"[green]✓[/green] dashboard: [bold]{url}[/bold]")
|
|
2200
2252
|
if not no_open:
|
|
2201
2253
|
import webbrowser
|
|
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
|
|
|
18
18
|
commit_id: str | None
|
|
19
19
|
__commit_id__: str | None
|
|
20
20
|
|
|
21
|
-
__version__ = version = '0.8.
|
|
22
|
-
__version_tuple__ = version_tuple = (0, 8,
|
|
21
|
+
__version__ = version = '0.8.4'
|
|
22
|
+
__version_tuple__ = version_tuple = (0, 8, 4)
|
|
23
23
|
|
|
24
24
|
__commit_id__ = commit_id = None
|
|
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
|
|
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
|
|
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
|
|
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
|