2016-01-12 17:49:13 +01:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
2016-02-23 18:44:17 +01:00
|
|
|
<title>Trev</title>
|
2016-01-14 00:01:40 +01:00
|
|
|
|
|
|
|
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
2016-01-12 17:49:13 +01:00
|
|
|
|
2016-01-13 23:46:12 +01:00
|
|
|
<link rel="stylesheet" href="/stylesheets/normalize.css">
|
|
|
|
<link rel="stylesheet" href="/stylesheets/skeleton.css">
|
|
|
|
<link rel="stylesheet" href="/stylesheets/style.css">
|
|
|
|
|
|
|
|
<script src="/javascripts/angular.min.js"></script>
|
|
|
|
<script src="/javascripts/angular-ui-router.min.js"></script>
|
|
|
|
<script src="/javascripts/angularApp.js"></script>
|
2016-01-12 17:49:13 +01:00
|
|
|
|
|
|
|
</head>
|
|
|
|
<body ng-app="autome">
|
2016-02-23 17:47:31 +01:00
|
|
|
|
2016-01-13 23:46:12 +01:00
|
|
|
<div class="container">
|
2016-01-12 17:49:13 +01:00
|
|
|
<div class="row">
|
2016-01-13 23:46:12 +01:00
|
|
|
<div class="twelve columns">
|
2016-02-23 17:47:31 +01:00
|
|
|
<nav ng-controller="NavCtrl">
|
|
|
|
<a href="/#/home"><h4>Trev</h4></a>
|
|
|
|
<ul>
|
|
|
|
<li ng-hide="isLoggedIn()"><a href="/#/login">Log in</a></li>
|
|
|
|
<li ng-show="isLoggedIn()"><a href="/#/register">Add user</a></li>
|
|
|
|
<li ng-show="isLoggedIn()"><a href="/#/login" ng-click="logOut()">Log out</a></li>
|
|
|
|
<li ng-show="isLoggedIn()" class="user" >{{ currentUser() }}</li>
|
|
|
|
</ul>
|
|
|
|
</nav>
|
2016-01-12 17:49:13 +01:00
|
|
|
<ui-view></ui-view>
|
|
|
|
</div>
|
|
|
|
</div>
|
2016-01-13 23:46:12 +01:00
|
|
|
</div>
|
2016-01-12 17:49:13 +01:00
|
|
|
|
2016-02-23 17:47:31 +01:00
|
|
|
<script type="text/ng-template" id="/home.html">
|
2016-02-17 23:18:23 +01:00
|
|
|
<table class="u-full-width">
|
|
|
|
<thead>
|
2016-02-18 15:48:57 +01:00
|
|
|
<th>RC Switches</th>
|
2016-02-25 19:41:28 +01:00
|
|
|
<th style="text-align: right;">
|
|
|
|
<button ng-click='toggleModal()' class="sign">+</button>
|
|
|
|
</th>
|
2016-02-17 23:18:23 +01:00
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr ng-repeat="RC in RCs | orderBy:'switch_id'">
|
|
|
|
<td> {{RC.name}} </td>
|
|
|
|
<td>
|
2016-02-18 17:42:13 +01:00
|
|
|
<button ng-click="sendRC(RC)" ng-class="{'true':'button-primary','false':'button'}[RC.state]" type="submit" >Toggle RC</button>
|
2016-02-17 23:18:23 +01:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
2016-01-21 22:01:57 +01:00
|
|
|
<form ng-submit="irTest()" style="margin-top:30px;">
|
2016-01-21 23:07:53 +01:00
|
|
|
<button type="submit" class="button-primary">IR</button>
|
2016-01-21 22:01:57 +01:00
|
|
|
</form>
|
2016-02-25 19:41:28 +01:00
|
|
|
|
|
|
|
<modal show="modalShown">
|
|
|
|
<h2>Add new RC Switch</h2>
|
|
|
|
<form ng-submit="addRC()">
|
|
|
|
<input class="u-full-width" placeholder="Name" type="text">
|
|
|
|
<div class="row">
|
|
|
|
<div class="six columns">
|
|
|
|
<input class="u-full-width" placeholder="On Value" type="text">
|
|
|
|
</div>
|
|
|
|
<div class="six columns">
|
|
|
|
<input class="u-full-width" placeholder="Off Value" type="text">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<label>Is this a decimal switch? <input type="checkbox" ></input></label>
|
|
|
|
<button type="submit" ng-click="toggleModal()" class="button">Cancel</button>
|
|
|
|
<button type="submit" class="button-primary">Add</button>
|
|
|
|
</form>
|
|
|
|
</modal>
|
2016-02-23 17:47:31 +01:00
|
|
|
</script>
|
|
|
|
|
2016-02-25 19:41:28 +01:00
|
|
|
<script type="text/ng-template" id="/modal.html">
|
|
|
|
<div class="modal" ng-show="show">
|
|
|
|
<div class="modal-overlay" ng-click="hideModal()"></div>
|
|
|
|
<div class="modal-dialog" ng-style="dialogStyle">
|
|
|
|
<div class="modal-dialog-content" ng-transclude></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</script>
|
|
|
|
|
2016-02-23 17:47:31 +01:00
|
|
|
<script type="text/ng-template" id="/register.html">
|
|
|
|
<div ng-show="error">
|
|
|
|
<span class="errorm">{{ error.message }}</span>
|
|
|
|
</div>
|
|
|
|
|
2016-02-25 19:41:28 +01:00
|
|
|
<form ng-submit="register()" style="margin-top:30px;">
|
2016-02-23 17:47:31 +01:00
|
|
|
<h3>Register</h3>
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<div class="six columns">
|
|
|
|
<label>Username</label>
|
|
|
|
<input type="text"
|
|
|
|
class="u-full-width"
|
|
|
|
placeholder="Username"
|
|
|
|
ng-model="user.username"></input>
|
|
|
|
</div>
|
|
|
|
<div class="six columns">
|
|
|
|
<label>Password</label>
|
|
|
|
<input type="password"
|
|
|
|
class="u-full-width"
|
|
|
|
placeholder="Password"
|
|
|
|
ng-model="user.password"></input>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<button type="submit" class="button-primary">Register</button>
|
|
|
|
</form>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<script type="text/ng-template" id="/login.html">
|
|
|
|
<div ng-show="error">
|
|
|
|
<span class="errorm">{{ error.message }}</span>
|
2016-01-13 23:46:12 +01:00
|
|
|
</div>
|
2016-02-23 17:47:31 +01:00
|
|
|
|
|
|
|
<form ng-submit="logIn()"
|
|
|
|
style="margin-top:30px;">
|
|
|
|
<h3>Log in</h3>
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<div class="six columns">
|
|
|
|
<label>Username</label>
|
|
|
|
<input type="text"
|
|
|
|
class="u-full-width"
|
|
|
|
placeholder="Username"
|
|
|
|
ng-model="user.username"></input>
|
|
|
|
</div>
|
|
|
|
<div class="six columns">
|
|
|
|
<label>Password</label>
|
|
|
|
<input type="password"
|
|
|
|
class="u-full-width"
|
|
|
|
placeholder="Password"
|
|
|
|
ng-model="user.password"></input>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<button type="submit" class="button-primary">Log in</button>
|
|
|
|
</form>
|
2016-01-13 23:46:12 +01:00
|
|
|
</script>
|
2016-01-12 17:49:13 +01:00
|
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|