Compare commits
10 Commits
8625bb8ea0
...
b0ee6043fa
| Author | SHA1 | Date | |
|---|---|---|---|
| b0ee6043fa | |||
| a24e491257 | |||
| c922a2beea | |||
| 72c806be24 | |||
| ec953b0ae6 | |||
| ed458b209a | |||
| 0b82819524 | |||
| 027d0fd82e | |||
| c51fc0ea0a | |||
| 61763de397 |
8
.dockerignore
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
node_modules
|
||||||
|
npm-debug.log
|
||||||
|
.git
|
||||||
|
.gitignore
|
||||||
|
.env
|
||||||
|
.DS_Store
|
||||||
|
log
|
||||||
|
*.log
|
||||||
3
.gitignore
vendored
@@ -1 +1,4 @@
|
|||||||
node_modules
|
node_modules
|
||||||
|
.DS_*
|
||||||
|
log
|
||||||
|
.env
|
||||||
|
|||||||
21
.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
// Use IntelliSense to learn about possible attributes.
|
||||||
|
// Hover to view descriptions of existing attributes.
|
||||||
|
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"type": "node",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "Launch Program",
|
||||||
|
"skipFiles": [
|
||||||
|
"<node_internals>/**"
|
||||||
|
],
|
||||||
|
"program": "${workspaceFolder}/bin/www",
|
||||||
|
"env": {
|
||||||
|
"MONGOPORT": "27017",
|
||||||
|
"DEBUG":"spritzschema:server"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM node:20-alpine
|
FROM node:alpine
|
||||||
|
|
||||||
ADD package.json /tmp
|
ADD package.json /tmp
|
||||||
RUN cd /tmp && npm install
|
RUN cd /tmp && npm install
|
||||||
@@ -8,12 +8,7 @@ WORKDIR /opt/app
|
|||||||
ADD . /opt/app
|
ADD . /opt/app
|
||||||
|
|
||||||
RUN apk add --no-cache tzdata
|
RUN apk add --no-cache tzdata
|
||||||
ENV TZ Europe/Berlin
|
ENV TZ=Europe/Berlin
|
||||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||||
|
|
||||||
RUN touch cmds.sh \
|
CMD ["npm", "start"]
|
||||||
&& echo 'npm start' >>cmds.sh
|
|
||||||
|
|
||||||
EXPOSE 3014
|
|
||||||
|
|
||||||
CMD sh ./cmds.sh
|
|
||||||
|
|||||||
22
app.js
@@ -1,13 +1,25 @@
|
|||||||
|
import createError from 'http-errors'
|
||||||
|
import logger from 'morgan'
|
||||||
|
import express from 'express'
|
||||||
|
import cookieParser from 'cookie-parser'
|
||||||
|
import path from 'path'
|
||||||
|
import { fileURLToPath } from 'url';
|
||||||
|
|
||||||
|
/*
|
||||||
var createError = require('http-errors');
|
var createError = require('http-errors');
|
||||||
var express = require('express');
|
var express = require('express');
|
||||||
var path = require('path');
|
var path = require('path');
|
||||||
var cookieParser = require('cookie-parser');
|
var cookieParser = require('cookie-parser');
|
||||||
var logger = require('morgan');
|
var logger = require('morgan');
|
||||||
|
*/
|
||||||
|
|
||||||
var indexRouter = require('./routes/index');
|
import indexRouter from './routes/index.js'
|
||||||
var usersRouter = require('./routes/users');
|
// import usersRouter from './routes/users.js'
|
||||||
|
|
||||||
var app = express();
|
const app = express();
|
||||||
|
|
||||||
|
const __filename = fileURLToPath(import.meta.url);
|
||||||
|
const __dirname = path.dirname(__filename);
|
||||||
|
|
||||||
// view engine setup
|
// view engine setup
|
||||||
app.set('views', path.join(__dirname, 'views'));
|
app.set('views', path.join(__dirname, 'views'));
|
||||||
@@ -21,7 +33,7 @@ app.use(express.static(path.join(__dirname, 'public')));
|
|||||||
|
|
||||||
app.use('/', indexRouter);
|
app.use('/', indexRouter);
|
||||||
app.use('/data', indexRouter);
|
app.use('/data', indexRouter);
|
||||||
app.use('/users', usersRouter);
|
// app.use('/users', usersRouter);
|
||||||
|
|
||||||
// catch 404 and forward to error handler
|
// catch 404 and forward to error handler
|
||||||
app.use(function(req, res, next) {
|
app.use(function(req, res, next) {
|
||||||
@@ -39,4 +51,4 @@ app.use(function(err, req, res, next) {
|
|||||||
res.render('error');
|
res.render('error');
|
||||||
});
|
});
|
||||||
|
|
||||||
module.exports = app;
|
export default app
|
||||||
@@ -4,15 +4,22 @@
|
|||||||
* Module dependencies.
|
* Module dependencies.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import app from '../app.js'
|
||||||
|
import Debug from 'debug'
|
||||||
|
import http from 'http'
|
||||||
|
const debug = Debug('spritzschema:server')
|
||||||
|
|
||||||
|
/*
|
||||||
var app = require('../app');
|
var app = require('../app');
|
||||||
var debug = require('debug')('Spritzschema:server');
|
var debug = require('debug')('Spritzschema:server');
|
||||||
var http = require('http');
|
var http = require('http');
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get port from environment and store in Express.
|
* Get port from environment and store in Express.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var port = normalizePort(process.env.PORT || '3100');
|
var port = normalizePort(process.env.PORT || '3200');
|
||||||
app.set('port', port);
|
app.set('port', port);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -86,5 +93,6 @@ function onListening() {
|
|||||||
var bind = typeof addr === 'string'
|
var bind = typeof addr === 'string'
|
||||||
? 'pipe ' + addr
|
? 'pipe ' + addr
|
||||||
: 'port ' + addr.port;
|
: 'port ' + addr.port;
|
||||||
debug('Listening on ' + bind);
|
//debug('Listening on ' + bind);
|
||||||
|
console.log('Listening on ' + bind);
|
||||||
}
|
}
|
||||||
@@ -15,14 +15,16 @@ services:
|
|||||||
# command: '--auth'
|
# command: '--auth'
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
# spritzschema:
|
spritzschema:
|
||||||
# image: spritzschema
|
build:
|
||||||
# volumes:
|
context: .
|
||||||
# - ${PWD}/log:/var/log
|
dockerfile: Dockerfile_spritzschema
|
||||||
# ports:
|
volumes:
|
||||||
# - '3100:3100'
|
- ${PWD}/log:/var/log
|
||||||
# container_name: spritzschema
|
ports:
|
||||||
# environment:
|
- '3200:3200'
|
||||||
# - MONGOHOST=mongodb
|
container_name: spritzschema
|
||||||
# restart: unless-stopped
|
environment:
|
||||||
#
|
- MONGOHOST=mongodb
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
|
|||||||
30
docker-compose_onlyMongo.yml
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
version: '3.9'
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
mongodata:
|
||||||
|
|
||||||
|
services:
|
||||||
|
mongodb:
|
||||||
|
image: mongo
|
||||||
|
volumes:
|
||||||
|
- mongodata:/data/db
|
||||||
|
- ${PWD}/log:/var/log
|
||||||
|
ports:
|
||||||
|
- "27017:27017"
|
||||||
|
container_name: mongodb
|
||||||
|
# command: '--auth'
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
|
#spritzschema:
|
||||||
|
# build:
|
||||||
|
# context: .
|
||||||
|
# dockerfile: Dockerfile_spritzschema
|
||||||
|
# volumes:
|
||||||
|
# - ${PWD}/log:/var/log
|
||||||
|
# #ports:
|
||||||
|
# # - '3100:3014'
|
||||||
|
# container_name: spritzschema
|
||||||
|
# environment:
|
||||||
|
# - MONGOHOST=mongodb
|
||||||
|
# restart: unless-stopped
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
// all functions to get data from mongodb
|
// all functions to get data from mongodb
|
||||||
|
|
||||||
const {MongoClient} = require('mongodb')
|
import { MongoClient } from 'mongodb';
|
||||||
|
|
||||||
const MONGOHOST = process.env.MONGOHOST || 'localhost'
|
const MONGOHOST = process.env.MONGOHOST || 'localhost'
|
||||||
const MONGOPORT = process.env.MONGOPORT || 27017
|
const MONGOPORT = process.env.MONGOPORT || 27017
|
||||||
@@ -11,12 +11,12 @@ const MONGOBASE = process.env.MONGOBASE || 'medizin'
|
|||||||
const MONGO_URL = MONGOAUTH ? 'mongodb://'+MONGOUSRP+'@' + MONGOHOST + ':' + MONGOPORT + '/?authSource=admin' : 'mongodb://'+MONGOHOST+':'+MONGOPORT // URL to mongo database
|
const MONGO_URL = MONGOAUTH ? 'mongodb://'+MONGOUSRP+'@' + MONGOHOST + ':' + MONGOPORT + '/?authSource=admin' : 'mongodb://'+MONGOHOST+':'+MONGOPORT // URL to mongo database
|
||||||
let COLLECTION = 'spritzschema'
|
let COLLECTION = 'spritzschema'
|
||||||
|
|
||||||
const doMongo = async function(cmd, options) {
|
export const doMongo = async function(cmd, options) {
|
||||||
let erg = {err: null}
|
let erg = {err: null}
|
||||||
if (options.testing) {
|
if (options.testing) {
|
||||||
COLLECTION = 'spritzschema_test'
|
COLLECTION = 'spritzschema_test'
|
||||||
}
|
}
|
||||||
const client = new MongoClient(MONGO_URL, { useUnifiedTopology: true })
|
const client = new MongoClient(MONGO_URL)
|
||||||
try {
|
try {
|
||||||
await client.connect()
|
await client.connect()
|
||||||
if (cmd === 'getdata') {
|
if (cmd === 'getdata') {
|
||||||
@@ -46,7 +46,7 @@ const doMongo = async function(cmd, options) {
|
|||||||
// return:
|
// return:
|
||||||
// JSON Dokument mit den angefragten Werten
|
// JSON Dokument mit den angefragten Werten
|
||||||
// *********************************************
|
// *********************************************
|
||||||
async function getAPIdataOne(client, options) {
|
async function getAPIdataOne(client, options) {
|
||||||
let erg = {err: null}
|
let erg = {err: null}
|
||||||
try {
|
try {
|
||||||
erg.data = await client.db(MONGOBASE).collection(COLLECTION).findOne({curdata: options.curdata},{ projection:{_id: 0} })
|
erg.data = await client.db(MONGOBASE).collection(COLLECTION).findOne({curdata: options.curdata},{ projection:{_id: 0} })
|
||||||
@@ -58,7 +58,7 @@ async function getAPIdataOne(client, options) {
|
|||||||
return erg
|
return erg
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getAPIlastDataOne(client, options) {
|
async function getAPIlastDataOne(client, options) {
|
||||||
let erg = {err: null}
|
let erg = {err: null}
|
||||||
try {
|
try {
|
||||||
erg.data = await client.db(MONGOBASE).collection(COLLECTION).findOne({},{ projection:{_id: 0}, sort: {$natural: -1}})
|
erg.data = await client.db(MONGOBASE).collection(COLLECTION).findOne({},{ projection:{_id: 0}, sort: {$natural: -1}})
|
||||||
@@ -70,7 +70,7 @@ async function getAPIlastDataOne(client, options) {
|
|||||||
return erg
|
return erg
|
||||||
}
|
}
|
||||||
|
|
||||||
async function putAPIdataOne(client, options) {
|
async function putAPIdataOne(client, options) {
|
||||||
let erg = {err: null}
|
let erg = {err: null}
|
||||||
const query = {curdate: options.data.curdate}
|
const query = {curdate: options.data.curdate}
|
||||||
const opts = {upsert : true}
|
const opts = {upsert : true}
|
||||||
@@ -84,7 +84,7 @@ async function putAPIdataOne(client, options) {
|
|||||||
return erg
|
return erg
|
||||||
}
|
}
|
||||||
|
|
||||||
async function delAPIdataOne(client, options) {
|
async function delAPIdataOne(client, options) {
|
||||||
let erg = {err: null}
|
let erg = {err: null}
|
||||||
const query = {curdate: options.curdate}
|
const query = {curdate: options.curdate}
|
||||||
try {
|
try {
|
||||||
@@ -95,4 +95,4 @@ async function delAPIdataOne(client, options) {
|
|||||||
}
|
}
|
||||||
return erg
|
return erg
|
||||||
}
|
}
|
||||||
exports.doMongo = doMongo
|
|
||||||
|
|||||||
1550
package-lock.json
generated
24
package.json
@@ -1,18 +1,20 @@
|
|||||||
{
|
{
|
||||||
"name": "Spritzschema",
|
"name": "spritzschema",
|
||||||
"version": "0.0.1",
|
"version": "1.3.0",
|
||||||
"date": "2023-05-03",
|
"date": "2026-01-18",
|
||||||
|
"type": "module",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node ./bin/www >>/var/log/spritzschema.log 2>&1"
|
"start": "node ./bin/www.js >>/var/log/spritzschema.log 2>&1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"cookie-parser": "~1.4.4",
|
"cookie-parser": "~1.4.7",
|
||||||
"debug": "~2.6.9",
|
"debug": "~4.4.3",
|
||||||
"express": "^4.18.2",
|
"express": "^5.2.1",
|
||||||
"http-errors": "~1.6.3",
|
"http-errors": "~2.0.1",
|
||||||
"mongodb": "^5.4.0",
|
"mongodb": "^7.0.0",
|
||||||
"morgan": "~1.9.1",
|
"morgan": "^1.10.1",
|
||||||
"pug": "^3.0.2"
|
"pug": "^3.0.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
BIN
public/android-icon-192x192.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
public/apple-icon-114x114.png
Normal file
|
After Width: | Height: | Size: 8.3 KiB |
BIN
public/apple-icon-120x120.png
Normal file
|
After Width: | Height: | Size: 6.2 KiB |
BIN
public/apple-icon-144x144.png
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
BIN
public/apple-icon-152x152.png
Normal file
|
After Width: | Height: | Size: 7.0 KiB |
BIN
public/apple-icon-180x180.png
Normal file
|
After Width: | Height: | Size: 9.0 KiB |
BIN
public/apple-icon-57x57.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
public/apple-icon-60x60.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
BIN
public/apple-icon-72x72.png
Normal file
|
After Width: | Height: | Size: 5.2 KiB |
BIN
public/apple-icon-76x76.png
Normal file
|
After Width: | Height: | Size: 6.5 KiB |
2
public/browserconfig.xml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<browserconfig><msapplication><tile><square70x70logo src="/ms-icon-70x70.png"/><square150x150logo src="/ms-icon-150x150.png"/><square310x310logo src="/ms-icon-310x310.png"/><TileColor>#ffffff</TileColor></tile></msapplication></browserconfig>
|
||||||
BIN
public/favicon-16x16.png
Normal file
|
After Width: | Height: | Size: 179 B |
BIN
public/favicon-256x256.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
public/favicon-32x32.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
public/favicon-96x96.png
Normal file
|
After Width: | Height: | Size: 3.7 KiB |
BIN
public/favicon.ico
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
@@ -2,23 +2,33 @@ document.addEventListener('DOMContentLoaded', async function () {
|
|||||||
|
|
||||||
const DateTime = luxon.DateTime
|
const DateTime = luxon.DateTime
|
||||||
|
|
||||||
|
let curEinheit = sysParams.einheit
|
||||||
|
|
||||||
if (sysParams.doinit) {
|
if (sysParams.doinit) {
|
||||||
await initSchema('2023-05-01')
|
await initSchema('2023-05-01')
|
||||||
}
|
}
|
||||||
|
|
||||||
let ret = await getData()
|
let ret = await getData()
|
||||||
let schema = ret.data
|
let schema = ret.data
|
||||||
|
if(curEinheit === 0) {
|
||||||
|
curEinheit = schema.einheit
|
||||||
|
}
|
||||||
fillSchema(schema)
|
fillSchema(schema)
|
||||||
|
|
||||||
document.querySelector('#sptab').addEventListener('click', markField);
|
document.querySelector('#sptab').addEventListener('click', markField);
|
||||||
|
document.querySelector('#einheiten').addEventListener('change', enterEinheit);
|
||||||
|
|
||||||
async function markField (e) {
|
async function markField (e) {
|
||||||
let field = e.target;
|
let field = e.target;
|
||||||
let d = schema.data[34].day
|
let d = schema.data[34].day
|
||||||
field.setAttribute('aria-label','x');
|
field.setAttribute('aria-label','x');
|
||||||
field.setAttribute('disabled','disabled');
|
// field.setAttribute('disabled','disabled');
|
||||||
schema.data[parseInt(field.id.slice(2))-1].status = true
|
let status = schema.data[parseInt(field.id.slice(2))-1].status
|
||||||
|
status = !status
|
||||||
|
schema.data[parseInt(field.id.slice(2))-1].status = status
|
||||||
|
schema.data[parseInt(field.id.slice(2))-1].einheit = curEinheit
|
||||||
await storeData(schema)
|
await storeData(schema)
|
||||||
|
fillSchema(schema)
|
||||||
if (e.srcElement.id === 'bt35') {
|
if (e.srcElement.id === 'bt35') {
|
||||||
let ldt = DateTime.fromISO(d)
|
let ldt = DateTime.fromISO(d)
|
||||||
ldt = ldt.plus({day: 1})
|
ldt = ldt.plus({day: 1})
|
||||||
@@ -26,6 +36,21 @@ document.addEventListener('DOMContentLoaded', async function () {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function enterEinheit (e) {
|
||||||
|
let field = e.target;
|
||||||
|
curEinheit = parseInt(field.value)
|
||||||
|
schema.einheit = curEinheit
|
||||||
|
}
|
||||||
|
|
||||||
|
function buildCellHtml(day, einheit) {
|
||||||
|
let x = `<div id="inner">${day.toFormat('d')}
|
||||||
|
<div id="lowline" class="small">
|
||||||
|
<div id="wtg">${day.setLocale('de').toFormat('ccc')}</div>
|
||||||
|
<div id="eh">${einheit !== 0 ? einheit : ''}</div>
|
||||||
|
</div></div>`
|
||||||
|
return x
|
||||||
|
}
|
||||||
|
|
||||||
function fillSchema(schema) {
|
function fillSchema(schema) {
|
||||||
const setArray = schema.data
|
const setArray = schema.data
|
||||||
let months = ''
|
let months = ''
|
||||||
@@ -43,19 +68,20 @@ document.addEventListener('DOMContentLoaded', async function () {
|
|||||||
let sel = '#bt'+(i+1)
|
let sel = '#bt'+(i+1)
|
||||||
let day = DateTime.fromISO(setArray[i].day)
|
let day = DateTime.fromISO(setArray[i].day)
|
||||||
if (setArray[i].day !== '') {
|
if (setArray[i].day !== '') {
|
||||||
let x = `${day.toFormat('d')}
|
document.querySelector(sel).innerHTML = buildCellHtml(day, setArray[i].einheit)
|
||||||
<br /><span class="small">${day.setLocale('de').toFormat('ccc')}</span>`
|
|
||||||
document.querySelector(sel).innerHTML = x
|
|
||||||
if (setArray[i].status) {
|
if (setArray[i].status) {
|
||||||
document.querySelector(sel).setAttribute('aria-label', 'x')
|
document.querySelector(sel).setAttribute('aria-label', 'x')
|
||||||
document.querySelector(sel).setAttribute('disabled', 'disabled')
|
// document.querySelector(sel).setAttribute('disabled', 'disabled')
|
||||||
} else {
|
} else {
|
||||||
document.querySelector(sel).setAttribute('aria-label', '')
|
document.querySelector(sel).setAttribute('aria-label', '')
|
||||||
document.querySelector(sel).removeAttribute('disabled')
|
// document.querySelector(sel).removeAttribute('disabled')
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
document.querySelector(sel).setAttribute('disabled', 'disabled')
|
document.querySelector(sel).setAttribute('disabled', 'disabled')
|
||||||
}
|
}
|
||||||
|
if(setArray[i].einheit !== 0) {
|
||||||
|
document.getElementById("einheiten").value = setArray[i].einheit
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,6 +110,7 @@ document.addEventListener('DOMContentLoaded', async function () {
|
|||||||
let k = 0
|
let k = 0
|
||||||
for(let i = 0; i < 35; i++) {
|
for(let i = 0; i < 35; i++) {
|
||||||
let elem = {status: false}
|
let elem = {status: false}
|
||||||
|
elem.einheit = 0
|
||||||
if (i === 17) {
|
if (i === 17) {
|
||||||
elem.day = ''
|
elem.day = ''
|
||||||
} else {
|
} else {
|
||||||
@@ -101,7 +128,7 @@ document.addEventListener('DOMContentLoaded', async function () {
|
|||||||
}
|
}
|
||||||
setArray.push(elem)
|
setArray.push(elem)
|
||||||
}
|
}
|
||||||
let schema = {curdate: startdate, months: monthArray, years: yearsArray, data: setArray}
|
let schema = {curdate: startdate, months: monthArray, years: yearsArray, data: setArray, einheit: curEinheit}
|
||||||
await storeData(schema)
|
await storeData(schema)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
41
public/manifest.json
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
{
|
||||||
|
"name": "App",
|
||||||
|
"icons": [
|
||||||
|
{
|
||||||
|
"src": "\/android-icon-36x36.png",
|
||||||
|
"sizes": "36x36",
|
||||||
|
"type": "image\/png",
|
||||||
|
"density": "0.75"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "\/android-icon-48x48.png",
|
||||||
|
"sizes": "48x48",
|
||||||
|
"type": "image\/png",
|
||||||
|
"density": "1.0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "\/android-icon-72x72.png",
|
||||||
|
"sizes": "72x72",
|
||||||
|
"type": "image\/png",
|
||||||
|
"density": "1.5"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "\/android-icon-96x96.png",
|
||||||
|
"sizes": "96x96",
|
||||||
|
"type": "image\/png",
|
||||||
|
"density": "2.0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "\/android-icon-144x144.png",
|
||||||
|
"sizes": "144x144",
|
||||||
|
"type": "image\/png",
|
||||||
|
"density": "3.0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "\/android-icon-192x192.png",
|
||||||
|
"sizes": "192x192",
|
||||||
|
"type": "image\/png",
|
||||||
|
"density": "4.0"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
BIN
public/ms-icon-144x144.png
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
BIN
public/ms-icon-150x150.png
Normal file
|
After Width: | Height: | Size: 9.0 KiB |
BIN
public/ms-icon-310x310.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
BIN
public/ms-icon-70x70.png
Normal file
|
After Width: | Height: | Size: 5.7 KiB |
@@ -50,6 +50,17 @@ a {
|
|||||||
color: gray;
|
color: gray;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#infeld {
|
||||||
|
width: 91vmin;
|
||||||
|
margin: auto;
|
||||||
|
font-size: 200%;
|
||||||
|
}
|
||||||
|
|
||||||
|
#einheiten {
|
||||||
|
font-size: 130%;
|
||||||
|
margin-left: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
footer {
|
footer {
|
||||||
width: 91vmin;
|
width: 91vmin;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
@@ -58,3 +69,22 @@ footer {
|
|||||||
text-align: right;
|
text-align: right;
|
||||||
margin-top: 30px;
|
margin-top: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#inner {
|
||||||
|
margin-top: -45px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#lowline {
|
||||||
|
width: 100%;
|
||||||
|
clear: float;
|
||||||
|
}
|
||||||
|
|
||||||
|
#eh {
|
||||||
|
color: black;
|
||||||
|
float: right;
|
||||||
|
margin-right: -20px;
|
||||||
|
}
|
||||||
|
#wtg {
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,13 +1,15 @@
|
|||||||
const express = require('express');
|
import express from 'express'
|
||||||
|
import { doMongo } from '../modules/mongointerface.js'
|
||||||
|
import pkg from '../package.json' with { type: "json" }
|
||||||
|
|
||||||
const router = express.Router();
|
const router = express.Router();
|
||||||
const domongo = require('../modules/mongointerface')
|
|
||||||
const pkg = require('../package.json')
|
|
||||||
|
|
||||||
/* GET home page. */
|
/* GET home page. */
|
||||||
router.get('/', function(req, res, next) {
|
router.get('/', function(req, res, next) {
|
||||||
res.render('index', {
|
res.render('index', {
|
||||||
test: req.query.test === 'true',
|
test: req.query.test === 'true',
|
||||||
doinit: req.query.doinit === 'true',
|
doinit: req.query.doinit === 'true',
|
||||||
|
einheit: req.query.einheit === undefined ? 0 : req.query.einheit,
|
||||||
version: pkg.version,
|
version: pkg.version,
|
||||||
title: pkg.name,
|
title: pkg.name,
|
||||||
date: pkg.date
|
date: pkg.date
|
||||||
@@ -18,7 +20,7 @@ router.get('/data', async function(req, res, next) {
|
|||||||
const options = {}
|
const options = {}
|
||||||
options.curdate = req.query.curdate
|
options.curdate = req.query.curdate
|
||||||
options.testing = req.query.test
|
options.testing = req.query.test
|
||||||
let erg = await domongo.doMongo('getlastdata', options)
|
let erg = await doMongo('getlastdata', options)
|
||||||
res.json(erg)
|
res.json(erg)
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -26,8 +28,8 @@ router.post('/data', async function (req, res, next) {
|
|||||||
const options = {}
|
const options = {}
|
||||||
options.data = req.body
|
options.data = req.body
|
||||||
options.testing = req.query.test
|
options.testing = req.query.test
|
||||||
let erg = await domongo.doMongo('putdata', options)
|
let erg = await doMongo('putdata', options)
|
||||||
res.json(erg)
|
res.json(erg)
|
||||||
})
|
})
|
||||||
|
|
||||||
module.exports = router;
|
export default router
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
var express = require('express');
|
|
||||||
var router = express.Router();
|
|
||||||
|
|
||||||
/* GET users listing. */
|
|
||||||
router.get('/', function(req, res, next) {
|
|
||||||
res.send('respond with a resource');
|
|
||||||
});
|
|
||||||
|
|
||||||
module.exports = router;
|
|
||||||
@@ -44,3 +44,6 @@ block content
|
|||||||
button#bt33
|
button#bt33
|
||||||
button#bt34
|
button#bt34
|
||||||
button#bt35
|
button#bt35
|
||||||
|
#infeld
|
||||||
|
label(for="einheiten") Einheiten:
|
||||||
|
input#einheiten(type="number" min="0" max="100" value="0")
|
||||||
@@ -2,6 +2,25 @@ doctype html
|
|||||||
html
|
html
|
||||||
head
|
head
|
||||||
title= 'Spritzschema'
|
title= 'Spritzschema'
|
||||||
|
|
||||||
|
link(rel="apple-touch-icon" sizes="57x57" href="/apple-icon-57x57.png")
|
||||||
|
link(rel="apple-touch-icon" sizes="60x60" href="/apple-icon-60x60.png")
|
||||||
|
link(rel="apple-touch-icon" sizes="72x72" href="/apple-icon-72x72.png")
|
||||||
|
link(rel="apple-touch-icon" sizes="76x76" href="/apple-icon-76x76.png")
|
||||||
|
link(rel="apple-touch-icon" sizes="114x114" href="/apple-icon-114x114.png")
|
||||||
|
link(rel="apple-touch-icon" sizes="120x120" href="/apple-icon-120x120.png")
|
||||||
|
link(rel="apple-touch-icon" sizes="144x144" href="/apple-icon-144x144.png")
|
||||||
|
link(rel="apple-touch-icon" sizes="152x152" href="/apple-icon-152x152.png")
|
||||||
|
link(rel="apple-touch-icon" sizes="180x180" href="/apple-icon-180x180.png")
|
||||||
|
link(rel="icon" type="image/png" sizes="192x192" href="/android-icon-192x192.png")
|
||||||
|
link(rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png")
|
||||||
|
link(rel="icon" type="image/png" sizes="96x96" href="/favicon-96x96.png")
|
||||||
|
link(rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png")
|
||||||
|
link(rel="manifest" href="/manifest.json")
|
||||||
|
meta(name="msapplication-TileColor" content="#ffffff")
|
||||||
|
meta(name="msapplication-TileImage" content="/ms-icon-144x144.png")
|
||||||
|
meta(name="theme-color" content="#ffffff")
|
||||||
|
|
||||||
link(rel='stylesheet', href='/stylesheets/style.css')
|
link(rel='stylesheet', href='/stylesheets/style.css')
|
||||||
script(src="https://cdn.jsdelivr.net/npm/luxon@3.3.0/build/global/luxon.min.js")
|
script(src="https://cdn.jsdelivr.net/npm/luxon@3.3.0/build/global/luxon.min.js")
|
||||||
script(src="/javascripts/script.js")
|
script(src="/javascripts/script.js")
|
||||||
@@ -11,7 +30,8 @@ html
|
|||||||
testing: '#{test}' === 'true',
|
testing: '#{test}' === 'true',
|
||||||
version: '#{version}',
|
version: '#{version}',
|
||||||
date: '#{date}',
|
date: '#{date}',
|
||||||
doinit: '#{doinit}' === 'true'
|
doinit: '#{doinit}' === 'true',
|
||||||
|
einheit: parseInt('#{einheit}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||