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-25 21:03:48 +01:00
|
|
|
<script type="text/ng-template" id="/home.html" >
|
|
|
|
<modal show="modal.shown" >
|
|
|
|
<h2>Add new RC Switch</h2>
|
2016-02-27 21:11:49 +01:00
|
|
|
<form ng-submit="addRC()" ng-model="newrc">
|
|
|
|
<input class="u-full-width" ng-model="newrc.name" placeholder="Name" type="text">
|
2016-02-25 21:03:48 +01:00
|
|
|
<div class="row">
|
|
|
|
<div class="six columns">
|
2016-02-27 21:11:49 +01:00
|
|
|
<input class="u-full-width" ng-model="newrc.on_value" placeholder="On Value" type="text">
|
2016-02-25 21:03:48 +01:00
|
|
|
</div>
|
|
|
|
<div class="six columns">
|
2016-02-27 21:11:49 +01:00
|
|
|
<input class="u-full-width" ng-model="newrc.off_value" placeholder="Off Value" type="text">
|
2016-02-25 21:03:48 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
2016-02-27 21:11:49 +01:00
|
|
|
<label>Is this a tristate switch? <input ng-model="newrc.tristate" type="checkbox" ></input></label>
|
2016-02-28 20:47:25 +01:00
|
|
|
<button type="submit" ng-hide="modal.delete" class="button-primary">Add</button>
|
|
|
|
<button type="button" ng-click="changeRC()" ng-show="modal.delete" class="button-primary">Change</button>
|
2016-02-27 23:14:35 +01:00
|
|
|
<button type="button" ng-click="deleteRC()" ng-show="modal.delete" class="button-primary red">Delete</button>
|
2016-02-27 21:11:49 +01:00
|
|
|
<button type="button" ng-click="toggleModal()" class="button">Cancel</button>
|
2016-02-25 21:03:48 +01:00
|
|
|
</form>
|
|
|
|
</modal>
|
|
|
|
|
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;">
|
2016-02-27 21:11:49 +01:00
|
|
|
<span class="symbol" ng-click='toggleModal()' >+</span>
|
2016-02-25 19:41:28 +01:00
|
|
|
</th>
|
2016-02-17 23:18:23 +01:00
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr ng-repeat="RC in RCs | orderBy:'switch_id'">
|
2016-02-27 23:14:35 +01:00
|
|
|
<td><span ng-click="toggleModal(RC)" class="symbol">☰</span> {{RC.name}} </td>
|
2016-02-27 21:11:49 +01:00
|
|
|
<td style="text-align: right;">
|
|
|
|
<button class="sign" ng-click="sendRC(RC)" ng-class="{'true':'button-primary','false':'button'}[RC.state]" type="submit" >⏻</button>
|
|
|
|
</td>
|
2016-02-17 23:18:23 +01:00
|
|
|
</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-23 17:47:31 +01:00
|
|
|
</script>
|
|
|
|
|
2016-02-25 19:41:28 +01:00
|
|
|
<script type="text/ng-template" id="/modal.html">
|
2016-02-27 21:11:49 +01:00
|
|
|
<div class="ng-modal" ng-show="show" >
|
|
|
|
<div class="ng-modal-overlay" ng-click="hideModal()"></div>
|
|
|
|
<div class="ng-modal-dialog" ng-style="dialogStyle">
|
|
|
|
<div class="ng-modal-dialog-content" ng-transclude></div>
|
2016-02-25 19:41:28 +01:00
|
|
|
</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>
|