diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2ad2e24..36e1846 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -86,7 +86,8 @@ jobs: with: name: ${{ matrix.os }}-${{ matrix.arch }} path: | - dist/mihomo-party-* + dist/mihomo-party* + !dist/mihomo-party*blockmap latest.yml changelog.md diff --git a/src/main/config/controledMihomo.ts b/src/main/config/controledMihomo.ts index b58af84..a73cddf 100644 --- a/src/main/config/controledMihomo.ts +++ b/src/main/config/controledMihomo.ts @@ -37,14 +37,15 @@ export async function patchControledMihomoConfig(patch: Partial): controledMihomoConfig.sniffer = defaultControledMihomoConfig.sniffer } } - if (patch.hosts) { - controledMihomoConfig.hosts = patch.hosts - } if (patch.dns?.['nameserver-policy']) { controledMihomoConfig.dns = controledMihomoConfig.dns || {} controledMihomoConfig.dns['nameserver-policy'] = patch.dns['nameserver-policy'] } controledMihomoConfig = deepMerge(controledMihomoConfig, patch) + if (patch.hosts && patch.dns?.['use-hosts']) { + delete controledMihomoConfig.hosts + controledMihomoConfig.hosts = patch.hosts + } if (!useNameserverPolicy) { delete controledMihomoConfig?.dns?.['nameserver-policy'] } diff --git a/src/renderer/src/components/connections/connection-item.tsx b/src/renderer/src/components/connections/connection-item.tsx index 7e40faf..53cd919 100644 --- a/src/renderer/src/components/connections/connection-item.tsx +++ b/src/renderer/src/components/connections/connection-item.tsx @@ -44,7 +44,9 @@ const ConnectionItem: React.FC = (props) => { {info.metadata.type}({info.metadata.network.toUpperCase()})
- {info.metadata.process || info.metadata.sourceIP} + {(!info.metadata.process || info.metadata.process === 'mihomo' || !info.metadata.sourceIP) + ? 'mihomo-core' + : info.metadata.process || info.metadata.sourceIP} {' -> '} {info.metadata.host || info.metadata.sniffHost || diff --git a/src/renderer/src/pages/dns.tsx b/src/renderer/src/pages/dns.tsx index ed1529b..7ad9f52 100644 --- a/src/renderer/src/pages/dns.tsx +++ b/src/renderer/src/pages/dns.tsx @@ -140,9 +140,9 @@ const DNS: React.FC = () => { className="app-nodrag" color="primary" onPress={() => { - const hostsObject = Object.fromEntries( - values.hosts.map(({ domain, value }) => [domain, value]) - ) + const hostsObject = values.useHosts + ? Object.fromEntries(values.hosts.map(({ domain, value }) => [domain, value])) + : undefined const dnsConfig = { ipv6: values.ipv6, 'fake-ip-range': values.fakeIPRange,