From d88641ea5ea289716c325a04f87947a410c8c26f Mon Sep 17 00:00:00 2001 From: kunish Date: Sat, 12 Oct 2024 23:19:39 +0800 Subject: [PATCH] chore: update module import paths --- src/components/DocumentTitle.tsx | 4 ++-- src/components/index.ts | 1 + src/pages/Config.tsx | 3 +-- src/pages/Connections.tsx | 2 +- src/pages/Logs.tsx | 6 ++---- src/pages/Overview.tsx | 2 +- src/pages/Proxies.tsx | 2 +- src/pages/Rules.tsx | 3 +-- src/pages/Setup.tsx | 3 +-- src/signals/index.ts | 1 + src/signals/logs.ts | 3 +-- 11 files changed, 13 insertions(+), 17 deletions(-) diff --git a/src/components/DocumentTitle.tsx b/src/components/DocumentTitle.tsx index 5e4dfa4..bf22200 100644 --- a/src/components/DocumentTitle.tsx +++ b/src/components/DocumentTitle.tsx @@ -1,6 +1,6 @@ import { Title } from '@solidjs/meta' import { ParentComponent } from 'solid-js' -export default (({ children }) => { +export const DocumentTitle: ParentComponent = ({ children }) => { return {children} - MetaCubeXD -}) as ParentComponent +} diff --git a/src/components/index.ts b/src/components/index.ts index 89511ff..79066b3 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -3,6 +3,7 @@ export * from './Collapse' export * from './ConfigTitle' export * from './ConnectionsSettingsModal' export * from './ConnectionsTableDetailsModal' +export * from './DocumentTitle' export * from './Header' export * from './Latency' export * from './LogoText' diff --git a/src/pages/Config.tsx b/src/pages/Config.tsx index eb0b452..2a4b709 100644 --- a/src/pages/Config.tsx +++ b/src/pages/Config.tsx @@ -23,8 +23,7 @@ import { upgradingBackend, upgradingUI, } from '~/apis' -import { Button, ConfigTitle } from '~/components' -import DocumentTitle from '~/components/DocumentTitle' +import { Button, ConfigTitle, DocumentTitle } from '~/components' import { LANG, ROUTES, themes } from '~/constants' import { Dict, locale, setLocale, useI18n } from '~/i18n' import { diff --git a/src/pages/Connections.tsx b/src/pages/Connections.tsx index 405b5a0..fd09176 100644 --- a/src/pages/Connections.tsx +++ b/src/pages/Connections.tsx @@ -34,8 +34,8 @@ import { Button, ConnectionsSettingsModal, ConnectionsTableDetailsModal, + DocumentTitle, } from '~/components' -import DocumentTitle from '~/components/DocumentTitle' import { CONNECTIONS_TABLE_ACCESSOR_KEY } from '~/constants' import { formatTimeFromNow } from '~/helpers' import { useI18n } from '~/i18n' diff --git a/src/pages/Logs.tsx b/src/pages/Logs.tsx index fa5ed17..65e5910 100644 --- a/src/pages/Logs.tsx +++ b/src/pages/Logs.tsx @@ -18,12 +18,10 @@ import { getSortedRowModel, } from '@tanstack/solid-table' import { twMerge } from 'tailwind-merge' -import { Button, LogsSettingsModal } from '~/components' -import DocumentTitle from '~/components/DocumentTitle' +import { Button, DocumentTitle, LogsSettingsModal } from '~/components' import { LOG_LEVEL } from '~/constants' import { useI18n } from '~/i18n' -import { endpoint, logsTableSize, tableSizeClassName } from '~/signals' -import { useLogs } from '~/signals/logs' +import { endpoint, logsTableSize, tableSizeClassName, useLogs } from '~/signals' import { LogWithSeq } from '~/types' const fuzzyFilter: FilterFn = (row, columnId, value, addMeta) => { diff --git a/src/pages/Overview.tsx b/src/pages/Overview.tsx index ab58120..a2b0982 100644 --- a/src/pages/Overview.tsx +++ b/src/pages/Overview.tsx @@ -4,7 +4,7 @@ import byteSize from 'byte-size' import { merge } from 'lodash' import { SolidApexCharts } from 'solid-apexcharts' import type { JSX, ParentComponent } from 'solid-js' -import DocumentTitle from '~/components/DocumentTitle' +import { DocumentTitle } from '~/components' import { CHART_MAX_XAXIS, DEFAULT_CHART_OPTIONS } from '~/constants' import { useI18n } from '~/i18n' import { endpoint, latestConnectionMsg, useWsRequest } from '~/signals' diff --git a/src/pages/Proxies.tsx b/src/pages/Proxies.tsx index e33ca97..444e1ab 100644 --- a/src/pages/Proxies.tsx +++ b/src/pages/Proxies.tsx @@ -9,12 +9,12 @@ import { twMerge } from 'tailwind-merge' import { Button, Collapse, + DocumentTitle, ProxiesSettingsModal, ProxyNodeCard, ProxyNodePreview, SubscriptionInfo, } from '~/components' -import DocumentTitle from '~/components/DocumentTitle' import { filterProxiesByAvailability, formatTimeFromNow, diff --git a/src/pages/Rules.tsx b/src/pages/Rules.tsx index c8a804a..c357a9d 100644 --- a/src/pages/Rules.tsx +++ b/src/pages/Rules.tsx @@ -2,8 +2,7 @@ import { IconReload } from '@tabler/icons-solidjs' import { createVirtualizer } from '@tanstack/solid-virtual' import { matchSorter } from 'match-sorter' import { twMerge } from 'tailwind-merge' -import { Button } from '~/components' -import DocumentTitle from '~/components/DocumentTitle' +import { Button, DocumentTitle } from '~/components' import { formatTimeFromNow, useStringBooleanMap } from '~/helpers' import { useI18n } from '~/i18n' import { endpoint, useRules } from '~/signals' diff --git a/src/pages/Setup.tsx b/src/pages/Setup.tsx index 4cc073d..6b2d981 100644 --- a/src/pages/Setup.tsx +++ b/src/pages/Setup.tsx @@ -5,8 +5,7 @@ import { toast } from 'solid-toast' import { v4 as uuid } from 'uuid' import { z } from 'zod' import { checkEndpointAPI } from '~/apis' -import { Button } from '~/components' -import DocumentTitle from '~/components/DocumentTitle' +import { Button, DocumentTitle } from '~/components' import { transformEndpointURL } from '~/helpers' import { useI18n } from '~/i18n' import { diff --git a/src/signals/index.ts b/src/signals/index.ts index 2e37a89..4150be2 100644 --- a/src/signals/index.ts +++ b/src/signals/index.ts @@ -1,5 +1,6 @@ export * from './config' export * from './connections' +export * from './logs' export * from './proxies' export * from './request' export * from './rules' diff --git a/src/signals/logs.ts b/src/signals/logs.ts index a57cb7e..fcea043 100644 --- a/src/signals/logs.ts +++ b/src/signals/logs.ts @@ -1,5 +1,4 @@ -import { useWsRequest } from '~/signals' -import { logLevel, logMaxRows } from '~/signals/config' +import { logLevel, logMaxRows, useWsRequest } from '~/signals' import { Log, LogWithSeq } from '~/types' let seq = 1