Skip to content

Commit

Permalink
updated at 2023-10-17 19:07 by mc git-up
Browse files Browse the repository at this point in the history
  • Loading branch information
magicdawn committed Oct 17, 2023
1 parent 1425751 commit de5e984
Show file tree
Hide file tree
Showing 20 changed files with 72 additions and 50 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"fs-extra": "^11.1.1",
"husky": "^8.0.3",
"jake": "^10.8.7",
"lint-staged": "^15.0.1",
"lint-staged": "^14",
"minimist": "^1.2.8",
"napa": "^3.0.0",
"nodemon": "^3.0.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { ClashProxyItem } from '$clash-utils'

export default interface ClashConfig {
export interface ClashConfig {
'proxies': ClashProxyItem[]
'proxy-groups': ProxyGroup[]
'proxy-providers': ProxyProviders | undefined
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export { ClashConfig } from './ClashConfig'

export interface Subscribe<ExtData = any> {
id: string
name: string
Expand Down Expand Up @@ -70,5 +72,3 @@ export interface ConfigItem {
id: string
disabled?: boolean
}

export { default as ClashConfig } from './define/ClashConfig'
2 changes: 1 addition & 1 deletion packages/ui/src/page/current-config/ConfigDND.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ConfigItem } from '$ui/common/define'
import { ConfigItem } from '$ui/define'
import { cx } from '$ui/libs'
import { rootState } from '$ui/store'
import { limitLines } from '$ui/util/text-util'
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/page/current-config/model.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ConfigItem, RuleItem, Subscribe } from '$ui/common/define'
import { valtioState } from '$ui/common/model/valtio-helper'
import { ConfigItem, RuleItem, Subscribe } from '$ui/define'
import { onInit, onReload } from '$ui/page/global-model'
import storage from '$ui/storage'
import _ from 'lodash'
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/page/library-rule-list/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
EditorRefInner,
showCode,
} from '$ui/common/code'
import { LocalRuleItem, RuleItem } from '$ui/common/define'
import { LocalRuleItem, RuleItem } from '$ui/define'
import { message } from '$ui/store'
import { useIsDarkMode } from '$ui/util/hooks/useIsDarkMode'
import { getRuleItemContent } from '$ui/util/remote-rules'
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/src/page/library-rule-list/model.auto-update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
*/

import { runGenerate } from '$ui/commands/run'
import { RuleItem } from '$ui/common/define'
import { RuleItem } from '$ui/define'
import { debounce, DebouncedFunc, once } from 'lodash'
import ms from 'ms'
import { currentConfigUsingAndEnabled } from '../current-config/model'
import { state, updateRemote } from './model'

