Update Mihomo documentation and proxy handling for improved error debugging

- Enhanced `GATEWAY_RUN.md` with detailed debugging steps for handling **400** errors in Mihomo routes, clarifying the configuration requirements and common pitfalls.
- Updated comments in `internal/proxy/mihomo.go` to reflect changes in error handling and proxy behavior, linking to the new debugging section in the documentation.
- Modified the Svelte component logic to ensure proper filtering of selectable groups, improving the user interface for managing Mihomo proxies.
This commit is contained in:
Denozordec
2026-03-31 01:21:15 +07:00
parent 0aa440477e
commit b1839c5ebe
3 changed files with 30 additions and 6 deletions
@@ -202,8 +202,12 @@
void loadProxies();
});
function isSelectableGroup(t?: string) {
return t === 'Selector' || t === 'URLTest';
/** Группы, у которых есть `all` + `now` и PUT /proxies/{name} переключает узел (как в Clash/Mihomo). */
function isSelectableGroup(p: MihomoProxyEntry) {
const t = (p.type ?? '').toLowerCase();
if (t === 'selector' || t === 'urltest' || t === 'fallback') return true;
if (t === 'loadbalance' && Array.isArray(p.all) && p.all.length > 0) return true;
return false;
}
function lastDelay(p: MihomoProxyEntry): number | null {
@@ -386,7 +390,7 @@
{#snippet children()}
{#if proxiesData?.proxies}
<div class="flex flex-col gap-8">
{#each Object.entries(proxiesData.proxies).filter(([_, v]) => isSelectableGroup(v.type)) as [gName, group] (gName)}
{#each Object.entries(proxiesData.proxies).filter(([_, v]) => isSelectableGroup(v)) as [gName, group] (gName)}
<div class="space-y-3">
<div class="flex flex-wrap items-center justify-between gap-2">
<div>