changeset 93:c314196f6164

laundry status display Ignore-this: 2152a4e585894a68a40042849d7200be
author drewp@bigasterisk.com
date Sat, 24 Aug 2013 22:11:55 -0700
parents 51ec2baf57be
children 9ea3ea4f382f
files service/laundry/gui.js service/laundry/index.html
diffstat 2 files changed, 24 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/service/laundry/gui.js	Sat Aug 24 22:11:55 2013 -0700
@@ -0,0 +1,7 @@
+'use strict';
+
+function Ctrl($scope, $http) {
+    $http.get("status").success(function (data) {
+        $scope.status = data;
+    });
+}
--- a/service/laundry/index.html	Sat Aug 24 21:48:36 2013 -0700
+++ b/service/laundry/index.html	Sat Aug 24 22:11:55 2013 -0700
@@ -1,12 +1,20 @@
 <!doctype html>
 <html lang="en" ng-app>
-<head>
-  <title>laundry pi</title>
-  <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0rc1/angular.min.js"></script>
-</head>
-<body>
- 
-  <p>Nothing here {{'yet' + '!'}}</p>
- 
-</body>
+  <head>
+    <title>laundry pi</title>
+    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0rc1/angular.min.js"></script>
+    <script src="gui.js"></script>
+  </head>
+  <body ng-controller="Ctrl">
+    <h1>laundry room pi</h1>
+    <div>
+      <div>motion: {{status.motion}}</div>
+      <div>switch1: {{status.switch1}}</div>
+      <div>switch2: {{status.switch2}}</div>
+      <div>switch3: {{status.switch3}}</div>
+      <div>doorClosed: {{status.doorClosed}}</div>
+      <div>orange led: {{status.led}}</div>
+    </div>
+    <div>Status: {{status | json}}</div>
+  </body>
 </html>