mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2026-02-11 04:00:32 +08:00
Compare commits
No commits in common. "19ff003352d149ffa0acc7764167d11855fa914d" and "e6548a0bc3ffc1c4e8681587d7a9e01c903f7b2a" have entirely different histories.
19ff003352
...
e6548a0bc3
@ -46,10 +46,10 @@ function getBindingName() {
|
|||||||
function loadBinding() {
|
function loadBinding() {
|
||||||
const bindingName = getBindingName()
|
const bindingName = getBindingName()
|
||||||
|
|
||||||
// 查找项目根目录的 sidecar
|
// 查找项目根目录的 extra/sidecar
|
||||||
let currentDir = __dirname
|
let currentDir = __dirname
|
||||||
while (currentDir !== require('path').dirname(currentDir)) {
|
while (currentDir !== require('path').dirname(currentDir)) {
|
||||||
const sidecarPath = join(currentDir, 'sidecar', bindingName)
|
const sidecarPath = join(currentDir, 'extra', 'sidecar', bindingName)
|
||||||
if (existsSync(sidecarPath)) {
|
if (existsSync(sidecarPath)) {
|
||||||
try {
|
try {
|
||||||
nativeBinding = require(sidecarPath)
|
nativeBinding = require(sidecarPath)
|
||||||
|
|||||||
@ -342,8 +342,6 @@
|
|||||||
"actions.version.title": "App Version",
|
"actions.version.title": "App Version",
|
||||||
"theme.editor.title": "Edit Theme",
|
"theme.editor.title": "Edit Theme",
|
||||||
"proxies.title": "Proxy Groups & Nodes",
|
"proxies.title": "Proxy Groups & Nodes",
|
||||||
"proxies.hideUnavailable.enabled": "Show Unavailable Proxies",
|
|
||||||
"proxies.hideUnavailable.disabled": "Hide Unavailable Proxies",
|
|
||||||
"proxies.card.title": "ProxyGrp",
|
"proxies.card.title": "ProxyGrp",
|
||||||
"proxies.delay.test": "Test",
|
"proxies.delay.test": "Test",
|
||||||
"proxies.delay.timeout": "Timeout",
|
"proxies.delay.timeout": "Timeout",
|
||||||
|
|||||||
@ -318,8 +318,6 @@
|
|||||||
"actions.version.title": "نسخه برنامه",
|
"actions.version.title": "نسخه برنامه",
|
||||||
"theme.editor.title": "ویرایش پوسته",
|
"theme.editor.title": "ویرایش پوسته",
|
||||||
"proxies.title": "گروههای پراکسی و گرهها",
|
"proxies.title": "گروههای پراکسی و گرهها",
|
||||||
"proxies.hideUnavailable.enabled": "نمایش گرههای غیرفعال",
|
|
||||||
"proxies.hideUnavailable.disabled": "پنهان کردن گرههای غیرفعال",
|
|
||||||
"proxies.card.title": "گروهپراکسی",
|
"proxies.card.title": "گروهپراکسی",
|
||||||
"proxies.delay.test": "تست",
|
"proxies.delay.test": "تست",
|
||||||
"proxies.delay.timeout": "وقفه",
|
"proxies.delay.timeout": "وقفه",
|
||||||
|
|||||||
@ -318,8 +318,6 @@
|
|||||||
"actions.version.title": "Версия приложения",
|
"actions.version.title": "Версия приложения",
|
||||||
"theme.editor.title": "Редактор темы",
|
"theme.editor.title": "Редактор темы",
|
||||||
"proxies.title": "Прокси группы и узлы",
|
"proxies.title": "Прокси группы и узлы",
|
||||||
"proxies.hideUnavailable.enabled": "Показать недоступные узлы",
|
|
||||||
"proxies.hideUnavailable.disabled": "Скрыть недоступные узлы",
|
|
||||||
"proxies.card.title": "Прокси группы",
|
"proxies.card.title": "Прокси группы",
|
||||||
"proxies.delay.test": "Тест",
|
"proxies.delay.test": "Тест",
|
||||||
"proxies.delay.timeout": "Таймаут",
|
"proxies.delay.timeout": "Таймаут",
|
||||||
|
|||||||
@ -342,8 +342,6 @@
|
|||||||
"actions.version.title": "应用版本",
|
"actions.version.title": "应用版本",
|
||||||
"theme.editor.title": "编辑主题",
|
"theme.editor.title": "编辑主题",
|
||||||
"proxies.title": "代理组与节点",
|
"proxies.title": "代理组与节点",
|
||||||
"proxies.hideUnavailable.enabled": "显示不可用节点",
|
|
||||||
"proxies.hideUnavailable.disabled": "隐藏不可用节点",
|
|
||||||
"proxies.card.title": "代理组",
|
"proxies.card.title": "代理组",
|
||||||
"proxies.delay.test": "测试",
|
"proxies.delay.test": "测试",
|
||||||
"proxies.delay.timeout": "超时",
|
"proxies.delay.timeout": "超时",
|
||||||
|
|||||||
@ -342,8 +342,6 @@
|
|||||||
"actions.version.title": "應用程式版本",
|
"actions.version.title": "應用程式版本",
|
||||||
"theme.editor.title": "編輯主題",
|
"theme.editor.title": "編輯主題",
|
||||||
"proxies.title": "代理組與節點",
|
"proxies.title": "代理組與節點",
|
||||||
"proxies.hideUnavailable.enabled": "顯示不可用節點",
|
|
||||||
"proxies.hideUnavailable.disabled": "隱藏不可用節點",
|
|
||||||
"proxies.card.title": "代理組",
|
"proxies.card.title": "代理組",
|
||||||
"proxies.delay.test": "測試",
|
"proxies.delay.test": "測試",
|
||||||
"proxies.delay.timeout": "逾時",
|
"proxies.delay.timeout": "逾時",
|
||||||
|
|||||||
@ -11,11 +11,11 @@ import { CgDetailsLess, CgDetailsMore } from 'react-icons/cg'
|
|||||||
import { TbCircleLetterD } from 'react-icons/tb'
|
import { TbCircleLetterD } from 'react-icons/tb'
|
||||||
import { FaLocationCrosshairs } from 'react-icons/fa6'
|
import { FaLocationCrosshairs } from 'react-icons/fa6'
|
||||||
import { RxLetterCaseCapitalize } from 'react-icons/rx'
|
import { RxLetterCaseCapitalize } from 'react-icons/rx'
|
||||||
import { MdVisibilityOff, MdDoubleArrow, MdOutlineSpeed } from 'react-icons/md'
|
|
||||||
import { useEffect, useMemo, useRef, useState, useCallback } from 'react'
|
import { useEffect, useMemo, useRef, useState, useCallback } from 'react'
|
||||||
import { GroupedVirtuoso, GroupedVirtuosoHandle } from 'react-virtuoso'
|
import { GroupedVirtuoso, GroupedVirtuosoHandle } from 'react-virtuoso'
|
||||||
import ProxyItem from '@renderer/components/proxies/proxy-item'
|
import ProxyItem from '@renderer/components/proxies/proxy-item'
|
||||||
import { IoIosArrowBack } from 'react-icons/io'
|
import { IoIosArrowBack } from 'react-icons/io'
|
||||||
|
import { MdDoubleArrow, MdOutlineSpeed } from 'react-icons/md'
|
||||||
import { useGroups } from '@renderer/hooks/use-groups'
|
import { useGroups } from '@renderer/hooks/use-groups'
|
||||||
import CollapseInput from '@renderer/components/base/collapse-input'
|
import CollapseInput from '@renderer/components/base/collapse-input'
|
||||||
import { includesIgnoreCase } from '@renderer/utils/includes'
|
import { includesIgnoreCase } from '@renderer/utils/includes'
|
||||||
@ -160,25 +160,9 @@ const Proxies: React.FC = () => {
|
|||||||
|
|
||||||
groups.forEach((group, index) => {
|
groups.forEach((group, index) => {
|
||||||
if (isOpen[index]) {
|
if (isOpen[index]) {
|
||||||
const filtered = group.all.filter((proxy) => {
|
const filtered = group.all.filter(
|
||||||
if (!includesIgnoreCase(proxy.name, searchValue[index])) {
|
(proxy) => proxy && includesIgnoreCase(proxy.name, searchValue[index])
|
||||||
return false
|
)
|
||||||
}
|
|
||||||
if (appConfig?.hideUnavailableProxies) {
|
|
||||||
const isGroup = 'all' in proxy
|
|
||||||
if (isGroup) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
if (!proxy.history || proxy.history.length === 0) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
const lastDelay = proxy.history[proxy.history.length - 1].delay
|
|
||||||
if (lastDelay === 0) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
})
|
|
||||||
const sorted = sortProxies(filtered, proxyDisplayOrder)
|
const sorted = sortProxies(filtered, proxyDisplayOrder)
|
||||||
const count = Math.ceil(sorted.length / cols)
|
const count = Math.ceil(sorted.length / cols)
|
||||||
groupCounts.push(count)
|
groupCounts.push(count)
|
||||||
@ -189,15 +173,7 @@ const Proxies: React.FC = () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
return { groupCounts, allProxies }
|
return { groupCounts, allProxies }
|
||||||
}, [
|
}, [groups, isOpen, proxyDisplayOrder, cols, searchValue, sortProxies])
|
||||||
groups,
|
|
||||||
isOpen,
|
|
||||||
proxyDisplayOrder,
|
|
||||||
cols,
|
|
||||||
searchValue,
|
|
||||||
sortProxies,
|
|
||||||
appConfig?.hideUnavailableProxies
|
|
||||||
])
|
|
||||||
|
|
||||||
const onChangeProxy = useCallback(
|
const onChangeProxy = useCallback(
|
||||||
async (group: string, proxy: string): Promise<void> => {
|
async (group: string, proxy: string): Promise<void> => {
|
||||||
@ -533,26 +509,6 @@ const Proxies: React.FC = () => {
|
|||||||
title={t('proxies.title')}
|
title={t('proxies.title')}
|
||||||
header={
|
header={
|
||||||
<>
|
<>
|
||||||
<Button
|
|
||||||
size="sm"
|
|
||||||
isIconOnly
|
|
||||||
variant="light"
|
|
||||||
className="app-nodrag"
|
|
||||||
onPress={() => {
|
|
||||||
patchAppConfig({
|
|
||||||
hideUnavailableProxies: !appConfig?.hideUnavailableProxies
|
|
||||||
})
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<MdVisibilityOff
|
|
||||||
className={`text-lg ${appConfig?.hideUnavailableProxies ? 'text-warning' : 'text-foreground-500'}`}
|
|
||||||
title={
|
|
||||||
appConfig?.hideUnavailableProxies
|
|
||||||
? t('proxies.hideUnavailable.enabled')
|
|
||||||
: t('proxies.hideUnavailable.disabled')
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</Button>
|
|
||||||
<Button
|
<Button
|
||||||
size="sm"
|
size="sm"
|
||||||
isIconOnly
|
isIconOnly
|
||||||
|
|||||||
1
src/shared/types.d.ts
vendored
1
src/shared/types.d.ts
vendored
@ -229,7 +229,6 @@ interface IAppConfig {
|
|||||||
profileDisplayDate?: 'expire' | 'update'
|
profileDisplayDate?: 'expire' | 'update'
|
||||||
envType?: ('bash' | 'cmd' | 'powershell')[]
|
envType?: ('bash' | 'cmd' | 'powershell')[]
|
||||||
proxyCols: 'auto' | '1' | '2' | '3' | '4'
|
proxyCols: 'auto' | '1' | '2' | '3' | '4'
|
||||||
hideUnavailableProxies?: boolean
|
|
||||||
connectionDirection: 'asc' | 'desc'
|
connectionDirection: 'asc' | 'desc'
|
||||||
connectionOrderBy: 'time' | 'upload' | 'download' | 'uploadSpeed' | 'downloadSpeed'
|
connectionOrderBy: 'time' | 'upload' | 'download' | 'uploadSpeed' | 'downloadSpeed'
|
||||||
connectionViewMode?: 'list' | 'table'
|
connectionViewMode?: 'list' | 'table'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user