├── public ├── favicon.ico └── index.html ├── babel.config.js ├── src ├── components │ ├── content.vue │ ├── HelloWorld.vue │ ├── navbar.vue │ └── home.vue ├── router │ └── router.js ├── App.vue ├── assets │ └── css │ │ └── h7_web.css └── main.js ├── .gitignore ├── README.md ├── vue.config.js ├── package.json └── docs └── api.md /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WKJay/ART-Pi-WEB/HEAD/public/favicon.ico -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/cli-plugin-babel/preset' 4 | ] 5 | } -------------------------------------------------------------------------------- /src/components/content.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | /webnet 5 | 6 | # local env files 7 | .env.local 8 | .env.*.local 9 | 10 | # Log files 11 | npm-debug.log* 12 | yarn-debug.log* 13 | yarn-error.log* 14 | pnpm-debug.log* 15 | 16 | # Editor directories and files 17 | .idea 18 | .vscode 19 | *.suo 20 | *.ntvs* 21 | *.njsproj 22 | *.sln 23 | *.sw? 24 | -------------------------------------------------------------------------------- /src/router/router.js: -------------------------------------------------------------------------------- 1 | import {createRouter,createWebHashHistory} from 'vue-router'; 2 | 3 | import homePage from '@/components/home' 4 | 5 | const routes = [ 6 | {path: "",redirect: "/home"}, 7 | {path: "/home",component: homePage} 8 | ] 9 | 10 | const router =createRouter({ 11 | history:createWebHashHistory(), 12 | routes 13 | }); 14 | 15 | export default router; -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # h7-web 2 | 3 | ## Project setup 4 | ``` 5 | yarn install 6 | ``` 7 | 8 | ### Compiles and hot-reloads for development 9 | ``` 10 | yarn serve 11 | ``` 12 | 13 | ### Compiles and minifies for production 14 | ``` 15 | yarn build 16 | ``` 17 | 18 | ### Lints and fixes files 19 | ``` 20 | yarn lint 21 | ``` 22 | 23 | ### Customize configuration 24 | See [Configuration Reference](https://cli.vuejs.org/config/). 25 | -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 6 | 21 | 22 | -------------------------------------------------------------------------------- /src/components/HelloWorld.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 15 | 16 | 17 | 33 | -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | <%= htmlWebpackPlugin.options.title %> 9 | 10 | 11 | 14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /vue.config.js: -------------------------------------------------------------------------------- 1 | const CompressionWebpackPlugin = require('compression-webpack-plugin') 2 | module.exports = { 3 | //publicPath: "http://download.rt-thread.org/webnet/art-pi/factory/", 4 | configureWebpack: { 5 | devtool: 'source-map', 6 | plugins: [ 7 | new CompressionWebpackPlugin({ 8 | // 正在匹配需要压缩的文件后缀 9 | test: /\.(js|css|svg|woff|ttf|json|html)$/, 10 | // 大于10kb的会压缩 11 | threshold: 2048, 12 | // 其余配置查看compression-webpack-plugin 13 | }) 14 | ] 15 | }, 16 | // 配置less 17 | css: { 18 | loaderOptions: { 19 | less: { 20 | javascriptEnabled: true, 21 | } 22 | } 23 | }, 24 | devServer: { 25 | //proxy: "http://192.168.1.101:80" 26 | //proxy: "http://10.2.5.184:80" 27 | proxy: "http://192.168.31.220:80" 28 | } 29 | } -------------------------------------------------------------------------------- /src/assets/css/h7_web.css: -------------------------------------------------------------------------------- 1 | /* 2 | * H7 WEB CUSTOM CSS 3 | * WKJAY 4 | * 5 | */ 6 | 7 | /* Overwrite antd style */ 8 | .ant-menu-dark, 9 | .ant-menu-dark .ant-menu-sub { 10 | background-color: #343a40; 11 | box-shadow: 0 0.25rem 0.25rem rgba(0, 0, 0, .25); 12 | } 13 | 14 | .ant-card { 15 | box-shadow: 0 1px 1px 0 rgba(60, 75, 100, .14), 0 2px 1px -1px rgba(60, 75, 100, .12), 0 1px 3px 0 rgba(60, 75, 100, .2); 16 | } 17 | 18 | .ant-btn{ 19 | margin-bottom: 5px; 20 | } 21 | 22 | /* Overwrite antd css */ 23 | 24 | 25 | 26 | /* H7 style */ 27 | .h7-container { 28 | margin-left: 2%; 29 | margin-right: 2%; 30 | margin-top: 20px; 31 | } 32 | 33 | .h7-head-card { 34 | height: 170px; 35 | margin: auto; 36 | margin-bottom: 15px; 37 | } 38 | 39 | .h7-head-card>.ant-card-body>p>span { 40 | float: right; 41 | color: green; 42 | } 43 | 44 | .h7-head-card-mini { 45 | margin: auto; 46 | margin-bottom: 15px; 47 | } 48 | 49 | 50 | 51 | /* H7 style */ -------------------------------------------------------------------------------- /src/components/navbar.vue: -------------------------------------------------------------------------------- 1 | 28 | 47 | 48 | 51 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "art-pi", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build", 8 | "lint": "vue-cli-service lint" 9 | }, 10 | "dependencies": { 11 | "ant-design-vue": "^2.0.0-beta.3", 12 | "axios": "^0.20.0", 13 | "babel-plugin-import": "^1.13.0", 14 | "compression-webpack-plugin": "^5.0.2", 15 | "core-js": "^3.6.5", 16 | "echarts": "^4.9.0", 17 | "less": "^3.12.2", 18 | "less-loader": "5.0.0", 19 | "schema-utils": "^2.7.0", 20 | "vue": "^3.0.0-0", 21 | "vue-router": "^4.0.0-beta.7" 22 | }, 23 | "devDependencies": { 24 | "@vue/cli-plugin-babel": "~4.5.0", 25 | "@vue/cli-plugin-eslint": "~4.5.0", 26 | "@vue/cli-service": "~4.5.0", 27 | "@vue/compiler-sfc": "^3.0.0-0", 28 | "babel-eslint": "^10.1.0", 29 | "eslint": "^6.7.2", 30 | "eslint-plugin-vue": "^7.0.0-0" 31 | }, 32 | "eslintConfig": { 33 | "root": true, 34 | "env": { 35 | "node": true 36 | }, 37 | "extends": [ 38 | "plugin:vue/vue3-essential", 39 | "eslint:recommended" 40 | ], 41 | "parserOptions": { 42 | "parser": "babel-eslint" 43 | }, 44 | "rules": {} 45 | }, 46 | "browserslist": [ 47 | "> 1%", 48 | "last 2 versions", 49 | "not dead" 50 | ] 51 | } 52 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | import { 2 | createApp 3 | } from 'vue'; 4 | import App from './App.vue'; 5 | import router from '@/router/router' 6 | import { 7 | Button, 8 | Menu, 9 | Col, 10 | Row, 11 | Layout, 12 | Card, 13 | Table, 14 | Tag, 15 | Progress, 16 | Descriptions 17 | // Carousel 18 | } from 'ant-design-vue'; 19 | import 'ant-design-vue/lib/button/style'; 20 | import 'ant-design-vue/lib/menu/style'; 21 | import 'ant-design-vue/lib/col/style'; 22 | import 'ant-design-vue/lib/layout/style'; 23 | import 'ant-design-vue/lib/card/style'; 24 | import 'ant-design-vue/lib/row/style'; 25 | import 'ant-design-vue/lib/table/style'; 26 | import 'ant-design-vue/lib/tag/style'; 27 | import 'ant-design-vue/lib/progress/style'; 28 | import 'ant-design-vue/lib/descriptions/style'; 29 | // import 'ant-design-vue/lib/carousel/style'; 30 | 31 | import '@/assets/css/h7_web.css' 32 | 33 | const WEB_VERSION = "V0.1.0" 34 | const app = createApp(App); 35 | app.use(router); 36 | 37 | app.use(Button); 38 | app.use(Menu); 39 | app.use(Col); 40 | app.use(Row); 41 | app.use(Layout); 42 | app.use(Card); 43 | app.use(Table); 44 | app.use(Tag); 45 | app.use(Progress); 46 | app.use(Descriptions); 47 | // app.use(Carousel); 48 | 49 | app.config.globalProperties.axios = require('axios').default; 50 | app.config.globalProperties.echarts = require('echarts'); 51 | app.config.globalProperties.webVer = WEB_VERSION; 52 | 53 | app.mount('#app'); -------------------------------------------------------------------------------- /docs/api.md: -------------------------------------------------------------------------------- 1 | ## H7 WEB API 2 | 3 | _V0.1 by WKJay_ 4 | 5 | -------------------- 6 | 7 | #### 1. Basic information 8 | 9 | request_url: `/cgi-bin/basic_info` 10 | 11 | response: 12 | 13 | ```json 14 | //success 15 | { 16 | code:0 17 | payload:{ 18 | "id0":"xxx", 19 | "id1":"xxx" 20 | } 21 | } 22 | //fail 23 | { 24 | code:-1, 25 | msg:"xxxx" 26 | } 27 | ``` 28 | 29 | note: all values return as a string. 30 | 31 | #### 2. Board Control 32 | 33 | request url: `/cgi-bin/board_control` 34 | 35 | ```json 36 | //request 37 | { 38 | id:"xxx" 39 | code:0 40 | } 41 | ``` 42 | 43 | | id | describe | 44 | | ---- | -------- | 45 | | dev0 | Blue LED | 46 | | dev1 | Red LED | 47 | | dev2 | BEEP | 48 | 49 | | code | describe | 50 | | ---- | ------------ | 51 | | 0 | Turn off | 52 | | 1 | Turn on | 53 | | x | not used now | 54 | 55 | response: 56 | 57 | ```json 58 | //success 59 | { 60 | code:0 61 | msg:"ok" 62 | } 63 | //fail 64 | { 65 | code:-1, 66 | msg:"xxxx" 67 | } 68 | ``` 69 | 70 | #### 3. Current active mods 71 | 72 | request url: `/cgi-bin/current_mods` 73 | response: 74 | 75 | ```json 76 | //success 77 | { 78 | code:0 79 | mods:[ 80 | { 81 | name:"xxx", 82 | author:"xxx", 83 | version:"xxx" 84 | }, 85 | { 86 | name:"xxx", 87 | author:"xxx", 88 | version:"xxx" 89 | } 90 | ] 91 | } 92 | //fail 93 | { 94 | code:-1, 95 | msg:"xxxx" 96 | } 97 | ``` -------------------------------------------------------------------------------- /src/components/home.vue: -------------------------------------------------------------------------------- 1 | 204 | 205 | 546 | 547 | --------------------------------------------------------------------------------