Skip to content
This repository has been archived by the owner on Feb 5, 2025. It is now read-only.

Commit

Permalink
support unfixed urlTest proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
pompurin404 committed Sep 25, 2024
1 parent 66a270d commit 0b561a3
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 16 deletions.
10 changes: 5 additions & 5 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
### Breaking Changes

- 此版本将Sub-Store后端默认监听端口修改为38324,如果此前使用了内置Sub-Store的订阅链接,请修改端口或重新导入

### Bug Fixes

- 修复便携版无法自动更新的问题
- 修复GIF图标缓存后无法播放的问题
- 修复Linux重启应用进入沙盒环境的问题
- 修复已关闭连接信息过时的问题
- 修复win7开机启动开关无法打开的问题
- 修复url-test代理组节点无法取消固定的问题
45 changes: 34 additions & 11 deletions src/renderer/src/components/proxies/proxy-item.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { Button, Card, CardBody } from '@nextui-org/react'
import { mihomoGroupDelay } from '@renderer/utils/ipc'
import React, { useMemo, useState } from 'react'
import { FaMapPin } from 'react-icons/fa6'

interface Props {
mutateProxies: () => void
Expand All @@ -22,7 +24,7 @@ const ProxyItem: React.FC<Props> = (props) => {
}, [proxy])

const [loading, setLoading] = useState(false)

const [unfixing, setUnfixing] = useState(false)
function delayColor(delay: number): 'primary' | 'success' | 'warning' | 'danger' {
if (delay === -1) return 'primary'
if (delay === 0) return 'danger'
Expand Down Expand Up @@ -67,16 +69,37 @@ const ProxyItem: React.FC<Props> = (props) => {
</div>
)}
</div>
<Button
title={proxy.type}
isLoading={loading}
color={delayColor(delay)}
onPress={onDelay}
variant="light"
className="h-full min-w-[50px] p-0 mx-2 text-sm hover:bg-content"
>
{delayText(delay)}
</Button>
<div className="flex justify-end">
{fixed && (
<Button
isIconOnly
title="取消固定"
isLoading={unfixing}
color="danger"
onPress={async () => {
setUnfixing(true)
await mihomoGroupDelay(group.name)
mutateProxies()
setUnfixing(false)
}}
variant="light"
className="h-[20px] p-0 text-sm"
>
<FaMapPin className="text-md le" />
</Button>
)}
<Button
isIconOnly
title={proxy.type}
isLoading={loading}
color={delayColor(delay)}
onPress={onDelay}
variant="light"
className="h-full p-0 text-sm"
>
{delayText(delay)}
</Button>
</div>
</div>
</CardBody>
</Card>
Expand Down

0 comments on commit 0b561a3

Please sign in to comment.