-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
103 lines (96 loc) · 4.97 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<!DOCTYPE html>
<html lang="en" ng-app="app">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Prail.Net Pool Monitor</title>
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M"
crossorigin="anonymous">
<style>
/*.iframe-container {
position: relative;
padding-bottom: 56.25%;
padding-top: 35px;
height: 0;
overflow: hidden;
max-width: 430px;
max-height: 250px;
}
.iframe-container iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
max-width: 430px;
max-height: 250px;
}*/
</style>
</head>
<body ng-controller="MainCtrl">
<nav class="navbar navbar-expand-lg fixed-top navbar-dark bg-dark">
<a class="navbar-brand" href="http://www.prail.net" target="_blank" rel="noopener">
<img src="art/logo-full.jpg" width="95" height="30" alt="">
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="#">Pool <span ng-show="temp.field1">({{temp.field1}}°)</span> <span class="sr-only">(current)</span></a>
</li>
</ul>
</div>
</nav>
<div class="container">
<div class="row">
<div class="col-md-12" style="padding-top: 84px;">
<h3 ng-show="temp.field1"><b>Temp:</b> {{temp.field1}}° Fahrenheit</h3>
<h3 ng-show="time"><b>Time:</b> <span data-toggle="tooltip" data-placement="top" title="{{timeLong}}">{{time}}</span></h3>
<iframe width="450" height="260" style="border: 1px solid #cccccc;" src="https://thingspeak.com/channels/328848/charts/1?bgcolor=%23ffffff&color=%23d62020&dynamic=true&results=24&title=Pool+Temp+%2824+Hours%29&type=line&xaxis=Time&yaxis=Temp+Fahrenheit+"
allowfullscreen=""></iframe>
<iframe width="450" height="260" style="border: 1px solid #cccccc;" src="https://thingspeak.com/channels/328848/charts/1?bgcolor=%23ffffff&color=%23d62020&dynamic=true&results=168&title=Pool+Temp+%28This Week%29&type=line&xaxis=Time&yaxis=Temp+Fahrenheit+"
allowfullscreen=""></iframe>
</div>
</div>
</div>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN"
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js" integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4"
crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js" integrity="sha384-h0AbiXch4ZDo7tp9hKZ4TsHbi047NrKGLO3SEJAg45jXxnGIfYzk4Si90RDIqNm1"
crossorigin="anonymous"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.5/angular.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment.min.js" integrity="sha256-1hjUhpc44NwiNg8OwMu2QzJXhD8kcj+sJA3aCQZoUjg="
crossorigin="anonymous"></script>
<script>
angular.module('app', [])
.controller('MainCtrl', function ($http, $scope, $interval) {
function getData() {
$http.get('https://api.thingspeak.com/channels/328848/fields/1.json?results=1')
.then(function (res) {
var feed = res.data.feeds;
var latest = feed[0];
$scope.temp = latest;
$scope.time = moment(latest.created_at).format('h:mm:ss a');
$scope.timeLong = moment(latest.created_at).format('MMMM Do YYYY, h:mm:ss a');
})
.catch(function (err) {
console.log(err);
});
}
getData();
$interval(getData, 15000);
$(function () {
$('[data-toggle="tooltip"]').tooltip()
})
});
</script>
</body>
</html>