Commit e9cae864 authored by Theis's avatar Theis
Browse files

Auto stash before merge of "master" and "origin/master"

parent 06de8271
Pipeline #95672 passed with stage
in 5 minutes and 2 seconds
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "api",
"version": "1.0.0", "version": "1.0.0",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
...@@ -16,10 +17,10 @@ ...@@ -16,10 +17,10 @@
"express": "^4.17.1", "express": "^4.17.1",
"path": "^0.12.7", "path": "^0.12.7",
"postinstall": "^0.7.4", "postinstall": "^0.7.4",
"prisma": "^3.3.0",
"prisma-client-lib": "^1.34.12" "prisma-client-lib": "^1.34.12"
}, },
"devDependencies": { "devDependencies": {
"prisma": "^3.2.0",
"webpack-cli": "^4.9.1", "webpack-cli": "^4.9.1",
"webpack-dev-server": "^4.3.1" "webpack-dev-server": "^4.3.1"
} }
...@@ -100,9 +101,10 @@ ...@@ -100,9 +101,10 @@
} }
}, },
"node_modules/@prisma/engines": { "node_modules/@prisma/engines": {
"version": "3.3.0-30.33838b0f78f1fe9052cf9a00e9761c9dc097a63c", "version": "3.2.0-34.afdab2f10860244038c4e32458134112852d4dad",
"resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-3.3.0-30.33838b0f78f1fe9052cf9a00e9761c9dc097a63c.tgz", "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-3.2.0-34.afdab2f10860244038c4e32458134112852d4dad.tgz",
"integrity": "sha512-T3nEnRWmoneNZJPd9IBR29G8ZDUjNelA8+cG5y8/lh6vySm6ryWSNxj1s377U9YzFYyZmXiA9vK1iyxMoRff/g==", "integrity": "sha512-MiZORXXsGORXTF9RqqKIlN/2ohkaxAWTsS7qxDJTy5ThTYLrXSmzxTSohM4qN/AI616B+o5WV7XTBhjlPKSufg==",
"devOptional": true,
"hasInstallScript": true "hasInstallScript": true
}, },
"node_modules/@prisma/engines-version": { "node_modules/@prisma/engines-version": {
...@@ -3479,12 +3481,13 @@ ...@@ -3479,12 +3481,13 @@
} }
}, },
"node_modules/prisma": { "node_modules/prisma": {
"version": "3.3.0", "version": "3.2.0",
"resolved": "https://registry.npmjs.org/prisma/-/prisma-3.3.0.tgz", "resolved": "https://registry.npmjs.org/prisma/-/prisma-3.2.0.tgz",
"integrity": "sha512-E7C9mXRwZVpcnSeJT533qGHUVrYULsE9ihFvAtQMuxhTXkxoRlMLyo/1ZOyeu9GdXP8DJ7ruLOw06kEs/N3dVg==", "integrity": "sha512-o8+DH0RD5DbP8QTZej2dsY64yvjOwOG3TWOlJyoCHQ+8DH9m4tzxo38j6IF/PqpN4PmAGPpHuNi/nssG1cvYlQ==",
"devOptional": true,
"hasInstallScript": true, "hasInstallScript": true,
"dependencies": { "dependencies": {
"@prisma/engines": "3.3.0-30.33838b0f78f1fe9052cf9a00e9761c9dc097a63c" "@prisma/engines": "3.2.0-34.afdab2f10860244038c4e32458134112852d4dad"
}, },
"bin": { "bin": {
"prisma": "build/index.js", "prisma": "build/index.js",
...@@ -5100,9 +5103,10 @@ ...@@ -5100,9 +5103,10 @@
} }
}, },
"@prisma/engines": { "@prisma/engines": {
"version": "3.3.0-30.33838b0f78f1fe9052cf9a00e9761c9dc097a63c", "version": "3.2.0-34.afdab2f10860244038c4e32458134112852d4dad",
"resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-3.3.0-30.33838b0f78f1fe9052cf9a00e9761c9dc097a63c.tgz", "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-3.2.0-34.afdab2f10860244038c4e32458134112852d4dad.tgz",
"integrity": "sha512-T3nEnRWmoneNZJPd9IBR29G8ZDUjNelA8+cG5y8/lh6vySm6ryWSNxj1s377U9YzFYyZmXiA9vK1iyxMoRff/g==" "integrity": "sha512-MiZORXXsGORXTF9RqqKIlN/2ohkaxAWTsS7qxDJTy5ThTYLrXSmzxTSohM4qN/AI616B+o5WV7XTBhjlPKSufg==",
"devOptional": true
}, },
"@prisma/engines-version": { "@prisma/engines-version": {
"version": "3.2.0-34.afdab2f10860244038c4e32458134112852d4dad", "version": "3.2.0-34.afdab2f10860244038c4e32458134112852d4dad",
...@@ -7789,11 +7793,12 @@ ...@@ -7789,11 +7793,12 @@
"integrity": "sha512-ZzWuos7TI5CKUeQAtFd6Zhm2s6EpAD/ZLApIhsF9pRvRtM1RFo61dM/4MSRUA0SuLugA/zgrZD8m0BaY46Og7g==" "integrity": "sha512-ZzWuos7TI5CKUeQAtFd6Zhm2s6EpAD/ZLApIhsF9pRvRtM1RFo61dM/4MSRUA0SuLugA/zgrZD8m0BaY46Og7g=="
}, },
"prisma": { "prisma": {
"version": "3.3.0", "version": "3.2.0",
"resolved": "https://registry.npmjs.org/prisma/-/prisma-3.3.0.tgz", "resolved": "https://registry.npmjs.org/prisma/-/prisma-3.2.0.tgz",
"integrity": "sha512-E7C9mXRwZVpcnSeJT533qGHUVrYULsE9ihFvAtQMuxhTXkxoRlMLyo/1ZOyeu9GdXP8DJ7ruLOw06kEs/N3dVg==", "integrity": "sha512-o8+DH0RD5DbP8QTZej2dsY64yvjOwOG3TWOlJyoCHQ+8DH9m4tzxo38j6IF/PqpN4PmAGPpHuNi/nssG1cvYlQ==",
"devOptional": true,
"requires": { "requires": {
"@prisma/engines": "3.3.0-30.33838b0f78f1fe9052cf9a00e9761c9dc097a63c" "@prisma/engines": "3.2.0-34.afdab2f10860244038c4e32458134112852d4dad"
} }
}, },
"prisma-client-lib": { "prisma-client-lib": {
......
...@@ -17,10 +17,10 @@ ...@@ -17,10 +17,10 @@
"express": "^4.17.1", "express": "^4.17.1",
"path": "^0.12.7", "path": "^0.12.7",
"postinstall": "^0.7.4", "postinstall": "^0.7.4",
"prisma": "^3.3.0",
"prisma-client-lib": "^1.34.12" "prisma-client-lib": "^1.34.12"
}, },
"devDependencies": { "devDependencies": {
"prisma": "^3.2.0",
"webpack-cli": "^4.9.1", "webpack-cli": "^4.9.1",
"webpack-dev-server": "^4.3.1" "webpack-dev-server": "^4.3.1"
} }
......
const { PrismaClient } = require('@prisma/client') const { PrismaClient } = require('@prisma/client')
const express = require("express"); const express = require("express");
const bunyan = require('bunyan'); const bunyan = require('bunyan');
//const cors = require("cors"); const cors = require("cors");
const axios = require('axios'); const axios = require('axios');
var https = require('https'); var https = require('https');
var http = require('http'); var http = require('http');
...@@ -12,25 +12,25 @@ app.use(express.static(path)); ...@@ -12,25 +12,25 @@ app.use(express.static(path));
const prisma = new PrismaClient() const prisma = new PrismaClient()
//app.use(cors(corsOptions)); app.use(cors(corsOptions));
app.use(express.json()); app.use(express.json());
app.use(express.urlencoded({ extended: true })); app.use(express.urlencoded({ extended: true }));
// var corsOptions = { var corsOptions = {
// origin: "http://localhost:8081" origin: "http://localhost:8081"
// }; };
/*var corsOptions = { /*var corsOptions = {
origin: "https://air-app.azurewebsites.net" origin: "https://air-app.azurewebsites.net"
};*/ };*/
const log = bunyan.createLogger({ name: "AIR_UI_Backend: " }); const log = bunyan.createLogger({ name: "AIR_UI_Backend: " });
const predictionURL = 'https://air-fastapi.azurewebsites.net/predict' const predictionURL_training_fall = 'https://air-fastapi.azurewebsites.net/predict_training'
function deleteVariable(variableToDelete) { function deleteVariable(variablesMarkedForDeletion) {
variableToDelete.forEach(element => { variablesMarkedForDeletion.forEach(element => {
element = undefined; element = undefined;
delete (element); delete(element);
}); });
} }
...@@ -55,7 +55,7 @@ function dataPreparationForML(age, gender /*, assistiveAids*/) { ...@@ -55,7 +55,7 @@ function dataPreparationForML(age, gender /*, assistiveAids*/) {
} }
function getPrediction(inputForMLPrediction) { function getPrediction(inputForMLPrediction) {
predictionResult = axios.post(predictionURL, inputForMLPrediction).then(result => { predictionResult = axios.post(predictionURL_training_fall, inputForMLPrediction).then(result => {
return result.data; return result.data;
}).catch(error => { }).catch(error => {
log.error("getPrediction() threw an exception: ", error) log.error("getPrediction() threw an exception: ", error)
...@@ -115,20 +115,20 @@ app.post("/home/:ssn", async (req, res) => { ...@@ -115,20 +115,20 @@ app.post("/home/:ssn", async (req, res) => {
deleteVariable([citizenData]) deleteVariable([citizenData])
res.send(false) res.send(false)
} else { } else {
const inputDataForMLPrediction = dataPreparationForML(citizenData.age, citizenData.gender); const inputDataForMLPrediction = dataPreparationForML(citizenData.age, citizenData.gender /*, */);
var citizenPrediction = await getPrediction(inputDataForMLPrediction); var citizenPrediction = await getPrediction(inputDataForMLPrediction);
//console.log(citizenData) //Send HMI to ATS Endpoint
convertDataSizeToKb("Combined datasize from both the ML Model and Database in Kb: ", { citizenData, citizenPrediction }) convertDataSizeToKb("Combined datasize from both the ML Model and Database in Kb: ", { citizenData, citizenPrediction })
res.json({ citizenData, citizenPrediction }) res.json({ citizenData, citizenPrediction })
deleteVariable([citizenData, citizenPrediction]) deleteVariable([citizenData, citizenPrediction])
} }
}); });
http.createServer(app).listen(80); //http.createServer(app).listen(80);
https.createServer(app).listen(443); //https.createServer(app).listen(443);
log.info(`Server is listening on port ${80} and ${443}.`); //log.info(`Server is listening on port ${80} and ${443}.`);
/*const PORT = process.env.PORT || 8080; const PORT = process.env.PORT || 8080;
app.listen(PORT, () => { app.listen(PORT, () => {
log.info(`Server is listening on port ${PORT}.`); log.info(`Server is listening on port ${PORT}.`);
});*/ });
\ No newline at end of file \ No newline at end of file
<template> <template>
<div> <div>
<v-card>
<div class="explanationTitle">Sandsynlighedsforklaring</div> <div class="explanationTitle">Sandsynlighedsforklaring</div>
<v-divider horizontal /> <v-divider horizontal />
<v-card-text> <v-card-text>
...@@ -14,7 +13,6 @@ ...@@ -14,7 +13,6 @@
{{ getExplanation[13] }} {{ getExplanation[14] }} {{ getExplanation[15] }}. {{ getExplanation[13] }} {{ getExplanation[14] }} {{ getExplanation[15] }}.
</div> </div>
</v-card-text> </v-card-text>
</v-card>
</div> </div>
</template> </template>
...@@ -44,9 +42,9 @@ export default Vue.extend({ ...@@ -44,9 +42,9 @@ export default Vue.extend({
<style scoped> <style scoped>
.explanationTitle { .explanationTitle {
padding-top: 0.5rem; padding-top: 0.25rem;
padding-left: 1rem; padding-left: 1rem;
padding-bottom: 0.5rem; padding-bottom: 0.25rem;
font-size: 26px; font-size: 26px;
color: #35414f; color: #35414f;
background-color: #e3e3e3; background-color: #e3e3e3;
......
import axios from "axios"; import axios from "axios";
export default axios.create({ export default axios.create({
//baseURL: "http://localhost:8080/", baseURL: "http://localhost:8080/",
baseURL: "https://air-app.azurewebsites.net/", //baseURL: "https://air-app.azurewebsites.net/",
headers: { headers: {
"Content-type": "application/json" "Content-type": "application/json"
} }
......
...@@ -7,7 +7,7 @@ class DataService { ...@@ -7,7 +7,7 @@ class DataService {
return !citizenData.data ? false : this.setCitizenInformation(citizenData) return !citizenData.data ? false : this.setCitizenInformation(citizenData)
} }
//All data has to be stored from here (Exception Handling) //All data has to be stored from this location
setCitizenInformation(citizenInformation: any) : boolean { setCitizenInformation(citizenInformation: any) : boolean {
store.dispatch("citizenProfile", [ store.dispatch("citizenProfile", [
citizenInformation.data.citizenData.first_name, citizenInformation.data.citizenData.first_name,
...@@ -15,7 +15,7 @@ class DataService { ...@@ -15,7 +15,7 @@ class DataService {
citizenInformation.data.citizenData.age, citizenInformation.data.citizenData.age,
citizenInformation.data.citizenData.ssn citizenInformation.data.citizenData.ssn
]); ]);
//store.dispatch("assistiveAids", citizenInformation.data.citizenData.Assistive_Aids); //store.dispatch("assistiveAids", citizenInformation.data.citizenData.Assistive_Aids); (Whenever we get assistive aid data from KMD)
store.dispatch("trainingPlans", citizenInformation.data.citizenData.Training_Plans); store.dispatch("trainingPlans", citizenInformation.data.citizenData.Training_Plans);
store.dispatch("homeCare", citizenInformation.data.citizenData.Home_Care); store.dispatch("homeCare", citizenInformation.data.citizenData.Home_Care);
store.dispatch("registeredFalls", citizenInformation.data.citizenData.Registered_Falls); store.dispatch("registeredFalls", citizenInformation.data.citizenData.Registered_Falls);
......
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
<script lang="ts"> <script lang="ts">
import Vue from "vue"; import Vue from "vue";
import Probability from "@/components/Probability.vue"; import Probability from "@/components/Probability.vue";
import AidTabs from "@/components/AidTabs.vue"; import AidTabs from "@/components/AidTabs.vue";
import Explainer from "@/components/Explainer.vue" import Explainer from "@/components/Explainer.vue"
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<v-main> <v-main>
<v-container fill-height> <v-container fill-height>
<v-row justify="center" align="center"> <v-row justify="center" align="center">
<v-col cols="12" sm="5"> <v-col cols="12" sm="7">
<div v-if="errorMessage"> <div v-if="errorMessage">
<v-alert <v-alert
v-model="errorMessage" v-model="errorMessage"
...@@ -86,6 +86,11 @@ export default Vue.extend({ ...@@ -86,6 +86,11 @@ export default Vue.extend({
padding-left: 1rem; padding-left: 1rem;
} }
.v-btn__content {
color: inherit;
text-decoration: none !important;
}
.search input { .search input {
color: rgb(46, 46, 46) !important; color: rgb(46, 46, 46) !important;
font-size: 28px; font-size: 28px;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment