Skip to content

Commit

Permalink
[optimization][dinky-web]dinky-web module optimization (DataLinkDC#1597)
Browse files Browse the repository at this point in the history
* dinky-web module optimization

* add favicon.ico and delete notices.ts

* change token style

* change about page

* delete some local

* add file header
  • Loading branch information
Zzm0809 authored Feb 2, 2023
1 parent 8be6860 commit 105baae
Show file tree
Hide file tree
Showing 142 changed files with 2,747 additions and 4,977 deletions.
17 changes: 17 additions & 0 deletions dinky-web/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

module.exports = {
extends: [require.resolve('@umijs/lint/dist/config/eslint')],
globals: {
Expand Down
2 changes: 2 additions & 0 deletions dinky-web/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,5 @@ screenshot
.eslintcache

build

pnpm-lock.yaml
7 changes: 0 additions & 7 deletions dinky-web/.husky/commit-msg

This file was deleted.

4 changes: 0 additions & 4 deletions dinky-web/.husky/pre-commit

This file was deleted.

1 change: 0 additions & 1 deletion dinky-web/.prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@ LICENSE
*.lock
yarn-error.log
.history
CNAME
/build
/public
17 changes: 17 additions & 0 deletions dinky-web/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

module.exports = {
singleQuote: true,
trailingComma: 'all',
Expand Down
48 changes: 17 additions & 31 deletions dinky-web/README.md
Original file line number Diff line number Diff line change
@@ -1,57 +1,43 @@
# Ant Design Pro
# Dinky-web

This project is initialized with [Ant Design Pro](https://pro.ant.design). Follow is the quick guide for how to use.
This project uses [Ant Design Pro](https://pro.ant.design) for initialization. Here's a quick guide on how to use it.

## Environment Prepare
[![CN doc](https://img.shields.io/badge/文档-中文版-blue.svg)](README_zh_CN.md)
[![EN doc](https://img.shields.io/badge/document-English-blue.svg)](README.md)

Install `node_modules`:

```bash
npm install
```
## Environment preparation

or

```bash
yarn
```
| Environment | Version | Remarks |
| ----------- | -------- | ------- |
| node | 14.19.0+ | |
| npm | 7.19.0+ | |

## Provided Scripts
> Configure related environment variables by yourself
Ant Design Pro provides some useful script to help you quick start and build with web project, code style check and test.

Scripts provided in `package.json`. It's safe to modify or add additional script:

### Start project
## StartUp

```bash
npm start
# Note: You need to enter the directory of this module to execute

npm i --force && npm start
```

### Build project
### Build

```bash
npm run build
```

### Check code style
### Code Style Check

```bash
npm run lint
```

You can also use script to auto fix some lint error:
You can also automatically fix some lint errors with a script:

```bash
npm run lint:fix
```

### Test code

```bash
npm test
```

## More

You can view full document on our [official website](https://pro.ant.design). And welcome any feedback in our [github](https://github.com/ant-design/ant-design-pro).
38 changes: 38 additions & 0 deletions dinky-web/README_zh_CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Dinky-web

本项目使用 [Ant Design Pro](https://pro.ant.design) 进行初始化。 以下是如何使用的快速指南。

## 环境准备


| 环境 | 版本 | 备注 |
| ---- | -------- | ---- |
| node | 14.19.0+ | |
| npm | 7.19.0+ | |

> 自行配置相关环境变量
## 启动

```bash
# 注意: 需要进入到此模块目录下执行

npm i --force && npm start
```

### 构建

```bash
npm run build
```

### 代码样式检查

```bash
npm run lint
```

您还可以使用脚本自动修复一些 lint 错误:
```bash
npm run lint:fix
```
23 changes: 20 additions & 3 deletions dinky-web/config/config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

// https://umijs.org/config/
import { defineConfig } from '@umijs/max';
import { join } from 'path';
import {defineConfig} from '@umijs/max';
import {join} from 'path';
import defaultSettings from './defaultSettings';
import proxy from './proxy';
import routes from './routes';
Expand Down Expand Up @@ -76,7 +93,7 @@ export default defineConfig({
* @name layout 插件
* @doc https://umijs.org/docs/max/layout-menu
*/
title: 'Ant Design Pro',
title: 'Dinky',
layout: {
locale: true,
...defaultSettings,
Expand Down
92 changes: 89 additions & 3 deletions dinky-web/config/defaultSettings.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
import { ProLayoutProps } from '@ant-design/pro-components';
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import {ProLayoutProps} from '@ant-design/pro-components';

/**
* @name
Expand All @@ -15,11 +32,80 @@ const Settings: ProLayoutProps & {
fixedHeader: false,
fixSiderbar: true,
colorWeak: false,
title: 'Ant Design Pro',
title: 'Dinky Real-time Platform ',
pwa: true,
logo: 'https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg',
logo: '/dinky.svg',
iconfontUrl: '',
splitMenus: true,
menu: {
locale: true
},
token: {
// bgLayout: '', layout 的背景颜色

// 官方 https://procomponents.ant.design/components/layout/#layout-classicmode
header: {
colorBgHeader: '#292f33',
colorHeaderTitle: '#fff',
colorTextMenu: '#dfdfdf',
colorTextMenuSecondary: '#dfdfdf',
colorTextMenuSelected: '#fff',
colorBgMenuItemSelected: '#22272b',
colorTextMenuActive: 'rgba(255,255,255,0.85)',
colorTextRightActionsItem: '#dfdfdf',
},
colorTextAppListIconHover: '#fff',
colorTextAppListIcon: '#dfdfdf',
sider: {
colorMenuBackground: '#fff',
colorMenuItemDivider: '#dfdfdf',
colorBgMenuItemHover: '#f6f6f6',
colorTextMenu: '#595959',
colorTextMenuSelected: '#242424',
colorTextMenuActive: '#242424',
colorBgMenuItemCollapsedHover: '#242424',
},
// 自定义
// header: {
// colorBgHeader: '#292f33', //header 背景色
// colorHeaderTitle: '#fff', //header 的 title 颜色
// // colorBgMenuItemHover: '', // 悬浮某项时的菜单背景色
// colorBgMenuItemSelected: '#1890ff', // 选中某项时的菜单背景色
// colorTextMenuSelected: '#fff', // 选中某项时的字体颜色
// // colorTextMenuActive: 'rgba(239,7,7,0.85)', // 悬浮选中某项时的字体颜色
// colorTextMenu: '#dfdfdf', // 字体颜色
// colorTextMenuSecondary: '#ffffff', // 二级菜单字体颜色
// // colorBgRightActionsItemHover:'',
// colorTextRightActionsItem: '#e10a0a',
// // heightLayoutHeader: 0
// },
// colorTextAppListIconHover: 'rgba(93,161,192,0.75)',
// colorTextAppListIcon: 'rgba(24,255,182,0.75)',
// // 侧边side的 token 配置
// sider: {
// // colorBgCollapsedButton: '#4c7cd5', // 折叠按钮背景色
// // colorTextCollapsedButtonHover: '', // 折叠按钮文本悬浮背景色
// // colorTextCollapsedButton: '', // 折叠按钮文本颜色
// colorMenuBackground: '#dfdfdf', // 侧边栏菜单整体背景色
// colorBgMenuItemCollapsedHover: '#8f8a8a',
// // colorBgMenuItemCollapsedSelected: '#6dce11',// 侧边栏收起时 二级菜单弹出时选中的背景色
// // colorBgMenuItemCollapsedElevated: '#800b26',// 侧边栏收起时 二级菜单弹出时的背景色
// colorMenuItemDivider: '#d74814',
// colorBgMenuItemHover: '#cb5252',
// colorBgMenuItemSelected: 'rgba(93,161,192,0.75)',
// colorTextMenuSelected: '#242424', // 选中菜单的字体颜色
// colorTextMenuItemHover: '#1890ff', // 悬浮菜单时的字体颜色
// colorTextMenuActive: '#d809ef', // 含有二级菜单的 菜单悬浮时的字体颜色
// // colorTextMenu: '#ab0e0e', // 侧边栏菜单字体颜色
// // colorTextMenuSecondary: '#ab0e0e', // 二级菜单字体颜色
// paddingInlineLayoutMenu: 0, // padding 内联布局菜单 间距
// paddingBlockLayoutMenu: 0, // padding 块布局菜单 间距
// /**
// * menu 顶部 title 的字体颜色
// */
// // colorTextMenuTitle: '#67081e',
// // colorTextSubMenuSelected: '#346dc0',
// },
// 参见ts声明,demo 见文档,通过token 修改样式
//https://procomponents.ant.design/components/layout#%E9%80%9A%E8%BF%87-token-%E4%BF%AE%E6%94%B9%E6%A0%B7%E5%BC%8F
},
Expand Down
2 changes: 1 addition & 1 deletion dinky-web/config/oneapi.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"openapi": "3.0.1",
"info": {
"title": "Ant Design Pro",
"title": "Dinky",
"version": "1.0.0"
},
"servers": [
Expand Down
17 changes: 17 additions & 0 deletions dinky-web/config/proxy.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/**
* @name 代理的配置
* @see 在生产环境 代理是无法生效的,所以这里没有生产环境的配置
Expand Down
Loading

0 comments on commit 105baae

Please sign in to comment.