feat: add PROXIES_PREVIEW_TYPE - off

This commit is contained in:
kunish 2023-09-03 02:41:13 +08:00
parent 071a607124
commit fec64133fa
No known key found for this signature in database
GPG Key ID: 647A12B4F782C430
4 changed files with 8 additions and 2 deletions

View File

@ -5,7 +5,10 @@ import ProxyPreviewBar from './ProxyPreviewBar'
import ProxyPreviewDots from './ProxyPreviewDots'
export default (props: { proxyNameList: string[]; now?: string }) => {
const off = () => proxiesPreviewType() === PROXIES_PREVIEW_TYPE.OFF
const isSmallGroup = createMemo(() => props.proxyNameList.length <= 30)
const isShowBar = createMemo(() => {
const type = proxiesPreviewType()
@ -25,13 +28,13 @@ export default (props: { proxyNameList: string[]; now?: string }) => {
})
return (
<>
<Show when={!off()}>
<Show when={isShowBar()}>
<ProxyPreviewBar proxyNameList={props.proxyNameList} now={props.now} />
</Show>
<Show when={isShowDots()}>
<ProxyPreviewDots proxyNameList={props.proxyNameList} now={props.now} />
</Show>
</>
</Show>
)
}

View File

@ -31,6 +31,7 @@ export enum DELAY {
}
export enum PROXIES_PREVIEW_TYPE {
OFF = 'off',
DOTS = 'dots',
BAR = 'bar',
Auto = 'auto',

View File

@ -37,6 +37,7 @@ export default {
dots: 'Dots',
bar: 'Bar',
auto: 'Auto',
off: 'Off',
proxiesPreviewType: 'Proxies preview type',
urlForDelayTest: 'Url for delay test',
autoCloseConns: 'Automatically close all connections',

View File

@ -37,6 +37,7 @@ export default {
dots: '点阵',
bar: '条形',
auto: '自适应',
off: '关闭',
proxiesPreviewType: '节点组预览样式',
urlForDelayTest: '测速链接',
autoCloseConns: '切换代理时自动断开全部连接',