Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/kasidev/FDP_calc
Browse files Browse the repository at this point in the history
  • Loading branch information
kasidev committed May 27, 2020
2 parents e97eeeb + a4118b7 commit 93b9fc0
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 81 deletions.
24 changes: 17 additions & 7 deletions docs/List.todo
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,29 @@ FDP_calc 0.2:

✔ include split duty deduction @done(20-04-25 10:55)

get all timezones in the input timezone field
get all timezones in the input timezone field @done(20-05-27 14:18)
moment.tz.names()


☐ Check inputs for consitency
e.g. split duty start before fdp start

get some nice styles and nice fonts
get some nice styles and nice fonts @done(20-05-27 14:18)

FDP_calc 0.3:

☐ implement a simple graphical display of the results
use a gant chart
☐ improve css and html

☐ Check inputs for consitency
e.g. split duty start before fdp start

☐ Improve folder structure
tidy up, arrange all public files

☐ Improve server code

☐ Logic for inflight rest

☐ Logic for not acclimatised crewmember

☐ Rotation scheduler


FDP_calc 0.4:
Expand Down
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<a class="dropdown-item" href="https://www.linkedin.com/in/patrick-kasiala-48289210b">About Me <i class="fab fa-linkedin"></i></a>
<a class="dropdown-item" href="/public/license.html">License </a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="dev@kasiala.ch">Contact Me</a>
<a class="dropdown-item" href="mailto:dev@kasiala.ch">Contact Me</a>
</div>
</li>
</ul>
Expand Down
6 changes: 4 additions & 2 deletions public/instruction.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<a class="nav-link" href="https://www.easa.europa.eu/document-library/general-publications/easy-access-rules-air-operations#group-easa-downloads">Regulation</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/public/instruction.html">Description</a>
<a class="nav-link" href="/public/instruction.html">Help</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Expand All @@ -40,7 +40,7 @@
<a class="dropdown-item" href="https://www.linkedin.com/in/patrick-kasiala-48289210b">About Me <i class="fab fa-linkedin"></i></a>
<a class="dropdown-item" href="/public/license.html">License </a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="dev@kasiala.ch">Contact Me</a>
<a class="dropdown-item" href="mailto:dev@kasiala.ch">Contact Me</a>
</div>
</li>
</ul>
Expand All @@ -53,6 +53,8 @@ <h1>Description</h1>

<p>When the calculation is completed you will see the latest, legal estimated time of arrival (ETA) for the rotation that you described</p>

<p>Inputs for inflight rest and not acclimatised crew members will be implemented soon</p>

<iframe width="560" height="315" src="https://www.youtube.com/embed/u44epztmBPU" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

</div>
Expand Down
4 changes: 2 additions & 2 deletions public/license.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<a class="nav-link" href="https://www.easa.europa.eu/document-library/general-publications/easy-access-rules-air-operations#group-easa-downloads">Regulation</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/public/instruction.html">Description</a>
<a class="nav-link" href="/public/instruction.html">Help</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Expand All @@ -40,7 +40,7 @@
<a class="dropdown-item" href="https://www.linkedin.com/in/patrick-kasiala-48289210b">About Me <i class="fab fa-linkedin"></i></a>
<a class="dropdown-item" href="/public/license.html">License </a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="dev@kasiala.ch">Contact Me</a>
<a class="dropdown-item" href="mailto:dev@kasiala.ch">Contact Me</a>
</div>
</li>
</ul>
Expand Down
72 changes: 16 additions & 56 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,61 +1,21 @@
# FDP_calc
Responisve flight duty period calculation web app
flight duty period calculation web app


# next versions
FDP_calc 0.3:

☐ implement a simple graphical display of the results
use a gant chart

☐ Check inputs for consitency
e.g. split duty start before fdp start


FDP_calc 0.4:
☐ deploy on azure

# Version 0.1
Make Setup for UTC calculation according EASA FDP including the following:
-Calculate ETA respective to checking time and number of legs
-include split duty regulation
-calculate all times with Moment.js and the respective timezone
-calculate all in UTC

Webapp DEMO VERSION available on http://flightDuty.kasiala.ch/

------------------------------------------------
###############################################
###############################################
###############################################
# Webpack Readme
###############################################
###############################################
###############################################
----------------------------------------------

# Wie startest du das Projekt?

1. npm install
2. npm run start:dev
3. Irgendwo in der Ausgabe wird ausgegeben: Project is running at http://localhost:8081/.
Den Link im Browser öffnen, ggf. in den "public"-Ordner navigieren! Der Port ist aber
ggf. unterschiedlich!
4. `npm run build` baut die Dateien im `production`-Modus!

# Wie wurde das Projekt erstellt?

- npm install --save-dev @webpack-cli/init ejs

- npx webpack-cli init
- SASS benutzen: JA
- Sass ermöglichst uns CSS komfortabler zu schreiben
- Sass wird in normales CSS umgewandelt

- SASS aktivieren:
- In der index.js-Datei können wir jetzt eine .scss-Datei per require()
einbinden
- Diese wird dann von Webpack automatisch mit Hilfe von SCSS nach CSS
umgewandelt
- Der CSS-Code landet aber standardmäßig mit in unserer .js-Datei
- Daher brauchen wir noch ein Webpack-Plugin:
https://github.com/webpack-contrib/mini-css-extract-plugin
- npm install --save-dev mini-css-extract-plugin
- Und müssen den "style-loader" aus unserer Webpack-Konfiguration entfernen
https://github.com/webpack-contrib/mini-css-extract-plugin/issues/173

- Webpack-Dev-Server wurde eingerichtet
- npm install --save-dev webpack-dev-server
- => https://webpack.js.org/configuration/dev-server/
- Kann über `npm run start:dev` gestartet werden

- ejs-Loader wurde eingerichtet
- Wenn wir jetzt per require() eine .ejs-Datei einbinden, wird diese automatisch
in eine JavaScript-Funktion umgewandelt!
- => https://www.npmjs.com/package/ejs-loader
I need help to deploy the app on a cloud service like azure or AWS.
22 changes: 9 additions & 13 deletions server/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,21 @@ const serverLog = require("../src/data/serverLog.json")

//const sanitizePath = path.normalize(parsedUrl.pathname).replace(/^(\.\.[\/\\])+/, '')

let counter = 93
let counter = 11
const app = http.createServer((req, res) => {

counter+=1
console.log("requested url:",req.url)
console.log("domain")


//console.log(counter)
const reqLog={
"id": counter,
"req": req,
}
serverLog.push(reqLog)
//console.log(serverLog)
//fs.writeFile('../src/data/serverLog`${}`.json"',serverLog)

const parsedUrl = url.parse(req.url,true)
if (parsedUrl.pathname==="/public/index.html") {
counter+=1
let now = new Date(Date.now())
console.log(now.toString())
console.log(counter)

}
console.log("parsedurl:",parsedUrl.pathname)

if(parsedUrl.pathname.substr(0,8)==="/public/"){

servPublic(parsedUrl,res)
Expand Down

0 comments on commit 93b9fc0

Please sign in to comment.