mirror of
https://github.com/MetaCubeX/metacubexd.git
synced 2024-11-15 06:45:36 +08:00
refactor: treat formatTimeFromNow as helper not signal
This commit is contained in:
parent
2bc5c78d91
commit
c397ed4dda
@ -1,2 +1,3 @@
|
|||||||
export * from './global'
|
export * from './global'
|
||||||
export * from './proxies'
|
export * from './proxies'
|
||||||
|
export * from './time'
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import dayjs from 'dayjs'
|
import dayjs, { locale } from 'dayjs'
|
||||||
import { locale } from '~/i18n'
|
|
||||||
|
|
||||||
export const formatTimeFromNow = (time: number | string) =>
|
export const formatTimeFromNow = (time: number | string) =>
|
||||||
dayjs(time).locale(locale()).fromNow()
|
dayjs(time).locale(locale()).fromNow()
|
@ -37,6 +37,7 @@ import {
|
|||||||
} from '~/components'
|
} from '~/components'
|
||||||
import DocumentTitle from '~/components/DocumentTitle'
|
import DocumentTitle from '~/components/DocumentTitle'
|
||||||
import { CONNECTIONS_TABLE_ACCESSOR_KEY } from '~/constants'
|
import { CONNECTIONS_TABLE_ACCESSOR_KEY } from '~/constants'
|
||||||
|
import { formatTimeFromNow } from '~/helpers'
|
||||||
import { useI18n } from '~/i18n'
|
import { useI18n } from '~/i18n'
|
||||||
import {
|
import {
|
||||||
allConnections,
|
allConnections,
|
||||||
@ -45,7 +46,6 @@ import {
|
|||||||
connectionsTableColumnVisibility,
|
connectionsTableColumnVisibility,
|
||||||
connectionsTableSize,
|
connectionsTableSize,
|
||||||
endpoint,
|
endpoint,
|
||||||
formatTimeFromNow,
|
|
||||||
quickFilterRegex,
|
quickFilterRegex,
|
||||||
setConnectionsTableColumnOrder,
|
setConnectionsTableColumnOrder,
|
||||||
setConnectionsTableColumnVisibility,
|
setConnectionsTableColumnVisibility,
|
||||||
|
@ -17,12 +17,12 @@ import {
|
|||||||
import DocumentTitle from '~/components/DocumentTitle'
|
import DocumentTitle from '~/components/DocumentTitle'
|
||||||
import {
|
import {
|
||||||
filterProxiesByAvailability,
|
filterProxiesByAvailability,
|
||||||
|
formatTimeFromNow,
|
||||||
sortProxiesByOrderingType,
|
sortProxiesByOrderingType,
|
||||||
} from '~/helpers'
|
} from '~/helpers'
|
||||||
import { useI18n } from '~/i18n'
|
import { useI18n } from '~/i18n'
|
||||||
import {
|
import {
|
||||||
endpoint,
|
endpoint,
|
||||||
formatTimeFromNow,
|
|
||||||
hideUnAvailableProxies,
|
hideUnAvailableProxies,
|
||||||
iconHeight,
|
iconHeight,
|
||||||
iconMarginRight,
|
iconMarginRight,
|
||||||
|
@ -4,9 +4,9 @@ import { matchSorter } from 'match-sorter'
|
|||||||
import { twMerge } from 'tailwind-merge'
|
import { twMerge } from 'tailwind-merge'
|
||||||
import { Button } from '~/components'
|
import { Button } from '~/components'
|
||||||
import DocumentTitle from '~/components/DocumentTitle'
|
import DocumentTitle from '~/components/DocumentTitle'
|
||||||
import { useStringBooleanMap } from '~/helpers'
|
import { formatTimeFromNow, useStringBooleanMap } from '~/helpers'
|
||||||
import { useI18n } from '~/i18n'
|
import { useI18n } from '~/i18n'
|
||||||
import { endpoint, formatTimeFromNow, useRules } from '~/signals'
|
import { endpoint, useRules } from '~/signals'
|
||||||
import { Rule, RuleProvider } from '~/types'
|
import { Rule, RuleProvider } from '~/types'
|
||||||
|
|
||||||
enum ActiveTab {
|
enum ActiveTab {
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
export * from './config'
|
export * from './config'
|
||||||
export * from './connections'
|
export * from './connections'
|
||||||
export * from './global'
|
|
||||||
export * from './proxies'
|
export * from './proxies'
|
||||||
export * from './request'
|
export * from './request'
|
||||||
export * from './rules'
|
export * from './rules'
|
||||||
|
Loading…
Reference in New Issue
Block a user