mirror of
https://github.com/MetaCubeX/metacubexd.git
synced 2024-11-23 21:35:36 +08:00
feat: config for icon height and margin-right (#1041)
This commit is contained in:
parent
01228f9981
commit
bf26a539bc
@ -6,12 +6,16 @@ import { useI18n } from '~/i18n'
|
|||||||
import {
|
import {
|
||||||
autoCloseConns,
|
autoCloseConns,
|
||||||
hideUnAvailableProxies,
|
hideUnAvailableProxies,
|
||||||
|
iconHeight,
|
||||||
|
iconMarginRight,
|
||||||
latencyTestTimeoutDuration,
|
latencyTestTimeoutDuration,
|
||||||
proxiesOrderingType,
|
proxiesOrderingType,
|
||||||
proxiesPreviewType,
|
proxiesPreviewType,
|
||||||
renderProxiesInTwoColumns,
|
renderProxiesInTwoColumns,
|
||||||
setAutoCloseConns,
|
setAutoCloseConns,
|
||||||
setHideUnAvailableProxies,
|
setHideUnAvailableProxies,
|
||||||
|
setIconHeight,
|
||||||
|
setIconMarginRight,
|
||||||
setLatencyTestTimeoutDuration,
|
setLatencyTestTimeoutDuration,
|
||||||
setProxiesOrderingType,
|
setProxiesOrderingType,
|
||||||
setProxiesPreviewType,
|
setProxiesPreviewType,
|
||||||
@ -143,6 +147,26 @@ export const ProxiesSettingsModal: Component<{
|
|||||||
</For>
|
</For>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<ConfigTitle withDivider>{t('iconHeight')}</ConfigTitle>
|
||||||
|
|
||||||
|
<input
|
||||||
|
type="number"
|
||||||
|
class="input input-bordered w-full"
|
||||||
|
value={iconHeight()}
|
||||||
|
onChange={(e) => setIconHeight(Number(e.target.value))}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<ConfigTitle withDivider>{t('iconMarginRight')}</ConfigTitle>
|
||||||
|
|
||||||
|
<input
|
||||||
|
type="number"
|
||||||
|
class="input input-bordered w-full"
|
||||||
|
value={iconMarginRight()}
|
||||||
|
onChange={(e) => setIconMarginRight(Number(e.target.value))}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Modal>
|
</Modal>
|
||||||
)
|
)
|
||||||
|
@ -113,4 +113,6 @@ export default {
|
|||||||
zh: 'Chinese',
|
zh: 'Chinese',
|
||||||
port: '{{ name }} Port',
|
port: '{{ name }} Port',
|
||||||
quickFilter: 'Quick Filter',
|
quickFilter: 'Quick Filter',
|
||||||
|
iconHeight: 'Icon Height',
|
||||||
|
iconMarginRight: 'Icon Margin Right',
|
||||||
}
|
}
|
||||||
|
@ -115,4 +115,6 @@ export default {
|
|||||||
zh: '中文',
|
zh: '中文',
|
||||||
port: '{{ name }} 端口',
|
port: '{{ name }} 端口',
|
||||||
quickFilter: '快速过滤',
|
quickFilter: '快速过滤',
|
||||||
|
iconHeight: '图标高度',
|
||||||
|
iconMarginRight: '图标右边距',
|
||||||
} satisfies Dict
|
} satisfies Dict
|
||||||
|
@ -23,6 +23,8 @@ import {
|
|||||||
endpoint,
|
endpoint,
|
||||||
formatTimeFromNow,
|
formatTimeFromNow,
|
||||||
hideUnAvailableProxies,
|
hideUnAvailableProxies,
|
||||||
|
iconHeight,
|
||||||
|
iconMarginRight,
|
||||||
proxiesOrderingType,
|
proxiesOrderingType,
|
||||||
renderProxiesInTwoColumns,
|
renderProxiesInTwoColumns,
|
||||||
useConnections,
|
useConnections,
|
||||||
@ -191,7 +193,13 @@ export default () => {
|
|||||||
<div class="flex items-center justify-between pr-8">
|
<div class="flex items-center justify-between pr-8">
|
||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
<Show when={proxyGroup.icon}>
|
<Show when={proxyGroup.icon}>
|
||||||
<img src={proxyGroup.icon} class="h-8" />
|
<img
|
||||||
|
src={proxyGroup.icon}
|
||||||
|
style={{
|
||||||
|
height: `${iconHeight()}px`,
|
||||||
|
'margin-right': `${iconMarginRight()}px`,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
</Show>
|
</Show>
|
||||||
<span>{proxyGroup.name}</span>
|
<span>{proxyGroup.name}</span>
|
||||||
<div class="badge badge-sm ml-2">
|
<div class="badge badge-sm ml-2">
|
||||||
|
@ -148,3 +148,13 @@ export const isLatencyTestByHttps = () =>
|
|||||||
|
|
||||||
export const latencyQualityMap = () =>
|
export const latencyQualityMap = () =>
|
||||||
isLatencyTestByHttps() ? LATENCY_QUALITY_MAP_HTTPS : LATENCY_QUALITY_MAP_HTTP
|
isLatencyTestByHttps() ? LATENCY_QUALITY_MAP_HTTPS : LATENCY_QUALITY_MAP_HTTP
|
||||||
|
|
||||||
|
export const [iconHeight, setIconHeight] = makePersisted(createSignal(24), {
|
||||||
|
name: 'iconHeight',
|
||||||
|
storage: localStorage,
|
||||||
|
})
|
||||||
|
|
||||||
|
export const [iconMarginRight, setIconMarginRight] = makePersisted(
|
||||||
|
createSignal(8),
|
||||||
|
{ name: 'iconMarginRight', storage: localStorage },
|
||||||
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user