const timerRegistry: Record<string, NodeJS.Timer | undefined> = {}
const timerRegistry: Record<string, NodeJS.Timeout | undefined> = {}
const cleanupTimer = (timerKey: string) => {
if (timerRegistry[timerKey]) {
clearInterval(timerRegistry[timerKey])
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/page/library-rule-list/model.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { RuleItem } from '$ui/common/define'
import { valtioState } from '$ui/common/model/valtio-helper'
import { RuleItem } from '$ui/define'
import { onInit, onReload } from '$ui/page/global-model'
import storage from '$ui/storage'
import { message } from '$ui/store'
Expand Down
14 changes: 3 additions & 11 deletions packages/ui/src/page/library-subscribe/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Subscribe, SubscribeSpecialType } from '$ui/common/define'
import { Subscribe, SubscribeSpecialType } from '$ui/define'
import { message } from '$ui/store'
import { EyeFilled, EyeInvisibleFilled, UnorderedListOutlined } from '@ant-design/icons'
import { useMemoizedFn, useUpdateEffect } from 'ahooks'
Expand Down Expand Up @@ -233,11 +233,7 @@ function SubscribeItem({
title={`节点列表(${servers?.length})`}
content={
<div style={{ maxHeight: '50vh', overflowY: 'scroll' }}>
<ul>
{servers?.map((s) => (
<li key={s.name}>{s.name}</li>
))}
</ul>
<ul>{servers?.map((s) => <li key={s.name}>{s.name}</li>)}</ul>
</div>
}
trigger='click'
Expand All @@ -251,11 +247,7 @@ function SubscribeItem({
title={`链接列表(${specialData?.recentDays})`}
content={
<div style={{ maxHeight: '200px', overflowY: 'scroll' }}>
<ul>
{nodefreeGetUrls(item)?.map((url) => (
<li key={url}>{url}</li>
))}
</ul>
<ul>{nodefreeGetUrls(item)?.map((url) => <li key={url}>{url}</li>)}</ul>
</div>
}
trigger='click'
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/src/page/library-subscribe/model.auto-update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
*/

import { runGenerate } from '$ui/commands/run'
import { Subscribe } from '$ui/common/define'
import { Subscribe } from '$ui/define'
import { once } from 'lodash'
import ms from 'ms'
import { currentConfigUsingAndEnabled } from '../current-config/model'
import { state, update } from './model'

const timerRegistry: Record<string, NodeJS.Timer | undefined> = {}
const timerRegistry: Record<string, NodeJS.Timeout | undefined> = {}
const cleanupTimer = (timerKey: string) => {
if (timerRegistry[timerKey]) {
clearInterval(timerRegistry[timerKey])
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/page/library-subscribe/model.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ClashProxyItem } from '$clash-utils'
import { Subscribe } from '$ui/common/define'
import { valtioState } from '$ui/common/model/valtio-helper'
import { Subscribe } from '$ui/define'
import { onInit, onReload } from '$ui/page/global-model'
import storage from '$ui/storage'
import { message } from '$ui/store'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Subscribe } from '$ui/common/define'
import { Subscribe } from '$ui/define'
import moment from 'moment'

export type NodefreeData = {
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/page/preference/modal/SelectExport.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ConfigItem } from '$ui/common/define'
import { ConfigItem } from '$ui/define'
import { ExportData, storageDataDisplayNames } from '$ui/storage'
import { truthy } from '$ui/util/ts-filter'
import { useMemoizedFn, useUpdateEffect } from 'ahooks'
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/storage/config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type StorageData } from '.'
import { type StorageData } from './index'

export const keysToOmit = [
'subscribe_detail' as const,
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/storage/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint camelcase: off */

import { ConfigItem, RuleItem, Subscribe } from '$ui/common/define'
import { ConfigItem, RuleItem, Subscribe } from '$ui/define'
import Store from 'electron-store'
import { omit } from 'lodash'
import { keysToOmit } from './config'
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/src/util/gen.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ClashConfig, RuleItem, Subscribe } from '$ui/common/define'
import { ProxyGroupType } from '$ui/common/define/ClashConfig'
import { ClashConfig, RuleItem, Subscribe } from '$ui/define'
import { ProxyGroupType } from '$ui/define/ClashConfig'
import { YAML, pmap } from '$ui/libs'
import { rootActions, rootState } from '$ui/store'
import fse from 'fs-extra'
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/util/remote-rules.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { appCacheDir } from '$ui/common'
import { RemoteRuleItem, RemoteRuleProviderRuleItem } from '$ui/common/define'
import { RemoteRuleItem, RemoteRuleProviderRuleItem } from '$ui/define'
import { YAML } from '$ui/libs'
import fse from 'fs-extra'
import path from 'path'
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/util/subscribe.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import { md5 } from '$clash-utils'
import { ClashConfig } from '$ui/common/define'
import { ClashConfig } from '$ui/define'
import bytes from 'bytes'
import envPaths from 'env-paths'
import fse from 'fs-extra'
Expand Down
62 changes: 46 additions & 16 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
"$ui/*": ["ui/src/*"],
"$clash-utils": ["clash-utils/src/"],
"$clash-utils/*": ["clash-utils/src/*"]
}
},
"noEmit": true
},
"ts-node": {
"transpileOnly": true,
"swc": true,
"compilerOptions": {
"module": "CommonJS"
Expand Down

0 comments on commit de5e984

Please sign in to comment.