Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Christian Fischer Pedersen
AIR
Commits
e5bca74b
Commit
e5bca74b
authored
Dec 22, 2021
by
Theis
Browse files
Added a README.md file for the web part
parent
e93fdc99
Changes
3
Hide whitespace changes
Inline
Side-by-side
web/README.md
0 → 100644
View file @
e5bca74b
# Air
AIR is an open-source machine learning project to improve rehabilitation for danish citizens.
## Installation
To run the application it is recommended to firstly install visual studio code.
\
Get it from: https://code.visualstudio.com/
When it is install open Visual Studio Code and select 'File' followed by 'Open Folder'.
Select the web folder in the air project.
Now open a terminal by selecting 'Terminal' followed by 'New Terminal' in the top toolbar in Visual Studio Code.
A window in the bottom should now appear, and it is recommended to split the terminal into two.
Click with your mouse on the created terminal and enter CTRL+SHIFT+5.
Enter the following in one of the two terminals:
```
bash
cd
vue-app
```
And the following in the other terminal:
```
bash
cd
api
```
In both terminals, enter 'npm install' to install all necessary dependencies.
When that is done, enter the following in the presented order:
\
├──'node server.js' - In the terminal associated with the api.
\
├──'npm run serve' - In the terminal associated with the vue-app.
When the latter has finished a window should now open in a browser with the application running.
Enjoy!
\ No newline at end of file
web/api/server.js
View file @
e5bca74b
...
...
@@ -125,7 +125,7 @@ app.post("/home/:ssn", async (req, res) => {
res
.
send
(
false
)
}
else
{
//Format and
s
ort
a
ssistive
a
ids
d
ata from Database
//Format and
S
ort
A
ssistive
A
ids
D
ata from Database
var
assistiveAidsWithCorrectDateFormat
=
changeLendDateFormat
(
citizenData
.
Assistive_Aids
)
var
sortedAssistiveAids
=
sortAssistiveAidsByDate
(
assistiveAidsWithCorrectDateFormat
)
...
...
@@ -144,11 +144,9 @@ app.post("/home/:ssn", async (req, res) => {
//Result from ML model for both cases
var
citizenCompleteTrainingPrediction
=
await
getCompleteTrainingPrediction
(
inputForCompleteTrainingPrediction
);
var
citizenAlarmPrediction
=
await
getAlarmPrediction
(
inputForAlarmPrediction
);
convertDataSizeToKb
(
"
Combined datasize from both the ML Model and Database in Kb:
"
,
{
citizenData
,
citizenCompleteTrainingPrediction
,
citizenAlarmPrediction
})
res
.
json
({
citizenData
,
citizenCompleteTrainingPrediction
,
citizenAlarmPrediction
})
await
deleteVariable
([
citizenData
,
assistiveAidsWithCorrectDateFormat
,
...
...
@@ -167,7 +165,7 @@ function changeLendDateFormat(assistiveAids) {
assistiveAids
.
forEach
(
function
(
assistiveAid
)
{
assistiveAid
.
lend_date
=
rearrangeDateFormat
(
assistiveAid
.
lend_date
)
});
return
assistiveAids
;
return
assistiveAids
}
function
rearrangeDateFormat
(
date
)
{
...
...
@@ -176,7 +174,7 @@ function rearrangeDateFormat(date) {
var
month
=
dateInArray
[
1
]
var
year
=
dateInArray
[
2
]
var
rearrangedDateFormat
=
month
+
'
/
'
+
day
+
'
/
'
+
'
20
'
+
year
return
rearrangedDateFormat
;
return
rearrangedDateFormat
}
function
sortAssistiveAidsByDate
(
assistiveAids
){
...
...
@@ -195,7 +193,7 @@ function removeAlarmFromAssistiveAidsList(assistiveAids) {
assistiveAids
.
splice
(
i
,
1
);
}
}
return
assistiveAids
;
return
assistiveAids
}
function
appendAssistiveAidsISO
(
assistiveAids
)
{
...
...
web/vue-app/src/views/AlarmPrevention.vue
View file @
e5bca74b
...
...
@@ -4,7 +4,7 @@
<v-row>
<v-col
cols=
"12"
xl=
"6"
lg=
"6"
md=
"12"
sm=
"12"
>
<v-card
class=
"pa-2"
outlined
rounded=
"15px"
elevation=
"5"
>
<div
class=
"header-text"
>
Sandsynlighed for ikke at
få
en nødalarm
</div>
<div
class=
"header-text"
>
Sandsynlighed for ikke at
modtage
en nødalarm
</div>
<apexchart
height=
"400"
type=
"area"
:options=
"$_chart_options"
:series=
"$_chart_series"
/>
<explainer
:alarm=
"true"
/>
</v-card>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment