initial commit vuejs app for editing device settings

pull/1/head
Thomas Ballmann 4 years ago
parent f34f803acc
commit 4ff72d2120

1
.gitignore vendored

@ -4,3 +4,4 @@
.vscode/launch.json
.vscode/ipch
.DS_Store
/data/dist

@ -4,6 +4,7 @@
"fstream": "cpp",
"istream": "cpp",
"ostream": "cpp",
"sstream": "cpp"
"sstream": "cpp",
"functional": "cpp"
}
}

@ -0,0 +1,15 @@
# paperdash-display
## compile and upload new firmware
```properties
platformio run --target upload
```
## app development
```properties
# build new dist files
yarn --cwd app build
# upload to device filesystem
platformio run --target uploadfs
```

21
app/.gitignore vendored

@ -0,0 +1,21 @@
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

@ -0,0 +1,24 @@
# pwa
## Project setup
```
yarn install
```
### Compiles and hot-reloads for development
```
yarn serve
```
### Compiles and minifies for production
```
yarn build
```
### Lints and fixes files
```
yarn lint
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).

@ -0,0 +1,5 @@
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}

@ -0,0 +1,46 @@
{
"name": "paperdash-display",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"core-js": "^3.6.4",
"vue": "^2.6.11",
"vuetify": "^2.1.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.2.0",
"@vue/cli-plugin-eslint": "~4.2.0",
"@vue/cli-service": "~4.2.0",
"babel-eslint": "^10.0.3",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^6.1.2",
"sass": "^1.19.0",
"sass-loader": "^8.0.0",
"vue-cli-plugin-vuetify": "~2.0.4",
"vue-template-compiler": "^2.6.11",
"vuetify-loader": "^1.3.0"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "babel-eslint"
},
"rules": {}
},
"browserslist": [
"> 1%",
"last 2 versions"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css">
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>

@ -0,0 +1,60 @@
<template>
<v-app>
<v-app-bar
app
color="primary"
dark
>
<div class="d-flex align-center">
<v-img
alt="Vuetify Logo"
class="shrink mr-2"
contain
src="https://cdn.vuetifyjs.com/images/logos/vuetify-logo-dark.png"
transition="scale-transition"
width="40"
/>
<v-img
alt="Vuetify Name"
class="shrink mt-1 hidden-sm-and-down"
contain
min-width="100"
src="https://cdn.vuetifyjs.com/images/logos/vuetify-name-dark.png"
width="100"
/>
</div>
<v-spacer></v-spacer>
<v-btn
href="https://github.com/vuetifyjs/vuetify/releases/latest"
target="_blank"
text
>
<span class="mr-2">Latest Release</span>
<v-icon>mdi-open-in-new</v-icon>
</v-btn>
</v-app-bar>
<v-content>
<HelloWorld/>
</v-content>
</v-app>
</template>
<script>
import HelloWorld from './components/HelloWorld';
export default {
name: 'App',
components: {
HelloWorld,
},
data: () => ({
//
}),
};
</script>

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

@ -0,0 +1 @@
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 87.5 100"><defs><style>.cls-1{fill:#1697f6;}.cls-2{fill:#7bc6ff;}.cls-3{fill:#1867c0;}.cls-4{fill:#aeddff;}</style></defs><title>Artboard 46</title><polyline class="cls-1" points="43.75 0 23.31 0 43.75 48.32"/><polygon class="cls-2" points="43.75 62.5 43.75 100 0 14.58 22.92 14.58 43.75 62.5"/><polyline class="cls-3" points="43.75 0 64.19 0 43.75 48.32"/><polygon class="cls-4" points="64.58 14.58 87.5 14.58 43.75 100 43.75 62.5 64.58 14.58"/></svg>

After

Width:  |  Height:  |  Size: 539 B

@ -0,0 +1,32 @@
<template>
<v-container>
<v-row class="text-center">
<v-col cols="12">
<v-img
:src="require('../assets/logo.png')"
class="my-3"
contain
height="200"
/>
</v-col>
<v-col class="mb-4">
<h1 class="display-2 font-weight-bold mb-3">
paperdash.io Display
</h1>
</v-col>
</v-row>
</v-container>
</template>
<script>
export default {
name: 'HelloWorld',
data: () => ({
ecosystem: [],
importantLinks: [],
whatsNext: [],
}),
}
</script>

@ -0,0 +1,10 @@
import Vue from 'vue'
import App from './App.vue'
import vuetify from './plugins/vuetify';
Vue.config.productionTip = false
new Vue({
vuetify,
render: h => h(App)
}).$mount('#app')

@ -0,0 +1,7 @@
import Vue from 'vue'
import Vuetify from 'vuetify/lib'
Vue.use(Vuetify)
export default new Vuetify({
})

@ -0,0 +1,8 @@
module.exports = {
"outputDir": "/Users/tom/Documents/PlatformIO/Projects/device-esp32/data/dist",
"filenameHashing": false,
"productionSourceMap": false,
"transpileDependencies": [
"vuetify"
]
}

File diff suppressed because it is too large Load Diff

@ -1,32 +0,0 @@
body {
background-color: rgb(226, 226, 226);
}
.dashboard{
text-align: center;
}
.circle-container {
display: inline-block;
margin: 10px;
}
.circle {
border: 5px solid #0074D9;
border-radius: 50%;
display: table-cell;
height: 100px;
vertical-align: middle;
width: 100px;
}
.circle__content{
color: gray;
font-family: Arial, Helvetica, sans-serif;
font-size: 34px;
}
.circle__lower-text{
color: gray;
font-family: Arial, Helvetica, sans-serif;
font-size: 11px;
}

@ -1,36 +0,0 @@
<!DOCTYPE html>
<html lang=en>
<head>
<link rel="stylesheet" type="text/css" href="app.css">
</head>
<body>
<div class="dashboard">
<h1>paperdash.io</h1>
<div class="circle-container">
<div class="circle">
<div class="circle__content">
24ºC
</div>
<div class="circle__lower-text">
Temperature
</div>
</div>
</div>
<div class="circle-container">
<div class="circle">
<div class="circle__content">
22%
</div>
<div class="circle__lower-text">
Humidity
</div>
</div>
</div>
</div>
</body>
</html>

@ -0,0 +1,6 @@
#ifndef APP_H
#define APP_H
void setupApp();
#endif

@ -1,7 +0,0 @@
#ifndef SETUP_H
#define SETUP_H
void setupConfigure();
void loopConfigure();
#endif

@ -1,4 +1,4 @@
#include "configure.h"
#include "app.h"
#include "SPIFFS.h"
#include "ESPAsyncWebServer.h"
@ -8,7 +8,7 @@
AsyncWebServer server(80);
void setupConfigure()
void setupApp()
{
Serial.println("setup configure");
@ -17,23 +17,21 @@ void setupConfigure()
return;
}
server.on("/", HTTP_GET, [](AsyncWebServerRequest *request) {
Serial.println("/");
request->send(SPIFFS, "/index.html", "text/html");
});
server.on("/app.css", HTTP_GET, [](AsyncWebServerRequest *request) {
Serial.println("/app.css");
request->send(SPIFFS, "/app.css", "text/css");
// @see https://github.com/me-no-dev/ESPAsyncWebServer
// DirectoryIndex Directive
server.on("/", HTTP_GET, [](AsyncWebServerRequest *request){
request->send(SPIFFS, "/dist/index.html", "text/html");
});
// serve static files
server
.serveStatic("/", SPIFFS, "/dist/")
.setCacheControl("max-age=600")
;
server.begin();
Serial.println("setup configure - done");
}
void loopConfigure()
{
}

@ -5,7 +5,7 @@
#include "display.h"
#include "settings.h"
#include "cloud.h"
#include "configure.h"
#include "app.h"
void gotoDeepSleep();
@ -32,7 +32,7 @@ void setup()
//setupCloud();
}
setupConfigure();
setupApp();
Serial.println();
Serial.println("setup - done");
@ -48,5 +48,4 @@ void loop()
}
loopDevice();
loopConfigure();
}
Loading…
Cancel
Save