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

View File

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

View File

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

View File

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