fix: rule size

This commit is contained in:
Zephyruso 2023-09-04 20:00:43 +08:00
parent b5d0ef9f83
commit 2ff31d40b1
2 changed files with 7 additions and 2 deletions

View File

@ -5,6 +5,7 @@ import { ROUTES } from '~/constants'
import {
curTheme,
endpoint,
renderProxiesInSamePage,
selectedEndpoint,
useAutoSwitchTheme,
useProxies,
@ -48,7 +49,9 @@ export const App = () => {
<Show when={selectedEndpoint()}>
<Route path={ROUTES.Overview} component={Overview} />
<Route path={ROUTES.Proxies} component={Proxies} />
<Route path={ROUTES.ProxyProvider} component={ProxyProvider} />
<Show when={!renderProxiesInSamePage()}>
<Route path={ROUTES.ProxyProvider} component={ProxyProvider} />
</Show>
<Route path={ROUTES.Rules} component={Rules} />
<Route path={ROUTES.Conns} component={Connections} />
<Route path={ROUTES.Log} component={Logs} />

View File

@ -48,7 +48,9 @@ export default () => {
<div class="card card-bordered card-compact mb-2 bg-base-200 p-4">
<div class="break-all">
{rule.payload}
{rule.size !== -1 && ` (${rule.size})`}
{typeof rule.size === 'number' &&
rule.size !== -1 &&
` (${rule.size})`}
</div>
<div class="text-xs text-slate-500">
{rule.type} :: {rule.proxy}