Cleaned up in the files. Removed duplicated web files

This commit is contained in:
2017-01-30 22:53:47 +01:00
parent 113e63797f
commit e1fb7759c8
7 changed files with 0 additions and 242 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

View File

@@ -1,98 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="apple-mobile-web-app-capable" content="yes">
<title>Fan Controller</title>
<link href='http://fonts.googleapis.com/css?family=Ubuntu' rel='stylesheet' type='text/css'>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<style type="text/css">
html * {
font-family: 'Ubuntu', sans-serif !important;
}
.myContainer {
margin-top: 20px;
margin-left: auto;
margin-right: auto;
width: 100%;
}
.myBg {
background-color: #eee;
}
.btn {
height: 60px;
width: 120px;
margin-right: 10px;
margin-left: 10px;
}
.state_display {
height: 150px;
width: 80%;
margin-top: 70px;
margin-left: auto;
margin-right: auto;
padding-top: 45px;
background-color: white;
border-style: solid;
border-width: 0px;
border-radius: 4px;
text-align: center;
font-size: 40px;
}
.state_display h4 {
position: absolute;
margin-top: -70px;
}
.footer {
width: 100%;
margin: 0 auto;
position: fixed;
bottom: 0;
padding-bottom: 15px;
text-align: center;
}
</style>
</head>
<body class="myBg">
<div class="myContainer">
<div style="text-align:center; margin-bottom:20px;">
<h2>Fan Controller</h2>
</div>
<hr>
<div style="text-align:center;">
<button class="btn btn-success" id="on" type="submit" onclick="UserAction('on')">ON</button>
<button class="btn btn-danger" id="off" type="submit" onclick="UserAction('off')">OFF</button>
</div>
<div class="state_display">
<h4>Current fan state:</h4>
<span>ON</span>
</div>
<hr>
</div>
</div>
<div class="footer">
<p class="muted">
<small>Powered by C.H.I.P</small>
</p>
<img src="images/chip.png" style="width: 60px;" />
</body>
<script type="text/javascript">
function UserAction(state) {
var xhttp = new XMLHttpRequest();
xhttp.open("POST", state, false);
xhttp.setRequestHeader("Content-type", "application/text");
xhttp.send();
}
</script>
</html>

View File

@@ -1,9 +0,0 @@
#!/usr/bin/env python3
import CHIP_IO.GPIO as GPIO #import the GPIO library
GPIO.setup("CSID0", GPIO.OUT) #set CSID0 as an output
GPIO.output("CSID0", GPIO.LOW) #set CSID0 (LED) LOW (Off)
f = open( 'public/state.txt', 'w' )
f.write('off')
f.close()

View File

@@ -1,9 +0,0 @@
#!/usr/bin/env python3
import CHIP_IO.GPIO as GPIO #import the GPIO library
GPIO.setup("CSID0", GPIO.OUT) #set CSID0 as an output
GPIO.output("CSID0", GPIO.HIGH) #set CSID0 (LED) HIGH (On)
f = open( 'public/state.txt', 'w' )
f.write('on')
f.close()

View File

@@ -1,114 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="apple-mobile-web-app-capable" content="yes">
<title>Fan Controller</title>
<link href='http://fonts.googleapis.com/css?family=Ubuntu' rel='stylesheet' type='text/css'>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<style type="text/css">
html * {
font-family: 'Ubuntu', sans-serif !important;
}
.myContainer {
margin-top: 20px;
margin-left: auto;
margin-right: auto;
width: 100%;
}
.myBg {
background-color: #eee;
}
.btn {
height: 60px;
width: 120px;
margin-right: 10px;
margin-left: 10px;
}
.state_display {
height: 150px;
width: 80%;
margin-top: 70px;
margin-left: auto;
margin-right: auto;
padding-top: 45px;
background-color: white;
border-style: solid;
border-width: 0px;
border-radius: 4px;
text-align: center;
font-size: 55px;
}
.state_display h4 {
position: absolute;
margin-top: -70px;
}
.footer {
width: 100%;
margin: 0 auto;
position: fixed;
bottom: 0;
padding-bottom: 15px;
text-align: center;
}
</style>
</head>
<body class="myBg">
<div class="myContainer">
<div style="text-align:center; margin-bottom:20px;">
<h2>Fan Controller</h2>
</div>
<hr>
<div style="text-align:center;">
<button class="btn btn-success" id="on" type="submit" onclick="UserAction('on')">ON</button>
<button class="btn btn-danger" id="off" type="submit" onclick="UserAction('off')">OFF</button>
</div>
<div class="state_display">
<h4>Current fan state:</h4>
<span id="state">ON</span>
</div>
<hr>
</div>
</div>
<div class="footer">
<p class="muted">
<small>Powered by C.H.I.P</small>
</p>
<img src="images/chip.png" style="width: 60px;" />
</body>
<script type="text/javascript">
function UserAction(state) {
var xhttp = new XMLHttpRequest();
xhttp.open("POST", state, false);
xhttp.setRequestHeader("Content-type", "application/text");
xhttp.send();
console.log(xhttp.status)
if (xhttp.status == "200") {
var stateDisplay = document.getElementById('state');
stateDisplay.innerText = xhttp.responseText.toUpperCase();
}
}
window.onload = function() {
var xhttp = new XMLHttpRequest();
xhttp.open("GET", "state", false);
xhttp.send();
if (xhttp.status == "200") {
var stateDisplay = document.getElementById('state');
stateDisplay.innerText = xhttp.responseText.toUpperCase();
}
}
</script>
</html>

View File

@@ -1 +0,0 @@
off

View File

@@ -1,11 +0,0 @@
.jumbotron {
}
.buttons {
width: 100%;
}
.buttons button {
width: 90%;
}