Skip to content

Commit

Permalink
OOB view changes
Browse files Browse the repository at this point in the history
  • Loading branch information
raghunfs committed Aug 25, 2016
1 parent f5a36a4 commit f687723
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 26 deletions.
5 changes: 3 additions & 2 deletions nodejs/views/deviceAdd.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
<!doctype html>
<html>
<head>
<title>User Authentication</title>
<title>Add your device</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap.min.css">
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css">
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
Expand Down Expand Up @@ -107,7 +108,7 @@
<div class="container" id = "container">

<div class="page-header text-center">
<h1><span class="fa fa-anchor"></span> Unattached Devices Page</h1>
<h1><span class="fa fa-anchor"></span> Search and configure new device</h1>
<a href="/profile" class="btn btn-default btn-sm">Home</a>
<a href="/logout" class="btn btn-default btn-sm">Logout</a>
</div>
Expand Down
6 changes: 3 additions & 3 deletions nodejs/views/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
<!doctype html>
<html>
<head>
<title>User Authentication</title>
<title>Log in to your Command and Control Center</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap.min.css"> <!-- load bootstrap css -->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css"> <!-- load fontawesome -->
<style>
Expand All @@ -13,15 +14,14 @@
<div class="container">

<div class="jumbotron text-center">
<h1><span class="fa fa-lock"></span> User Authentication</h1>
<h1><span class="fa fa-lock"></span> Command and Control Center</h1>


<p>Login or Register with:</p>

<a href="/login" class="btn btn-default"><span class="fa fa-user"></span> User Login</a>
<a href="/signup" class="btn btn-default"><span class="fa fa-user"></span> User Signup</a>
<br></br>
<p>Aalto University, Finland</p>

</div>

Expand Down
3 changes: 2 additions & 1 deletion nodejs/views/login.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<html>
<head>
<title>User Authentication</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap.min.css"> <!-- load bootstrap css -->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css"> <!-- load fontawesome -->
<style>
Expand All @@ -14,7 +15,7 @@

<div class="col-sm-6 col-sm-offset-3">

<h1><span class="fa fa-sign-in"></span> Aalto University Login</h1>
<h1><span class="fa fa-sign-in"></span> IoT Command and Control Login</h1>

<!-- show any messages that come back with authentication -->
<% if (message.length > 0) { %>
Expand Down
5 changes: 3 additions & 2 deletions nodejs/views/profile.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
<!doctype html>
<html>
<head>
<title>User Authentication</title>
<title>Your IoT Command and Control Center</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap.min.css">
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css">
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
Expand Down Expand Up @@ -90,7 +91,7 @@
<div class="container">

<div class="page-header text-center">
<h1><span class="fa fa-anchor"></span> Aalto University Profile Page</h1>
<h1><span class="fa fa-anchor"></span> IoT Command and Control Center</h1>
<a href="/addDevice" class="btn btn-default btn-sm">Add Device</a>
<a href="/logout" class="btn btn-default btn-sm">Logout</a>
</div>
Expand Down
51 changes: 33 additions & 18 deletions wpa_supplicant-2.5/wpa_supplicant/test.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
border: 1px solid black;
width: 400px;
height: 400px;
text-align: center;
text-align: left;

}
img{
Expand All @@ -24,7 +24,7 @@

<body>

<h1 style="text-align:center;">QR Code OOB Authentication</h1>
<h2 style="text-align:center;margin-top: 2cm">Wait while we search for the right networks</h2>

<div style="text-align:-moz-center">
<table id="myTable">
Expand All @@ -41,9 +41,11 @@ <h1 style="text-align:center;">QR Code OOB Authentication</h1>
var h = window.innerHeight;
var colNum = Math.floor(w/500);
var rowNum = Math.floor(h/500);
if(colNum == 2) {colNum=1;}
var tdID = 'idnum';
var servID ='servid';
var sID = 'sID';
var sURL = 'sURL';

for(var i = 0; i < rowNum; i++){
var table = document.getElementById("myTable");
Expand All @@ -53,14 +55,18 @@ <h1 style="text-align:center;">QR Code OOB Authentication</h1>
//cell1.innerHTML = "NEW CELL2";
cell1.id = tdID + ((i*colNum)+j);
var txt = "";
txt += "<p id=" +servID + ((i*colNum)+j) +">" + "</p>";
txt += "<p id="+sID + ((i*colNum)+j) +"> " + "</p>";
txt += "<p id=" + servID + ((i*colNum)+j) +">" + "</p>";
txt += "<p id="+ sURL + ((i*colNum)+j) +"> " + "</p>";
txt += "<p id="+ sID + ((i*colNum)+j) +"> " + "</p>";
cell1.innerHTML = txt;
}
}
//console.log(rowNum +" "+ colNum);
}

