Skip to content

Commit b804e61

Browse files
committed
Update dashboard
1 parent 0fcebda commit b804e61

3 files changed

Lines changed: 75 additions & 3 deletions

File tree

src/pages/Dashboard/Home.js

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
import React, { PureComponent } from 'react';
22
import { connect } from 'dva';
33
import moment from 'moment';
4+
import { Typography, Card, Alert } from 'antd';
45
import PageHeaderLayout from '../../layouts/PageHeaderLayout';
56
import styles from './Home.less';
67

8+
const CodePreview = ({ children }) => (
9+
<pre className={styles.pre}>
10+
<code>
11+
<Typography.Text copyable>{children}</Typography.Text>
12+
</code>
13+
</pre>
14+
);
15+
716
@connect(state => ({
817
global: state.global,
918
}))
@@ -58,7 +67,61 @@ class Home extends PureComponent {
5867
content={this.getHeaderContent()}
5968
action={<span>当前时间:{currentTime}</span>}
6069
>
61-
<div className={styles.index} />
70+
<Card>
71+
<Alert
72+
message="gin-admin 5.2.1 现已发布,欢迎使用 gin-admin-cli 启动体验。"
73+
type="success"
74+
showIcon
75+
banner
76+
style={{
77+
margin: -12,
78+
marginBottom: 24,
79+
}}
80+
/>
81+
<Typography.Text strong>
82+
<a
83+
target="_blank"
84+
rel="noopener noreferrer"
85+
href="https://github.com/LyricTian/gin-admin-cli"
86+
>
87+
1. 基于 gin-admin-cli 构建
88+
</a>
89+
</Typography.Text>
90+
<CodePreview>go get -v github.com/LyricTian/gin-admin-cli</CodePreview>
91+
<CodePreview>gin-admin-cli new -m -d ~/go/src/gin-admin -p gin-admin</CodePreview>
92+
<Typography.Text strong>
93+
<a
94+
target="_blank"
95+
rel="noopener noreferrer"
96+
href="https://github.com/LyricTian/gin-admin"
97+
>
98+
2. 启动服务
99+
</a>
100+
</Typography.Text>
101+
<CodePreview>cd ~/go/src/gin-admin</CodePreview>
102+
<CodePreview>
103+
go run cmd/server/main.go -c ./configs/config.toml -m ./configs/model.conf -swagger
104+
./docs/swagger -menu ./configs/menu.json
105+
</CodePreview>
106+
<Typography.Text
107+
strong
108+
style={{
109+
marginBottom: 12,
110+
}}
111+
>
112+
<a
113+
target="_blank"
114+
rel="noopener noreferrer"
115+
href="https://github.com/LyricTian/gin-admin-react"
116+
>
117+
3. 获取并运行 gin-admin-react
118+
</a>
119+
</Typography.Text>
120+
<CodePreview>git clone https://github.com/LyricTian/gin-admin-react.git</CodePreview>
121+
<CodePreview>cd gin-admin-react</CodePreview>
122+
<CodePreview>yarn</CodePreview>
123+
<CodePreview>yarn start</CodePreview>
124+
</Card>
62125
</PageHeaderLayout>
63126
);
64127
}

src/pages/Dashboard/Home.less

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
@import '~antd/lib/style/themes/default.less';
2+
3+
.pre {
4+
margin: 12px 0;
5+
padding: 12px 20px;
6+
background: @input-bg;
7+
box-shadow: @card-shadow;
8+
}
9+
110
.index {
211
width: 100%;
312
min-height: 100vh;

src/pages/Menu/MenuCard.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ class MenuCard extends PureComponent {
176176
</Row>
177177
<Row>
178178
<Col span={24}>
179-
<Card title="菜单动作管理" bordered={false}>
179+
<Card title="动作管理" bordered={false}>
180180
{getFieldDecorator('actions', {
181181
initialValue: formData.actions,
182182
})(<MenuAction />)}
@@ -185,7 +185,7 @@ class MenuCard extends PureComponent {
185185
</Row>
186186
<Row>
187187
<Col span={24}>
188-
<Card title="菜单资源管理" bordered={false}>
188+
<Card title="资源管理(服务端路由)" bordered={false}>
189189
{getFieldDecorator('resources', {
190190
initialValue: formData.resources,
191191
})(<MenuResource />)}

0 commit comments

Comments
 (0)