This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| router.get('/', function(req, res) { | |
| var op = req.query.op | |
| verificaIp(res) | |
| }); | |
| function verificaIp(res){ | |
| ipIndex = Math.floor((Math.random() * 3)) | |
| console.log(ipIndex) | |
| console.log(hosts[ipIndex]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package tsi.upa.dao; | |
| import java.util.List; | |
| import javax.persistence.Entity; | |
| import javax.persistence.EntityManager; | |
| import javax.persistence.EntityManagerFactory; | |
| import javax.persistence.Persistence; | |
| import javax.persistence.criteria.CriteriaQuery; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| googleMapService.initNewRoom = function(div,zoom){ | |
| var myLatLng = {lat: lat, lng: lng}; | |
| // Caso não tenha nenhum mapa,crio o mapa na div informada no centro de BRASILIA | |
| var mapNew = new google.maps.Map(document.getElementById(div), { | |
| center: {lat: -15.7942287, lng: -47.8821658}, | |
| zoom: zoom | |
| }); | |
| //SE FORNECER GEOLOCATION EU MUDO POSIÇÂO PARA ONDE ELE ESTA |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Controller da página inicial de login | |
| scopeApp.controller('loginController', ['$scope','$window','$cookies','$http', function($scope,$window,$cookies,$http) { | |
| //Quando usuario clicar em logar, eu chamo o metodo da api que faz Autenticação e retorna o JWT | |
| $scope.logar = function(login,password){ | |
| $http.post('/api/auth',{login:login,password:password}) | |
| .success(function(data) { | |
| //quando login é feito com sucesso eu tenho o token do usuario pronto para guardar em cookie | |
| $cookies.put('scopeToken',data.token); | |
| var token = $cookies.get('scopeToken'); | |
| //Pego o valor que guardei em cookie e coloco no cabeçalho HTTP pedindo da DASHBOARD |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var bcrypt = require('bcrypt-nodejs'); | |
| var express = require('express'); | |
| var User = require('./models/user'); | |
| var Room = require('./models/room'); | |
| var jwt = require('jsonwebtoken'); // used to create, sign, and verify tokens | |
| var cookieParser = require('cookie-parser') // get cookie | |
| mongoose = require('mongoose'); | |
| ObjectId = mongoose.Types.ObjectId; | |
| //API--------------------------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //O exibindo info aparece certinho no console... | |
| scopeDashboardApp.controller('exibirInfoController', function($scope,$mdBottomSheet,gservice) { | |
| console.log('Exibindo sala'); | |
| //não sei como recuperar o title aqui :S | |
| console.log($scope.title) | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $mdBottomSheet.show({ | |
| preserveScope:true, | |
| templateUrl: 'views/dashboard/bottom.html', | |
| locals: {title: sala.title}, | |
| controller: 'exibirInfoController' | |
| }).then(function(clickedItem) { | |
| $scope.alert = clickedItem['name'] + ' clicked!'; | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <md-bottom-sheet class="md-list md-has-header" ng-cloak> | |
| <md-subheader>{{sala.title}}</md-subheader> | |
| </md-bottom-sheet> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| googleMapService.init = function(div,lat,lng){ | |
| var myLatLng = {lat: lat, lng: lng}; | |
| // Caso não tenha nenhum mapa,crio o mapa na div informada com as localizações do user | |
| if (!map){ | |
| map = new google.maps.Map(document.getElementById(div), { | |
| zoom: 3, | |
| center: myLatLng | |
| }); | |
| $http.get('/api/rooms').success(function(data){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Um formlario para editar foto | |
| <form action="update"> | |
| <input type="file" name="photo"> | |
| <input type="submit" value="enviar foto" /> | |
| </form> | |
| //Um formulario para editar o perfil assim um envio não influencia no outro | |
| <form action="update"> | |
| <input type="text" name="first_name" /> |