function nthOccurance(string, char, nth) {
return string.split(char,nth).join(char).length;
}

function readTextFile(file)
{
Expand All @@ -81,6 +87,7 @@ <h1 style="text-align:center;">QR Code OOB Authentication</h1>
var tdID = 'idnum';
var servID ='servid';
var sID = 'sID';
var sURL = 'sURL';
var lines = allText.split('\n');
var ntd = lines.length - 1;
if(max_ntd >= ntd){
Expand All @@ -91,15 +98,17 @@ <h1 style="text-align:center;">QR Code OOB Authentication</h1>
//iDiv.id = divID + line;
//document.getElementsByTagName('body')[0].appendChild(iDiv);
var qrcode = new QRCode(document.getElementById(tdID + line), {
width : 200,
height : 200
width : 400,
height : 400
});
qrcode.makeCode(array[2]);
var p1 = document.getElementById(servID + line);
var p2 = document.getElementById(sID + line);
p1.innerHTML = "SSID:" + array[0];
p2.innerHTML = "SERVER NAME:" + array[1];

var p2 = document.getElementById(sURL + line);
var p3 = document.getElementById(sID + line);
p1.innerHTML = "SSID: <span style='color:red'> " + array[0]+"</span>";
var url=array[2].toString();
p2.innerHTML = "Server: <span style='color:red'>" + url.substring(0,nthOccurance(url,'/',3))+"</span>";
p3.innerHTML = "Server Name: <span style='color:red'>" + array[1]+"</span>";

//var fileDisplayArea = document.getElementById(divID + line);
//fileDisplayArea.innerText = lines[line];
Expand All @@ -114,14 +123,17 @@ <h1 style="text-align:center;">QR Code OOB Authentication</h1>
for(var line = 0; line < max_ntd; line++){
var array = lines[line].split(',');
var qrcode = new QRCode(document.getElementById(tdID + line), {
width : 200,
height : 200
width : 400,
height : 400
});
qrcode.makeCode(array[2]);
var p1 = document.getElementById(servID + line);
var p2 = document.getElementById(sID + line);
p1.innerHTML = "SSID:" + array[0];
p2.innerHTML = "SERVER NAME:" + array[1];
var p2 = document.getElementById(sURL + line);
var p3 = document.getElementById(sID + line);
p1.innerHTML = "SSID: <span style='color:red'>" + array[0]+"</span>";
var url=array[2].toString();
p2.innerHTML = "Server: <span style='color:red'>" + url.substring(0,nthOccurance(url,'/',3))+"</span>";
p3.innerHTML = "Server Name: <span style='color:red'>" + array[1]+"</span>";
}

setTimeout(intrFunc, 6000, (ntd-max_ntd));
Expand Down Expand Up @@ -155,9 +167,12 @@ <h1 style="text-align:center;">QR Code OOB Authentication</h1>
});
qrcode.makeCode(array[2]);
var p1 = document.getElementById(servID + line);
var p2 = document.getElementById(sID + line);
p1.innerHTML = "SSID:" + array[0];
p2.innerHTML = "SERVER NAME:" + array[1];
var p2 = document.getElementById(sURL + line);
var p3 = document.getElementById(sID + line);
p1.innerHTML = "SSID: <span style='color:red'>" + array[0]+"</span>";
var url=array[2].toString();
p2.innerHTML = "Server: <span style='color:red'>" + url.substring(0,nthOccurance(url,'/',3))+"</span>";
p3.innerHTML = "Server Name: <span style='color:red'>" + array[1]+"</span>";
left = left - 1;
}
//alert("here" + left);
Expand Down

0 comments on commit f687723

Please sign in to comment.