mysql-dashboard 0.3.0 → 0.4.0

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.
Files changed (2) hide show
  1. package/package.json +22 -9
  2. package/start.mjs +12 -0
package/package.json CHANGED
@@ -1,10 +1,16 @@
1
1
  {
2
2
  "name": "mysql-dashboard",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Web-based MySQL database management tool (f2e-server3)",
5
5
  "main": "start.mjs",
6
6
  "module": "start.mjs",
7
- "files": ["lib", "output", "start.mjs", "README.md", "DEVELOPMENT.md"],
7
+ "files": [
8
+ "lib",
9
+ "output",
10
+ "start.mjs",
11
+ "README.md",
12
+ "DEVELOPMENT.md"
13
+ ],
8
14
  "bin": {
9
15
  "mysql-dashboard": "start.mjs"
10
16
  },
@@ -18,7 +24,13 @@
18
24
  "prepublishOnly": "npm run build",
19
25
  "test": "npm run build:server && node start.mjs -m dev"
20
26
  },
21
- "keywords": ["f2e-server3", "esbuild", "react", "tailwindcss", "mysql"],
27
+ "keywords": [
28
+ "f2e-server3",
29
+ "esbuild",
30
+ "react",
31
+ "tailwindcss",
32
+ "mysql"
33
+ ],
22
34
  "author": "shy2850",
23
35
  "license": "MIT",
24
36
  "repository": {
@@ -26,23 +38,24 @@
26
38
  "url": "https://gitee.com/shy9120/mysql-dashboard.git"
27
39
  },
28
40
  "devDependencies": {
41
+ "@ant-design/icons": "^6.1.0",
29
42
  "@biomejs/biome": "^2.3.2",
30
43
  "@tailwindcss/postcss": "^4.1.5",
31
44
  "@types/node": "^24.10.2",
32
45
  "@types/react": "^19.0.8",
33
46
  "@types/react-dom": "^19.0.3",
34
47
  "@types/react-router-dom": "^5.3.3",
48
+ "antd": "^6.1.0",
35
49
  "chokidar": "^4.0.3",
36
50
  "esbuild": "^0.25.0",
37
51
  "react": "^19.0.0",
38
- "react-dom": "^19.0.0"
52
+ "react-dom": "^19.0.0",
53
+ "react-markdown": "^10.1.0",
54
+ "react-router-dom": "^7.10.1"
39
55
  },
40
56
  "dependencies": {
41
- "@ant-design/icons": "^6.1.0",
42
- "antd": "^6.1.0",
57
+ "f2e-middle-rbac": "^0.1.15",
43
58
  "f2e-server3": "^1.16.2",
44
- "mysql2": "^3.15.3",
45
- "react-markdown": "^10.1.0",
46
- "react-router-dom": "^7.10.1"
59
+ "mysql2": "^3.15.3"
47
60
  }
48
61
  }
package/start.mjs CHANGED
@@ -2,6 +2,7 @@
2
2
  // @ts-check
3
3
  import { Command, logger, ModeOptions, createServer, LogLevelOptions, dynamicImport } from "f2e-server3"
4
4
  import * as path from 'node:path'
5
+ import { createMiddleRBAC, createServiceFile } from 'f2e-middle-rbac'
5
6
  import "./lib/index.js"
6
7
 
7
8
  const outputDir = 'output'
@@ -23,6 +24,7 @@ const app = new Command('mysql-dashboard')
23
24
  plugins: [tailwindcss()],
24
25
  }
25
26
  }
27
+ const service = createServiceFile({});
26
28
  createServer({
27
29
  root: mode === 'prod' ? path.resolve(import.meta.dirname, outputDir) : undefined,
28
30
  mode,
@@ -33,6 +35,16 @@ const app = new Command('mysql-dashboard')
33
35
  outputFilter: pathname => /^(index|static|$)/.test(pathname),
34
36
  postcss,
35
37
  try_files: 'index.html',
38
+ middlewares: [
39
+ // 创建 RBAC 中间件
40
+ createMiddleRBAC(service),
41
+ ],
42
+ auth: {
43
+ // 指定用户服务, 验证获取登录用户信息
44
+ store: service.userService,
45
+ // 登录成功后跳转的页面, 默认跳转到 /admin 为系统管理页
46
+ redirect: '/',
47
+ },
36
48
  dest: outputDir,
37
49
  })
38
50
  })