@zhin.js/console 1.0.48 → 1.0.50

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 CHANGED
@@ -1,5 +1,21 @@
1
1
  # @zhin.js/console
2
2
 
3
+ ## 1.0.50
4
+
5
+ ### Patch Changes
6
+
7
+ - zhin.js@1.0.51
8
+ - @zhin.js/http@1.0.45
9
+ - @zhin.js/core@1.0.51
10
+
11
+ ## 1.0.49
12
+
13
+ ### Patch Changes
14
+
15
+ - 353de3d: fix: 控制台优化
16
+ - Updated dependencies [353de3d]
17
+ - @zhin.js/client@1.0.12
18
+
3
19
  ## 1.0.48
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": {
@@ -1,17 +1,20 @@
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, LogIn } 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 DashboardHome from './pages/dashboard-home'
8
- import DashboardPlugins from './pages/dashboard-plugins'
9
- import DashboardPluginDetail from './pages/dashboard-plugin-detail'
10
- import DashboardBots from './pages/dashboard-bots'
11
- import DashboardLogs from './pages/dashboard-logs'
12
- import DashboardConfig from './pages/dashboard-config'
13
- import DashboardEnv from './pages/dashboard-env'
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'
17
+ import LoginAssistPage from './pages/login-assist'
15
18
  import { hasToken } from './utils/auth'
16
19
  import './style.css'
17
20
  import { PersistGate } from 'redux-persist/integration/react'
@@ -64,58 +67,82 @@ function RouteInitializer() {
64
67
  meta: { order: 0 },
65
68
  children: [
66
69
  {
67
- key: 'dashboard-home',
70
+ key: 'homePage',
68
71
  path: '/dashboard',
69
72
  title: '系统概览',
70
73
  icon: <Home className="w-4 h-4" />,
71
- element: <DashboardHome />,
74
+ element: <HomePage />,
72
75
  },
73
76
  {
74
- key: 'dashboard-plugins',
77
+ key: 'loginAssistPage',
78
+ path: '/login-assist',
79
+ title: '登录辅助',
80
+ icon: <LogIn className="w-4 h-4" />,
81
+ element: <LoginAssistPage />,
82
+ meta: { order: 1 }
83
+ },
84
+ {
85
+ key: 'pluginsPage',
75
86
  path: '/plugins',
76
87
  title: '插件管理',
77
88
  icon: <Package className="w-4 h-4" />,
78
- element: <DashboardPlugins />,
89
+ element: <PluginsPage />,
79
90
  meta: { order: 2 }
80
91
  },
81
92
  {
82
- key: 'dashboard-plugin-detail',
93
+ key: 'pluginDetailPage',
83
94
  title: '插件详情',
84
95
  path: '/plugins/:name',
85
- element: <DashboardPluginDetail />,
96
+ element: <PluginDetailPage />,
86
97
  meta: { hideInMenu: true }
87
98
  },
88
99
  {
89
- key: 'dashboard-config',
100
+ key: 'configPage',
90
101
  path: '/config',
91
102
  title: '配置管理',
92
103
  icon: <Settings className="w-4 h-4" />,
93
- element: <DashboardConfig />,
104
+ element: <ConfigPage />,
94
105
  meta: { order: 3 }
95
106
  },
96
107
  {
97
- key: 'dashboard-env',
108
+ key: 'envManagePage',
98
109
  path: '/env',
99
110
  title: '环境变量',
100
111
  icon: <KeyRound className="w-4 h-4" />,
101
- element: <DashboardEnv />,
112
+ element: <EnvMangePage />,
102
113
  meta: { order: 4 }
103
114
  },
104
115
  {
105
- key: 'dashboard-bots',
116
+ key: 'fileManagePage',
117
+ path: '/files',
118
+ title: '文件管理',
119
+ icon: <FolderOpen className="w-4 h-4" />,
120
+ element: <FileMangePage />,
121
+ meta: { order: 5 }
122
+ },
123
+ {
124
+ key: 'databasePage',
125
+ path: '/database',
126
+ title: '数据库',
127
+ icon: <Database className="w-4 h-4" />,
128
+ element: <DatabasePage />,
129
+ meta: { order: 6 }
130
+ },
131
+ {
132
+ key: 'botManagePage',
106
133
  path: '/bots',
107
134
  title: '机器人',
108
135
  icon: <Bot className="w-4 h-4" />,
109
- element: <DashboardBots />,
110
- meta: { order: 5 }
136
+ element: <BotMangePage />,
137
+ meta: { order: 7 }
111
138
  },
112
139
  {
113
- key: 'dashboard-logs',
140
+ key: 'logsPage ',
114
141
  path: '/logs',
115
142
  title: '系统日志',
116
143
  icon: <FileText className="w-4 h-4" />,
117
- element: <DashboardLogs />,
118
- meta: { order: 6 }
144
+ element: <LogsPage />,
145
+ meta: { order: 8 }
119
146
  }
120
147
  ]
121
148
  }
@@ -14,7 +14,7 @@ interface BotInfo {
14
14
  status: 'online' | 'offline'
15
15
  }
16
16
 
17
- export default function DashboardBots() {
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 DashboardConfig() {
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 DashboardHome() {
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)