Skip to content

Commit

Permalink
chore: format dashboard (#935)
Browse files Browse the repository at this point in the history
Signed-off-by: Xuhui zhang <[email protected]>
  • Loading branch information
zxh326 authored Apr 24, 2024
1 parent 258b389 commit ddb62ac
Show file tree
Hide file tree
Showing 26 changed files with 2,814 additions and 2,919 deletions.
2 changes: 1 addition & 1 deletion dashboard-ui/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
extends: require.resolve('@umijs/max/eslint'),
};
}
9 changes: 2 additions & 7 deletions dashboard-ui/.lintstagedrc
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
{
"*.{md,json}": [
"prettier --cache --write"
],
"*.{js,jsx}": [
"max lint --fix --eslint-only",
"prettier --cache --write"
],
"*.{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"
Expand Down
2 changes: 2 additions & 0 deletions dashboard-ui/.prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
node_modules
.umi
.umi-production
.vscode
dist
2 changes: 2 additions & 0 deletions dashboard-ui/.prettierrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{
"printWidth": 80,
"singleQuote": true,
"semi": false,
"trailingComma": "all",
"proseWrap": "never",
"tabWidth": 2,
"overrides": [{ "files": ".prettierrc", "options": { "parser": "json" } }],
"plugins": ["prettier-plugin-organize-imports", "prettier-plugin-packagejson"]
}
2 changes: 1 addition & 1 deletion dashboard-ui/.stylelintrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
extends: require.resolve('@umijs/max/stylelint'),
};
}
166 changes: 83 additions & 83 deletions dashboard-ui/.umirc.ts
Original file line number Diff line number Diff line change
@@ -1,88 +1,88 @@
import { defineConfig } from '@umijs/max';
import { defineConfig } from '@umijs/max'

export default defineConfig({
antd: {},
access: {},
model: {},
initialState: {},
request: {},
layout: {
title: 'JuiceFS',
locale: true,
antd: {},
access: {},
model: {},
initialState: {},
request: {},
layout: {
title: 'JuiceFS',
locale: true,
},
favicons: ['https://static1.juicefs.com/images/favicon.d6e4afae8198.ico'],
base: '/app/',
publicPath: '/app/',
routes: [
{
path: '/',
redirect: '/pods',
},
favicons: ['https://static1.juicefs.com/images/favicon.d6e4afae8198.ico'],
base: '/app/',
publicPath: '/app/',
routes: [
{
path: '/',
redirect: '/pods',
},
{
title: 'appPodTable',
path: '/pods',
component: './AppPodTable',
icon: '/app/pod-256.png',
},
{
title: 'sysPodTable',
path: '/syspods',
component: './SystemPodTable',
icon: '/app/ds-256.png',
},
{
name: 'PV',
path: '/pvs',
component: './PVTable',
icon: '/app/pv-256.png',
},
{
name: 'PVC',
path: '/pvcs',
component: './PVCTable',
icon: '/app/pvc-256.png',
},
{
name: 'StorageClass',
path: '/storageclasses',
component: './SCTable',
icon: '/app/sc-256.png',
},
{
path: '/pod/:namespace/:podName',
component: './DetailedPod',
},
{
path: '/apppod/:namespace/:podName',
component: './DetailedPod',
},
{
path: '/mountpod/:namespace/:podName',
component: './DetailedPod',
},
{
path: '/pv/:pvName',
component: './DetailedPV',
},
{
path: '/pvc/:namespace/:name',
component: './DetailedPVC',
},
{
path: '/storageclass/:scName',
component: './DetailedSC',
},
],
npmClient: 'yarn',
locale: {
antd: true,
baseNavigator: true,
title: true,
// useLocalStorage: true,
default: 'en-US',
baseSeparator: '-',
{
title: 'appPodTable',
path: '/pods',
component: './AppPodTable',
icon: '/app/pod-256.png',
},
define: {
HOST: '',
{
title: 'sysPodTable',
path: '/syspods',
component: './SystemPodTable',
icon: '/app/ds-256.png',
},
});
{
name: 'PV',
path: '/pvs',
component: './PVTable',
icon: '/app/pv-256.png',
},
{
name: 'PVC',
path: '/pvcs',
component: './PVCTable',
icon: '/app/pvc-256.png',
},
{
name: 'StorageClass',
path: '/storageclasses',
component: './SCTable',
icon: '/app/sc-256.png',
},
{
path: '/pod/:namespace/:podName',
component: './DetailedPod',
},
{
path: '/apppod/:namespace/:podName',
component: './DetailedPod',
},
{
path: '/mountpod/:namespace/:podName',
component: './DetailedPod',
},
{
path: '/pv/:pvName',
component: './DetailedPV',
},
{
path: '/pvc/:namespace/:name',
component: './DetailedPVC',
},
{
path: '/storageclass/:scName',
component: './DetailedSC',
},
],
npmClient: 'yarn',
locale: {
antd: true,
baseNavigator: true,
title: true,
// useLocalStorage: true,
default: 'en-US',
baseSeparator: '-',
},
define: {
HOST: 'http://localhost:8088',
},
})
8 changes: 4 additions & 4 deletions dashboard-ui/mock/userAPI.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
const users = [
{ id: 0, name: 'Umi', nickName: 'U', gender: 'MALE' },
{ id: 1, name: 'Fish', nickName: 'B', gender: 'FEMALE' },
];
]

export default {
'GET /api/v1/queryUserList': (req: any, res: any) => {
res.json({
success: true,
data: { list: users },
errorCode: 0,
});
})
},
'PUT /api/v1/user/': (req: any, res: any) => {
res.json({
success: true,
errorCode: 0,
});
})
},
};
}
46 changes: 23 additions & 23 deletions dashboard-ui/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,35 +14,35 @@
limitations under the License.
*/

import { DarkMode, Question, SelectLang } from '@/components/RightContent';
import { Flex } from 'antd';
import { RuntimeConfig } from 'umi';
import { DarkMode, Question, SelectLang } from '@/components/RightContent'
import { Flex } from 'antd'
import { RuntimeConfig } from 'umi'

// 运行时配置

// 全局初始化数据配置,用于 Layout 用户信息和权限初始化
// 更多信息见文档:https://umijs.org/docs/api/runtime-config#getinitialstate
export async function getInitialState(): Promise<object> {
return {};
return {}
}

export const layout: RuntimeConfig['layout'] = () => {
return {
// navTheme: "realDark",
actionsRender: () => [
<Flex align="center" gap="small" key="ar-flex">
<Question key="doc" />
<SelectLang key="SelectLang" />
<DarkMode key="darkMode" />
</Flex>,
],
layout: 'mix',
title: 'JuiceFS CSI',
logo: false,
menu: {
locale: false,
},
rightContentRender: false,
colorPrimary: '#0ABD59',
};
};
return {
// navTheme: "realDark",
actionsRender: () => [
<Flex align="center" gap="small" key="ar-flex">
<Question key="doc" />
<SelectLang key="SelectLang" />
<DarkMode key="darkMode" />
</Flex>,
],
layout: 'mix',
title: 'JuiceFS CSI',
logo: false,
menu: {
locale: false,
},
rightContentRender: false,
colorPrimary: '#0ABD59',
}
}
Loading

0 comments on commit ddb62ac

Please sign in to comment.