diff --git a/changelog.md b/changelog.md index 691e4dd2..837480b2 100644 --- a/changelog.md +++ b/changelog.md @@ -1,13 +1,3 @@ ### New Features -- 设置悬浮窗标题为 `Mihomo Party Floating`,以区分主窗口,Wayland 用户可以单独为其设置窗口规则以解决置顶失效的问题 -- 提高悬浮窗置顶等级,避免被其他窗口遮挡 -- 悬浮窗增加边框阴影效果,避免与背景色相近时无法分辨 -- 优化订阅卡片信息显示布局 -- 允许在开启悬浮窗的情况下禁用托盘图标 -- 再次点击悬浮窗按钮关闭窗口 - -### Bug Fixes - -- 修复开启轻量模式后 TrafficMonitor 重复启动的问题 -- 修复 悬浮窗置顶失效的问题 +- 支持通过代理拉取内置 SubStore 订阅(仅对通过订阅页面Sub-Store图标新导入的订阅有效) diff --git a/src/main/config/profile.ts b/src/main/config/profile.ts index f976370b..7e90c830 100644 --- a/src/main/config/profile.ts +++ b/src/main/config/profile.ts @@ -5,9 +5,10 @@ import { readFile, rm, writeFile } from 'fs/promises' import { restartCore } from '../core/manager' import { getAppConfig } from './app' import { existsSync } from 'fs' -import axios from 'axios' +import axios, { AxiosResponse } from 'axios' import yaml from 'yaml' import { defaultProfile } from '../utils/template' +import { subStorePort } from '../resolve/server' let profileConfig: IProfileConfig // profile.yaml @@ -105,6 +106,7 @@ export async function createProfile(item: Partial): Promise): Promise { } }, []) return ( -
+
Promise diff --git a/src/renderer/src/pages/profiles.tsx b/src/renderer/src/pages/profiles.tsx index cf9a6728..37afad29 100644 --- a/src/renderer/src/pages/profiles.tsx +++ b/src/renderer/src/pages/profiles.tsx @@ -13,13 +13,7 @@ import BasePage from '@renderer/components/base/base-page' import ProfileItem from '@renderer/components/profiles/profile-item' import { useProfileConfig } from '@renderer/hooks/use-profile-config' import { useAppConfig } from '@renderer/hooks/use-app-config' -import { - getFilePath, - readTextFile, - subStoreCollections, - subStorePort, - subStoreSubs -} from '@renderer/utils/ipc' +import { getFilePath, readTextFile, subStoreCollections, subStoreSubs } from '@renderer/utils/ipc' import { ReactNode, useEffect, useMemo, useRef, useState } from 'react' import { MdContentPaste } from 'react-icons/md' import { @@ -286,16 +280,16 @@ const Profiles: React.FC = () => { } else if (key.toString().startsWith('sub-')) { setSubStoreImporting(true) try { - const port = await subStorePort() const sub = subs.find( (sub) => sub.name === key.toString().replace('sub-', '') ) await addProfileItem({ name: sub?.displayName || sub?.name || '', + substore: !useCustomSubStore, type: 'remote', url: useCustomSubStore ? `${customSubStoreUrl}/download/${key.toString().replace('sub-', '')}?target=ClashMeta` - : `http://127.0.0.1:${port}/download/${key.toString().replace('sub-', '')}?target=ClashMeta`, + : `/download/${key.toString().replace('sub-', '')}`, useProxy }) } catch (e) { @@ -306,7 +300,6 @@ const Profiles: React.FC = () => { } else if (key.toString().startsWith('collection-')) { setSubStoreImporting(true) try { - const port = await subStorePort() const collection = collections.find( (collection) => collection.name === key.toString().replace('collection-', '') @@ -314,9 +307,10 @@ const Profiles: React.FC = () => { await addProfileItem({ name: collection?.displayName || collection?.name || '', type: 'remote', + substore: !useCustomSubStore, url: useCustomSubStore ? `${customSubStoreUrl}/download/collection/${key.toString().replace('collection-', '')}?target=ClashMeta` - : `http://127.0.0.1:${port}/download/collection/${key.toString().replace('collection-', '')}?target=ClashMeta`, + : `/download/collection/${key.toString().replace('collection-', '')}`, useProxy }) } catch (e) { diff --git a/src/shared/types.d.ts b/src/shared/types.d.ts index 91f1f5cc..b5383a31 100644 --- a/src/shared/types.d.ts +++ b/src/shared/types.d.ts @@ -426,6 +426,7 @@ interface IProfileItem { override?: string[] useProxy?: boolean extra?: ISubscriptionUserInfo + substore?: boolean } interface ISubStoreSub {