@zhin.js/console 1.0.47 → 1.0.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/client/index.html +1 -0
- package/client/src/main.tsx +42 -24
- package/client/src/pages/{dashboard-bots.tsx → bots.tsx} +1 -1
- package/client/src/pages/{dashboard-config.tsx → config.tsx} +1 -1
- package/client/src/pages/{dashboard-home.tsx → dashboard.tsx} +1 -1
- package/client/src/pages/database.tsx +708 -0
- package/client/src/pages/{dashboard-env.tsx → env.tsx} +1 -1
- package/client/src/pages/files.tsx +470 -0
- package/client/src/pages/{dashboard-logs.tsx → logs.tsx} +1 -1
- package/client/src/pages/{dashboard-plugin-detail.tsx → plugin-detail.tsx} +1 -1
- package/client/src/pages/{dashboard-plugins.tsx → plugins.tsx} +1 -1
- package/dist/client.js +1 -1
- package/dist/index.html +1 -0
- package/dist/index.js +116 -104
- package/dist/style.css +2 -2
- package/lib/index.js +451 -20
- package/lib/websocket.js +431 -0
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @zhin.js/console
|
|
2
2
|
|
|
3
|
+
## 1.0.49
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 353de3d: fix: 控制台优化
|
|
8
|
+
- Updated dependencies [353de3d]
|
|
9
|
+
- @zhin.js/client@1.0.12
|
|
10
|
+
|
|
11
|
+
## 1.0.48
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- zhin.js@1.0.50
|
|
16
|
+
- @zhin.js/http@1.0.44
|
|
17
|
+
- @zhin.js/core@1.0.50
|
|
18
|
+
|
|
3
19
|
## 1.0.47
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/client/index.html
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>Zhin</title>
|
|
7
7
|
<script src="https://cdn.jsdelivr.net.cn/npm/@tailwindcss/browser@4"></script>
|
|
8
|
+
<script src="https://cdn.jsdelivr.net.cn/npm/@highlightjs/cdn-assets@11/highlight.min.js"></script>
|
|
8
9
|
<script type="importmap">
|
|
9
10
|
{
|
|
10
11
|
"imports": {
|
package/client/src/main.tsx
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { StrictMode, useCallback, useEffect, useState } from 'react'
|
|
2
2
|
import { createRoot } from 'react-dom/client'
|
|
3
3
|
import { Provider as ReduxProvider } from 'react-redux'
|
|
4
|
-
import { Home, Package, Bot, FileText, Settings, KeyRound } from 'lucide-react'
|
|
4
|
+
import { Home, Package, Bot, FileText, Settings, KeyRound, FolderOpen, Database } from 'lucide-react'
|
|
5
5
|
import { store, DynamicRouter, persistor, addPage, useSelector, useWebSocket } from '@zhin.js/client'
|
|
6
6
|
import DashboardLayout from './layouts/dashboard'
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
7
|
+
import HomePage from './pages/dashboard'
|
|
8
|
+
import PluginsPage from './pages/plugins'
|
|
9
|
+
import PluginDetailPage from './pages/plugin-detail'
|
|
10
|
+
import BotMangePage from './pages/bots'
|
|
11
|
+
import LogsPage from './pages/logs'
|
|
12
|
+
import ConfigPage from './pages/config'
|
|
13
|
+
import EnvMangePage from './pages/env'
|
|
14
|
+
import FileMangePage from './pages/files'
|
|
15
|
+
import DatabasePage from './pages/database'
|
|
14
16
|
import LoginPage from './pages/login'
|
|
15
17
|
import { hasToken } from './utils/auth'
|
|
16
18
|
import './style.css'
|
|
@@ -64,58 +66,74 @@ function RouteInitializer() {
|
|
|
64
66
|
meta: { order: 0 },
|
|
65
67
|
children: [
|
|
66
68
|
{
|
|
67
|
-
key: '
|
|
69
|
+
key: 'homePage',
|
|
68
70
|
path: '/dashboard',
|
|
69
71
|
title: '系统概览',
|
|
70
72
|
icon: <Home className="w-4 h-4" />,
|
|
71
|
-
element: <
|
|
73
|
+
element: <HomePage />,
|
|
72
74
|
},
|
|
73
75
|
{
|
|
74
|
-
key: '
|
|
76
|
+
key: 'pluginsPage',
|
|
75
77
|
path: '/plugins',
|
|
76
78
|
title: '插件管理',
|
|
77
79
|
icon: <Package className="w-4 h-4" />,
|
|
78
|
-
element: <
|
|
80
|
+
element: <PluginsPage />,
|
|
79
81
|
meta: { order: 2 }
|
|
80
82
|
},
|
|
81
83
|
{
|
|
82
|
-
key: '
|
|
84
|
+
key: 'pluginDetailPage',
|
|
83
85
|
title: '插件详情',
|
|
84
86
|
path: '/plugins/:name',
|
|
85
|
-
element: <
|
|
87
|
+
element: <PluginDetailPage />,
|
|
86
88
|
meta: { hideInMenu: true }
|
|
87
89
|
},
|
|
88
90
|
{
|
|
89
|
-
key: '
|
|
91
|
+
key: 'configPage',
|
|
90
92
|
path: '/config',
|
|
91
93
|
title: '配置管理',
|
|
92
94
|
icon: <Settings className="w-4 h-4" />,
|
|
93
|
-
element: <
|
|
95
|
+
element: <ConfigPage />,
|
|
94
96
|
meta: { order: 3 }
|
|
95
97
|
},
|
|
96
98
|
{
|
|
97
|
-
key: '
|
|
99
|
+
key: 'envManagePage',
|
|
98
100
|
path: '/env',
|
|
99
101
|
title: '环境变量',
|
|
100
102
|
icon: <KeyRound className="w-4 h-4" />,
|
|
101
|
-
element: <
|
|
103
|
+
element: <EnvMangePage />,
|
|
102
104
|
meta: { order: 4 }
|
|
103
105
|
},
|
|
104
106
|
{
|
|
105
|
-
key: '
|
|
107
|
+
key: 'fileManagePage',
|
|
108
|
+
path: '/files',
|
|
109
|
+
title: '文件管理',
|
|
110
|
+
icon: <FolderOpen className="w-4 h-4" />,
|
|
111
|
+
element: <FileMangePage />,
|
|
112
|
+
meta: { order: 5 }
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
key: 'databasePage',
|
|
116
|
+
path: '/database',
|
|
117
|
+
title: '数据库',
|
|
118
|
+
icon: <Database className="w-4 h-4" />,
|
|
119
|
+
element: <DatabasePage />,
|
|
120
|
+
meta: { order: 6 }
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
key: 'botManagePage',
|
|
106
124
|
path: '/bots',
|
|
107
125
|
title: '机器人',
|
|
108
126
|
icon: <Bot className="w-4 h-4" />,
|
|
109
|
-
element: <
|
|
110
|
-
meta: { order:
|
|
127
|
+
element: <BotMangePage />,
|
|
128
|
+
meta: { order: 7 }
|
|
111
129
|
},
|
|
112
130
|
{
|
|
113
|
-
key: '
|
|
131
|
+
key: 'logsPage ',
|
|
114
132
|
path: '/logs',
|
|
115
133
|
title: '系统日志',
|
|
116
134
|
icon: <FileText className="w-4 h-4" />,
|
|
117
|
-
element: <
|
|
118
|
-
meta: { order:
|
|
135
|
+
element: <LogsPage />,
|
|
136
|
+
meta: { order: 8 }
|
|
119
137
|
}
|
|
120
138
|
]
|
|
121
139
|
}
|
|
@@ -14,7 +14,7 @@ interface BotInfo {
|
|
|
14
14
|
status: 'online' | 'offline'
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
export default function
|
|
17
|
+
export default function BotMangePage() {
|
|
18
18
|
const [bots, setBots] = useState<BotInfo[]>([])
|
|
19
19
|
const [loading, setLoading] = useState(true)
|
|
20
20
|
const [error, setError] = useState<string | null>(null)
|
|
@@ -258,7 +258,7 @@ function ConfigFieldEditor({
|
|
|
258
258
|
)
|
|
259
259
|
}
|
|
260
260
|
|
|
261
|
-
export default function
|
|
261
|
+
export default function ConfigPage() {
|
|
262
262
|
const { yaml, pluginKeys, loading, error, load, save } = useConfigYaml()
|
|
263
263
|
const [mode, setMode] = useState<'form' | 'yaml'>('form')
|
|
264
264
|
const [yamlText, setYamlText] = useState('')
|
|
@@ -25,7 +25,7 @@ interface SystemStatus {
|
|
|
25
25
|
nodeVersion: string
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
export default function
|
|
28
|
+
export default function HomePage() {
|
|
29
29
|
const navigate = useNavigate()
|
|
30
30
|
const [stats, setStats] = useState<Stats | null>(null)
|
|
31
31
|
const [systemStatus, setSystemStatus] = useState<SystemStatus | null>(null)
|