mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-22 20:32:15 +08:00
Add `mips` to the TUN stack switch so the stack shipped in mihomo v1.19.31 is selectable from the GUI. Older cores reject the value, which the changelog entry discloses.
44 lines
1.2 KiB
TypeScript
44 lines
1.2 KiB
TypeScript
import { Button, ButtonGroup } from '@mui/material'
|
|
|
|
interface Props {
|
|
value?: string
|
|
onChange?: (value: string) => void
|
|
}
|
|
|
|
export const StackModeSwitch = (props: Props) => {
|
|
const { value, onChange } = props
|
|
|
|
return (
|
|
<ButtonGroup size="small" sx={{ my: '4px' }}>
|
|
<Button
|
|
variant={value?.toLowerCase() === 'system' ? 'contained' : 'outlined'}
|
|
onClick={() => onChange?.('system')}
|
|
sx={{ textTransform: 'capitalize' }}
|
|
>
|
|
System
|
|
</Button>
|
|
<Button
|
|
variant={value?.toLowerCase() === 'gvisor' ? 'contained' : 'outlined'}
|
|
onClick={() => onChange?.('gvisor')}
|
|
sx={{ textTransform: 'capitalize' }}
|
|
>
|
|
gVisor
|
|
</Button>
|
|
<Button
|
|
variant={value?.toLowerCase() === 'mixed' ? 'contained' : 'outlined'}
|
|
onClick={() => onChange?.('mixed')}
|
|
sx={{ textTransform: 'capitalize' }}
|
|
>
|
|
Mixed
|
|
</Button>
|
|
<Button
|
|
variant={value?.toLowerCase() === 'mips' ? 'contained' : 'outlined'}
|
|
onClick={() => onChange?.('mips')}
|
|
sx={{ textTransform: 'capitalize' }}
|
|
>
|
|
Mips
|
|
</Button>
|
|
</ButtonGroup>
|
|
)
|
|
}
|