mirror of
https://github.com/pompurin404/mihomo-party.git
synced 2024-11-16 03:32:17 +08:00
fix setPriority
This commit is contained in:
parent
2faa1659dc
commit
13f8705dc6
|
@ -9,8 +9,7 @@
|
||||||
|
|
||||||
- 内置 Sub-Store 不使用缓存
|
- 内置 Sub-Store 不使用缓存
|
||||||
- 允许控制是否为 Sub-Store 使用代理
|
- 允许控制是否为 Sub-Store 使用代理
|
||||||
- 允许设置内核进程优先级
|
- Windows 允许设置内核进程优先级
|
||||||
- 提高进程优先级
|
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
|
|
|
@ -100,7 +100,7 @@ export async function startCore(detached = false): Promise<Promise<void>[]> {
|
||||||
stdio: detached ? 'ignore' : undefined
|
stdio: detached ? 'ignore' : undefined
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
if (child.pid) {
|
if (process.platform === 'win32' && child.pid) {
|
||||||
os.setPriority(child.pid, os.constants.priority[mihomoCpuPriority])
|
os.setPriority(child.pid, os.constants.priority[mihomoCpuPriority])
|
||||||
}
|
}
|
||||||
if (detached) {
|
if (detached) {
|
||||||
|
|
|
@ -8,6 +8,7 @@ import { getGistUrl, patchControledMihomoConfig, restartCore } from '@renderer/u
|
||||||
import { MdDeleteForever } from 'react-icons/md'
|
import { MdDeleteForever } from 'react-icons/md'
|
||||||
import { BiCopy } from 'react-icons/bi'
|
import { BiCopy } from 'react-icons/bi'
|
||||||
import { IoIosHelpCircle } from 'react-icons/io'
|
import { IoIosHelpCircle } from 'react-icons/io'
|
||||||
|
import { platform } from '@renderer/utils/init'
|
||||||
|
|
||||||
const MihomoConfig: React.FC = () => {
|
const MihomoConfig: React.FC = () => {
|
||||||
const { appConfig, patchAppConfig } = useAppConfig()
|
const { appConfig, patchAppConfig } = useAppConfig()
|
||||||
|
@ -136,26 +137,28 @@ const MihomoConfig: React.FC = () => {
|
||||||
<SelectItem key="4">四列</SelectItem>
|
<SelectItem key="4">四列</SelectItem>
|
||||||
</Select>
|
</Select>
|
||||||
</SettingItem>
|
</SettingItem>
|
||||||
<SettingItem title="内核进程优先级" divider>
|
{platform === 'win32' && (
|
||||||
<Select
|
<SettingItem title="内核进程优先级" divider>
|
||||||
classNames={{ trigger: 'data-[hover=true]:bg-default-200' }}
|
<Select
|
||||||
className="w-[150px]"
|
classNames={{ trigger: 'data-[hover=true]:bg-default-200' }}
|
||||||
size="sm"
|
className="w-[150px]"
|
||||||
selectedKeys={new Set([mihomoCpuPriority])}
|
size="sm"
|
||||||
onSelectionChange={async (v) => {
|
selectedKeys={new Set([mihomoCpuPriority])}
|
||||||
await patchAppConfig({
|
onSelectionChange={async (v) => {
|
||||||
mihomoCpuPriority: v.currentKey as Priority
|
await patchAppConfig({
|
||||||
})
|
mihomoCpuPriority: v.currentKey as Priority
|
||||||
}}
|
})
|
||||||
>
|
}}
|
||||||
<SelectItem key="PRIORITY_HIGHEST">实时</SelectItem>
|
>
|
||||||
<SelectItem key="PRIORITY_HIGH">高</SelectItem>
|
<SelectItem key="PRIORITY_HIGHEST">实时</SelectItem>
|
||||||
<SelectItem key="PRIORITY_ABOVE_NORMAL">高于正常</SelectItem>
|
<SelectItem key="PRIORITY_HIGH">高</SelectItem>
|
||||||
<SelectItem key="PRIORITY_NORMAL">正常</SelectItem>
|
<SelectItem key="PRIORITY_ABOVE_NORMAL">高于正常</SelectItem>
|
||||||
<SelectItem key="PRIORITY_BELOW_NORMAL">低于正常</SelectItem>
|
<SelectItem key="PRIORITY_NORMAL">正常</SelectItem>
|
||||||
<SelectItem key="PRIORITY_LOW">低</SelectItem>
|
<SelectItem key="PRIORITY_BELOW_NORMAL">低于正常</SelectItem>
|
||||||
</Select>
|
<SelectItem key="PRIORITY_LOW">低</SelectItem>
|
||||||
</SettingItem>
|
</Select>
|
||||||
|
</SettingItem>
|
||||||
|
)}
|
||||||
<SettingItem
|
<SettingItem
|
||||||
title="为不同订阅分别指定工作目录"
|
title="为不同订阅分别指定工作目录"
|
||||||
actions={
|
actions={
|
||||||
|
|
Loading…
Reference in New Issue
Block a user