Skip to content

Commit 792be5a

Browse files
committed
feat: doc index
1 parent e36ad5a commit 792be5a

File tree

4 files changed

+220
-109
lines changed

4 files changed

+220
-109
lines changed

i18n/zh-cn/code.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
2-
"Dgiot helps developers quickly connect subsystems to achieve data aggregation with a few lines of code, and can also achieve common device access with zero code": {
3-
"message": "DGIOT帮助开发者用简单的几行代码可以快速对接子系统实现数据汇聚,也可以零代码实现常见设备接入"
2+
"dgiot.help": {
3+
"message": "DGIOT帮助开发者用简单的几行代码可以快速对接子系统实现数据汇聚,也可以零代码实现常见设备接入",
4+
"description": "Dgiot helps developers quickly connect subsystems to achieve data aggregation with a few lines of code, and can also achieve common device access with zero code"
45
},
56
"theme.ErrorPageContent.title": {
67
"message": "This page crashed.",
Lines changed: 123 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
import React from 'react'
22
import styles from './styles.module.css'
3-
import { Col, Row, Card, Button, Divider } from 'antd'
3+
import {
4+
Col,
5+
Row,
6+
Card,
7+
Button,
8+
Divider
9+
} from 'antd'
410
import useDocusaurusContext from '@docusaurus/useDocusaurusContext'
511
// 获取路由导航
612
// 1. 打开 https://doc.dgiotcloud.cn/docs/product_doc/docs/deployment_details/index/
@@ -25,94 +31,125 @@ import useDocusaurusContext from '@docusaurus/useDocusaurusContext'
2531
// 3. 拷贝节点数据
2632
// window.copy(JSON.stringify(nav))
2733
function HomepageHeader() {
28-
// 下面打印函数可以拿到打印的path路径。但是无法拿到title,因为title是在组件中定义的。
29-
// console.log(useDocusaurusContext().globalData['docusaurus-plugin-content-docs'].default.versions[0].docs)
30-
// todo: 需要写link地址
31-
const nav = [
32-
{
33-
text: '用户手册',
34-
children: [
35-
{ text: '设备运维',href:"/docs/user_manual/docs/equipment_operational/equipment_leasing" },
36-
{ text: '智慧园区' },
37-
{ text: '数字工厂' },
38-
{ text: '云检测' },
39-
{ text: '云压测' },
40-
],
41-
},
42-
{
43-
text: '产品文档',
44-
children: [
45-
{ text: '部署详情' },
46-
{ text: '简介' },
47-
{ text: '设备云' },
48-
{ text: '多租户' },
49-
{ text: '云运维' },
50-
{ text: '云函数' },
51-
{ text: '云系统' },
52-
{ text: '云检测' },
53-
{ text: '云日志' },
54-
],
55-
},
56-
{
57-
text: '开发指南',
58-
children: [
59-
{ text: '系统架构' },
60-
{ text: '后端技术' },
61-
{ text: '数据标识' },
62-
{ text: '前端技术' },
63-
{ text: '时序数据' },
64-
],
65-
},
66-
{
67-
text: '实战教程',
68-
children: [
69-
{ text: '基础知识' },
70-
{ text: '电表接入' },
71-
{ text: '视频教程' },
72-
{ text: 'PT100传感器接入教程' },
73-
{ text: '电力集抄教程' },
74-
{ text: 'DDZY1296电表接入教程' },
75-
{ text: '三合一传感器接入教程' },
76-
{ text: 'Mqtt设备接入教程' },
77-
{ text: '水泵性能曲线测量案例' },
78-
{ text: 'OPC-DA设备接入教程' },
79-
{ text: '摄像头接入' },
80-
{ text: '测试' },
81-
],
82-
},
83-
]
84-
// 维护时,只需维护该nav的数据
85-
return nav.map((item, index) => (
86-
<Card
87-
style={{ marginBottom: '20px' }}
88-
hoverable={true}
89-
key={index}
90-
xs={12}
91-
sm={6}
92-
>
93-
{/*todo:循环中需要写src地址跳转*/}
94-
<Row>
95-
<Col span={2}>
96-
<Button type="primary">{item.text}</Button>
97-
</Col>
98-
<Col span={20} offset={1} style={{ borderLeft: '1px solid #666' }}>
99-
{/*循环item.children*/}
100-
{item.children.map((i, index) => (
101-
<Button type="link" href={i.href} key={index}>
102-
{i.text}
103-
</Button>
104-
))}
105-
</Col>
106-
</Row>
107-
</Card>
108-
))
34+
// 下面打印函数可以拿到打印的path路径。但是无法拿到title,因为title是在组件中定义的。
35+
// console.log(useDocusaurusContext().globalData['docusaurus-plugin-content-docs'].default.versions[0].docs)
36+
// todo: 需要写link地址
37+
const nav = [{
38+
children: [
39+
{
40+
"text": "设备运维",
41+
"content": "工业设备租赁一体化运维平台以数据为基础、以算法为支撑、以场景为导向,应用先进的实时大数据处理。",
42+
"cover": "http://dgiot-1253666439.cos.ap-shanghai-fsi.myqcloud.com/dgiot_web/Community.png",
43+
"href": "/docs/user_manual/docs/equipment_operational/equipment_leasing"
44+
},
45+
{
46+
"text": "智慧园区",
47+
"cover": "http://dgiot-1253666439.cos.ap-shanghai-fsi.myqcloud.com/dgiot_web/Community.png",
48+
"href": "/docs/user_manual/docs/equipment_operational/equipment_leasing"
49+
},
50+
{
51+
"text": "数字工厂",
52+
"cover": "http://dgiot-1253666439.cos.ap-shanghai-fsi.myqcloud.com/dgiot_web/Community.png",
53+
"href": "/docs/user_manual/docs/equipment_operational/equipment_leasing"
54+
},
55+
{
56+
"text": "云检测",
57+
"cover": "http://dgiot-1253666439.cos.ap-shanghai-fsi.myqcloud.com/dgiot_web/Community.png",
58+
"href": "/docs/user_manual/docs/equipment_operational/equipment_leasing"
59+
},
60+
{
61+
"text": "设备运维",
62+
"content": "工业设备租赁一体化运维平台以数据为基础、以算法为支撑、以场景为导向,应用先进的实时大数据处理。",
63+
"cover": "http://dgiot-1253666439.cos.ap-shanghai-fsi.myqcloud.com/dgiot_web/Community.png",
64+
"href": "/docs/user_manual/docs/equipment_operational/equipment_leasing"
65+
},
66+
{
67+
"text": "智慧园区",
68+
"cover": "http://dgiot-1253666439.cos.ap-shanghai-fsi.myqcloud.com/dgiot_web/Community.png",
69+
"href": "/docs/user_manual/docs/equipment_operational/equipment_leasing"
70+
},
71+
{
72+
"text": "数字工厂",
73+
"cover": "http://dgiot-1253666439.cos.ap-shanghai-fsi.myqcloud.com/dgiot_web/Community.png",
74+
"href": "/docs/user_manual/docs/equipment_operational/equipment_leasing"
75+
},
76+
{
77+
"text": "云检测",
78+
"cover": "http://dgiot-1253666439.cos.ap-shanghai-fsi.myqcloud.com/dgiot_web/Community.png",
79+
"href": "/docs/user_manual/docs/equipment_operational/equipment_leasing"
80+
},
81+
{
82+
"text": "设备运维",
83+
"content": "工业设备租赁一体化运维平台以数据为基础、以算法为支撑、以场景为导向,应用先进的实时大数据处理。",
84+
"cover": "http://dgiot-1253666439.cos.ap-shanghai-fsi.myqcloud.com/dgiot_web/Community.png",
85+
"href": "/docs/user_manual/docs/equipment_operational/equipment_leasing"
86+
},
87+
{
88+
"text": "智慧园区",
89+
"cover": "http://dgiot-1253666439.cos.ap-shanghai-fsi.myqcloud.com/dgiot_web/Community.png",
90+
"href": "/docs/user_manual/docs/equipment_operational/equipment_leasing"
91+
},
92+
{
93+
"text": "数字工厂",
94+
"cover": "http://dgiot-1253666439.cos.ap-shanghai-fsi.myqcloud.com/dgiot_web/Community.png",
95+
"href": "/docs/user_manual/docs/equipment_operational/equipment_leasing"
96+
},
97+
{
98+
"text": "云检测",
99+
"cover": "http://dgiot-1253666439.cos.ap-shanghai-fsi.myqcloud.com/dgiot_web/Community.png",
100+
"href": "/docs/user_manual/docs/equipment_operational/equipment_leasing"
101+
},
102+
{
103+
"text": "设备运维",
104+
"content": "工业设备租赁一体化运维平台以数据为基础、以算法为支撑、以场景为导向,应用先进的实时大数据处理。",
105+
"cover": "http://dgiot-1253666439.cos.ap-shanghai-fsi.myqcloud.com/dgiot_web/Community.png",
106+
"href": "/docs/user_manual/docs/equipment_operational/equipment_leasing"
107+
},
108+
{
109+
"text": "智慧园区",
110+
"cover": "http://dgiot-1253666439.cos.ap-shanghai-fsi.myqcloud.com/dgiot_web/Community.png",
111+
"href": "/docs/user_manual/docs/equipment_operational/equipment_leasing"
112+
},
113+
{
114+
"text": "数字工厂",
115+
"cover": "http://dgiot-1253666439.cos.ap-shanghai-fsi.myqcloud.com/dgiot_web/Community.png",
116+
"href": "/docs/user_manual/docs/equipment_operational/equipment_leasing"
117+
},
118+
{
119+
"text": "云检测",
120+
"cover": "http://dgiot-1253666439.cos.ap-shanghai-fsi.myqcloud.com/dgiot_web/Community.png",
121+
"href": "/docs/user_manual/docs/equipment_operational/equipment_leasing"
122+
}
123+
]
124+
}
125+
126+
]
127+
// 维护时,只需维护该nav的数据
128+
return nav.map((item, index) => (
129+
<div style={{ display: "flex", flexWrap: "wrap" }}>
130+
{item.children.map((i, index) => (
131+
<Col key= {{index}} span={5} offset={1} style={{ border: '0px solid #666' }}>
132+
<a href={i.href} >
133+
<Card
134+
hoverable={true}
135+
key={index}
136+
style={{border: '0px solid #666', margin: '0px 0px 10px 0px'}}
137+
>
138+
<img alt="cover" href={i.href} src={i.cover} style={{height: '80%',width: '80%',objectFit: 'cover'}} />
139+
</Card>
140+
</a>
141+
</Col>
142+
))}
143+
</div>
144+
))
109145
}
146+
110147
export default function HomepageFeatures() {
111-
return (
112-
<section className={styles.features}>
148+
return (
149+
<section className={styles.features}>
113150
<div className="container">
114151
<HomepageHeader />
115152
</div>
116153
</section>
117-
)
118-
}
154+
)
155+
}

src/pages/index.js

Lines changed: 35 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,46 @@ import Layout from "@theme/Layout";
44
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
55
import styles from "./index.module.css";
66
import HomepageFeatures from "@site/src/components/HomepageFeatures";
7-
import Translate, {translate} from '@docusaurus/Translate';
7+
import Translate, {
8+
translate
9+
} from '@docusaurus/Translate';
810

911
function HomepageHeader() {
10-
const {siteConfig} = useDocusaurusContext();
11-
return (
12-
<header className={clsx("hero hero--primary", styles.heroBanner)}>
13-
<div className="container">
14-
<h1 className="hero__title">{siteConfig.title}</h1>
15-
<span className="indexCtasGitHubButtonWrapper_AOht">
16-
<img src="https://gitee.com/dgiiot/dgiot/badge/star.svg?theme=gvp" alt="gvp"/>
17-
</span>
18-
<p></p>
19-
<p className="hero__subtitle">
20-
<Translate>Dgiot helps developers quickly connect subsystems to achieve data aggregation with a few
21-
lines of code, and can also achieve common device access with zero code</Translate>
22-
</p>
12+
const {
13+
siteConfig
14+
} = useDocusaurusContext();
15+
return (
16+
<header className={styles.heroBanner,styles.hero}>
17+
<div className={styles.container}>
18+
<img src="https://dgiot-1253666439.cos.ap-shanghai-fsi.myqcloud.com/atom/djs.png"/>
19+
</div>
20+
21+
<div className={styles.container1}>
22+
<h1 className={styles.hero1}>DGIOT</h1>
23+
<h1 className={styles.hero2}>让万物互联变得更简单</h1>
24+
<span className="indexCtasGitHubButtonWrapper_AOht">
25+
<img src="https://gitee.com/dgiiot/dgiot/badge/star.svg?theme=gvp" alt="gvp"/>
26+
</span>
27+
<p></p>
28+
<p className="hero__subtitle">
29+
<a href="https://doc.dgiotcloud.cn/docs/product_doc/docs/deployment_details/">
30+
<button className={styles.buttons1}>进入文档 →</button>
31+
</a>
32+
<a href="https://prod.dgiotcloud.cn/#/login">
33+
<button className={styles.buttons2}>进入控制台</button>
34+
</a>
35+
</p>
2336
</div>
2437
</header>
25-
);
38+
);
2639
}
2740

2841
export default function Home() {
29-
const {siteConfig} = useDocusaurusContext();
30-
return (
31-
<Layout
42+
const {
43+
siteConfig
44+
} = useDocusaurusContext();
45+
return (
46+
<Layout
3247
title={`${siteConfig.title}`}
3348
description="DGIOT让万物互联变得更简单 <head />"
3449
>
@@ -37,6 +52,5 @@ export default function Home() {
3752
<HomepageFeatures/>
3853
</main>
3954
</Layout>
40-
);
41-
}
42-
55+
);
56+
}

src/pages/index.module.css

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,62 @@
2121
align-items: center;
2222
justify-content: center;
2323
}
24+
25+
.buttons1 {
26+
background-color: #1e88e5;
27+
color: #fff;
28+
display: inline-block;
29+
overflow: hidden;
30+
margin: 0.6rem 0.8rem;
31+
padding: 0.75rem 1.5rem;
32+
border: 2px solid #1e88e5;
33+
border-radius: 0.5rem;
34+
font-size: 1.2rem;
35+
}
36+
37+
.buttons2 {
38+
display: inline-block;
39+
overflow: hidden;
40+
margin: 0.6rem 0.8rem;
41+
padding: 0.75rem 1.5rem;
42+
border: 2px solid #1e88e5;
43+
border-radius: 0.5rem;
44+
color: #1e88e5;
45+
font-size: 1.2rem;
46+
}
47+
48+
.imgs {
49+
width:70%;
50+
height:100%
51+
}
52+
53+
.container {
54+
margin: 0px 0px 0px 250px;
55+
padding: 0 ;
56+
width: 100%;
57+
}
58+
59+
.container1 {
60+
margin: 0px 250px 0px 0px;
61+
padding: 0 ;
62+
width: 100%;
63+
}
64+
65+
.hero {
66+
align-items: center;
67+
background-color: #2743cd;
68+
color: #fff;
69+
display: flex;
70+
padding: 4rem 10rem;
71+
text-align: center;
72+
position: relative;
73+
overflow: hidden;
74+
}
75+
76+
.hero1 {
77+
font-size: 3rem;
78+
color: #fff
79+
}
80+
.hero2 {
81+
color: #fff
82+
}

0 commit comments

Comments
 (0)