Skip to content

Commit 72a5342

Browse files
committed
init
0 parents  commit 72a5342

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+13511
-0
lines changed

.env

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
PORT=9000

.eslintrc.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
module.exports = {
3+
extends: require.resolve('@umijs/max/eslint'),
4+
};

.gitignore

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/node_modules
2+
/.env.local
3+
/.umirc.local.ts
4+
/config/config.local.ts
5+
/src/.umi
6+
/src/.umi-production
7+
/src/.umi-test
8+
/.umi
9+
/.umi-production
10+
/.umi-test
11+
/dist
12+
/.mfsu
13+
.swc
14+
.DS_Store

.husky/commit-msg

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx --no-install max verify-commit $1

.husky/pre-commit

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx --no-install lint-staged --quiet

.lintstagedrc

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"*.{md,json}": [
3+
"prettier --cache --write"
4+
],
5+
"*.{js,jsx}": [
6+
"max lint --fix --eslint-only",
7+
"prettier --cache --write"
8+
],
9+
"*.{css,less}": [
10+
"max lint --fix --stylelint-only",
11+
"prettier --cache --write"
12+
],
13+
"*.ts?(x)": [
14+
"max lint --fix --eslint-only",
15+
"prettier --cache --parser=typescript --write"
16+
]
17+
}

.npmrc

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
registry=https://registry.npmjs.com/
2+

.prettierignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
.umi
3+
.umi-production

.prettierrc

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"printWidth": 80,
3+
"singleQuote": true,
4+
"trailingComma": "all",
5+
"proseWrap": "never",
6+
"overrides": [{ "files": ".prettierrc", "options": { "parser": "json" } }],
7+
"plugins": ["prettier-plugin-organize-imports", "prettier-plugin-packagejson","unused-imports"],
8+
"rules": {
9+
"@typescript-eslint/no-unused-vars": "off",
10+
"unused-imports/no-unused-imports-ts": "off"
11+
}
12+
}

.stylelintrc.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
extends: require.resolve('@umijs/max/stylelint'),
3+
};

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# README
2+
3+
gpustack ui

config/config.ts

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { defineConfig } from '@umijs/max';
2+
import routes from './routes';
3+
4+
export default defineConfig({
5+
clickToComponent: {},
6+
antd: {
7+
style: 'less',
8+
configProvider: {
9+
theme:{
10+
'root-entry-name': 'variable',
11+
cssVar: true,
12+
hashed: false,
13+
token: {
14+
colorPrimary: '#2fbf85',
15+
motion: true,
16+
}
17+
},
18+
}
19+
},
20+
access: {},
21+
model: {},
22+
initialState: {},
23+
request: {},
24+
// locale: {
25+
// // 默认使用 src/locales/zh-CN.ts 作为多语言文件
26+
// default: 'zh-CN',
27+
// baseSeparator: '-',
28+
// },
29+
layout: false,
30+
routes,
31+
npmClient: 'pnpm',
32+
});

config/routes.ts

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
export default [
2+
{
3+
path: '/',
4+
key: 'dashboard',
5+
layout: false,
6+
icon: 'home',
7+
redirect: '/dashboard',
8+
},
9+
{
10+
name: 'Dashboard',
11+
path: '/dashboard',
12+
key: 'dashboard',
13+
icon: 'home',
14+
component: './dashboard',
15+
},
16+
{
17+
name: 'Playground',
18+
path: '/playground',
19+
key: 'playground',
20+
icon: 'Comment',
21+
component: './playground',
22+
},
23+
{
24+
name: 'Models',
25+
path: '/models',
26+
key: 'models',
27+
icon: 'Block',
28+
component: './models',
29+
},
30+
{
31+
name: 'Nodes',
32+
path: '/nodes',
33+
key: 'nodes',
34+
icon: 'CloudServer',
35+
component: './nodes',
36+
},
37+
{
38+
name: 'Users',
39+
path: '/users',
40+
key: 'users',
41+
icon: 'Team',
42+
component: './users',
43+
},
44+
// {
45+
// name: '首页',
46+
// path: '/home',
47+
// key: 'homes',
48+
// component: './Home',
49+
// },
50+
// {
51+
// name: '权限演示',
52+
// path: '/access',
53+
// key: 'access',
54+
// component: './Access',
55+
// },
56+
// {
57+
// name: ' CRUD 示例',
58+
// path: '/table',
59+
// key: 'table',
60+
// component: './Table',
61+
// },
62+
{
63+
name: '404',
64+
path: '*',
65+
key: '404',
66+
layout: false,
67+
component: './404',
68+
},
69+
];

mock/userAPI.ts

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
const users = [
2+
{ id: 0, name: 'Umi', nickName: 'U', gender: 'MALE' },
3+
{ id: 1, name: 'Fish', nickName: 'B', gender: 'FEMALE' },
4+
];
5+
6+
export default {
7+
'GET /api/v1/queryUserList': (req: any, res: any) => {
8+
res.json({
9+
success: true,
10+
data: { list: users },
11+
errorCode: 0,
12+
});
13+
},
14+
'PUT /api/v1/user/': (req: any, res: any) => {
15+
res.json({
16+
success: true,
17+
errorCode: 0,
18+
});
19+
},
20+
};

overrides.less

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// only for third party libraries styles

package.json

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"private": true,
3+
"author": "jialin <[email protected]>",
4+
"scripts": {
5+
"dev": "max dev",
6+
"build": "max build",
7+
"format": "prettier --cache --write .",
8+
"prepare": "husky",
9+
"postinstall": "max setup",
10+
"setup": "max setup",
11+
"start": "npm run dev"
12+
},
13+
"dependencies": {
14+
"@ant-design/icons": "^5.3.7",
15+
"@ant-design/pro-components": "^2.7.1",
16+
"@umijs/max": "^4.2.1",
17+
"antd": "^5.17.0"
18+
},
19+
"devDependencies": {
20+
"@types/react": "^18.3.1",
21+
"@types/react-dom": "^18.3.0",
22+
"husky": "^9.0.11",
23+
"lint-staged": "^15.2.2",
24+
"prettier": "^3.2.5",
25+
"prettier-plugin-organize-imports": "^3.2.4",
26+
"prettier-plugin-packagejson": "^2.5.0",
27+
"typescript": "^5.4.5"
28+
}
29+
}

0 commit comments

Comments
 (0)