Skip to content

Commit

Permalink
ui directory migration
Browse files Browse the repository at this point in the history
  • Loading branch information
yang1666204 committed Feb 29, 2024
1 parent 536765c commit 5c57ec3
Show file tree
Hide file tree
Showing 163 changed files with 26,543 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ui/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: require.resolve('@umijs/max/eslint'),
};
13 changes: 13 additions & 0 deletions ui/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/node_modules
/.env.local
/.umirc.local.ts
/config/config.local.ts
/src/.umi
/src/.umi-production
/src/.umi-test
/.umi
/.umi-production
/.umi-test
/.mfsu
.swc
/.must.config.js
17 changes: 17 additions & 0 deletions ui/.lintstagedrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"*.{md,json}": [
"prettier --cache --write"
],
"*.{js,jsx}": [
"max lint --fix --eslint-only",
"prettier --cache --write"
],
"*.{css,less}": [
"max lint --fix --stylelint-only",
"prettier --cache --write"
],
"*.ts?(x)": [
"max lint --fix --eslint-only",
"prettier --cache --parser=typescript --write"
]
}
2 changes: 2 additions & 0 deletions ui/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
registry=https://registry.npmmirror.com/

3 changes: 3 additions & 0 deletions ui/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
.umi
.umi-production
8 changes: 8 additions & 0 deletions ui/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"printWidth": 80,
"singleQuote": true,
"trailingComma": "all",
"proseWrap": "never",
"overrides": [{ "files": ".prettierrc", "options": { "parser": "json" } }],
"plugins": ["prettier-plugin-organize-imports", "prettier-plugin-packagejson"]
}
3 changes: 3 additions & 0 deletions ui/.stylelintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: require.resolve('@umijs/max/stylelint'),
};
3 changes: 3 additions & 0 deletions ui/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# README

`@umijs/max` 模板项目,更多功能参考 [Umi Max 简介](https://umijs.org/docs/max/introduce)
21 changes: 21 additions & 0 deletions ui/config/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { defineConfig } from '@umijs/max';
import routes from './routes';

export default defineConfig({
antd: {},
access: {},
model: {},
initialState: {},
request: {},
favicons: ['/logo.png'],
title: 'OceanBase Dashboard',
mock: false,
layout: false,
locale: {
default: 'zh-CN',
baseSeparator: '-',
},
routes,
history: { type: 'hash' },
npmClient: 'yarn'
});
123 changes: 123 additions & 0 deletions ui/config/routes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
export default [
{
path: '/',
component: 'Layouts',
routes: [
{
path: '/',
component: 'Layouts/BasicLayout',
name: '系统布局',
routes: [
{
path: 'cluster',
component: 'Cluster',
name: '集群页',
},
{
path:'cluster/new',
component:'Cluster/New',
name: '创建集群',
},
{
path:'tenant',
component:'Tenant',
name:'租户页'
},
{
path:'tenant/new',
component:'Tenant/New',
name:'创建租户'
},
{
path: 'overview',
component: 'Overview',
name: '系统概览页',
},
{
path: '/',
redirect: 'overview',
name: '系统概览页',
},
],
},
{
path: 'cluster/:clusterId',
component: 'Cluster/Detail',
name: '集群详情',
routes: [
{
path: 'overview',
component: 'Cluster/Detail/Overview',
name: '概览页',
},
{
path: 'topo',
component: 'Cluster/Detail/Topo',
name: '集群拓扑图',
},
{
path:'monitor',
component:'Cluster/Detail/Monitor',
name:'集群详情监控'
},
{
path:'tenant',
component:'Cluster/Detail/Tenant',
name:'集群下的租户'
},
{
path: '/cluster/:clusterId',
redirect: 'overview',
name: '概览页',
},
],
},
{
path:'tenant/:tenantId',
component:'Tenant/Detail',
name:'租户详情',
routes:[
{
path: 'overview',
component: 'Tenant/Detail/Overview',
name: '概览页',
},
{
path: 'topo',
component: 'Tenant/Detail/Topo',
name: '租户拓扑图',
},
{
path: 'backup',
component: 'Tenant/Detail/Backup',
name: '租户备份',
},
{
path: 'backup/new',
component: 'Tenant/Detail/NewBackup',
name: '新建租户备份',
},
{
path:'monitor',
component:'Tenant/Detail/Monitor',
name:'租户详情监控'
},
{
path: '/tenant/:tenantId',
redirect: 'overview',
name: '概览页',
},
]
},
{
path: '/login',
component: 'Login',
name: '登录页',
},
{
component: 'Error/404',
name: '404 页面不存在',
},
],
},
];
46 changes: 46 additions & 0 deletions ui/mock/clusterAPI.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
export default {
'/api/v1/cluster/events': {
data: [
{
namespace: 'oceanbase',
type: 'NORMAL', //NORMAL, WARNING or nil
count: 0,
firstOccur: 0,
lastSeen: 0,
reason: 'Unhealthy',
object: 'pod/obcluster-obzone1-xerijei',
message: 'pod recreate',
},
],
message: '',
successful: true,
},

'/cluster/nodes': {
data: [
{
info: {
name: 'sqaappnoxdnv62s2011161204050.sa128',
status: 'Ready',
roles: 'control-plane,master',
uptime: '28d',
version: 'v1.23.6+k3s1',
internalIp: '11.161.204.50',
externalIp: '',
os: 'Alibaba Group Enterprise Linux Server 7.2 (Paladin)',
kernel: '4.9.151-015.ali3000.alios7.x86_64',
cri: 'docker://18.6.1',
},
resource: {
cpuTotal: 32, //cpu总量
cpuUsed: 20.5, //已使用
memoryTotal: 12341234123, //单位字节
memoryUsed: 41234123,
// no disk displayed in resource, since it's possible to use remote disk
},
},
],
message: '',
successful: true,
},
};
Empty file added ui/mock/monitor.ts
Empty file.
Loading

0 comments on commit 5c57ec3

Please sign in to comment.