From dbe2dd523884087bf233736ad717554957f82116 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= Date: Wed, 3 Oct 2018 22:56:28 +0200 Subject: [PATCH] Added adminer and simple faux login form --- client/pug/index.pug | 11 +++++++++++ client/scripts/index/10-init-framework.coffee | 8 ++++++++ docker-compose.yml | 11 +++++++++++ server.js | 10 +++++++++- 4 files changed, 39 insertions(+), 1 deletion(-) diff --git a/client/pug/index.pug b/client/pug/index.pug index e85923a..ae69c9d 100644 --- a/client/pug/index.pug +++ b/client/pug/index.pug @@ -8,3 +8,14 @@ html script(src='index.min.js') body h1 Hello World! + h2 App under development, please don't send valuable data! + form(name="fftcg-login" method="post" action="#") + fieldset + legend Login-Details + div + label(for="uname") Username: + input(name="uname" required) + label(for="password") Password: + input(name="password", type="password", placeholder="6 digits, a combination of numbers and letters" required) + div + input(name="login" type="submit" value="Login") diff --git a/client/scripts/index/10-init-framework.coffee b/client/scripts/index/10-init-framework.coffee index 8cf6d2d..d7db864 100644 --- a/client/scripts/index/10-init-framework.coffee +++ b/client/scripts/index/10-init-framework.coffee @@ -1,2 +1,10 @@ # init Socket.IO socket = io() + +$('form[name="fftcg-login"]').submit -> + data = + uname: $('input[name="uname"]').val() + password: $('input[name="password"]').val() + @reset() + socket.emit 'login', data + false diff --git a/docker-compose.yml b/docker-compose.yml index 135b5dc..e13cf93 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,6 +12,17 @@ services: volumes: - "mariadata:/var/lib/mysql" + adminer: + image: adminer:standalone + restart: "no" + environment: + - "ADMINER_DESIGN=rmsoft" + - "ADMINER_DEFAULT_SERVER=tcgsql" + ports: + - "8002:8080" + + # dbuser: fftcg + # dbpass: juchie5OhH6eiQuujaoquievezoe9iXe fftcg: build: . restart: "no" diff --git a/server.js b/server.js index ff7b544..9ab7d46 100644 --- a/server.js +++ b/server.js @@ -17,7 +17,7 @@ let io = socketio(web); // Listen server web.listen(8080, function () { - console.log('listening on port 8080'); + console.log('Node.js listening on port 8080'); }); app.use(helmet()); @@ -28,4 +28,12 @@ app.use(express.static(__dirname + '/static')); // Server logic io.on('connection', function (socket) { console.log('a user connected'); + + socket.on('disconnect', function(){ + // console.log('user disconnected'); + }); + + socket.on('login', function(msg){ + console.log('message:', msg.uname, msg.password); + }); });