fixing jaggery errors

application-manager-new
Rasika 10 years ago
parent c0b573e473
commit e0d6cf2554

@ -9,12 +9,6 @@
</div> </div>
</div> </div>
</div> </div>
{{#each devices.devices}}
{{name}}<br/>
{{id}}<br/><br/>
{{/each}}
<div class="row margin-double padding-double"> <div class="row margin-double padding-double">
<table class="table table-hover border"> <table class="table table-hover border">
<thead> <thead>
@ -25,76 +19,26 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr class="border-top">
<th scope="row">001</th>
<td>RaspberryPi</td>
<td class="float-right border-top ">
<form method="GET" action="{{myDevicePath}}"> <form method="GET" action="{{myDevicePath}}">
<button class="btn-black-action" name="view" value=""> {{#each devices.device}}
<i class="fw fw-view padding-right"></i>View
</button>
<button class="btn-black-action" name="edit" value="">
<i class="fw fw-edit padding-right"></i>Edit
</button>
<button class="btn-black-action" name="remove" value="">
<i class="fw fw-delete padding-right"></i>Remove
</button>
</form>
</td>
</tr>
<tr class="border-top">
<th scope="row">002</th>
<td>ArduinoUno</td>
<td class="float-right border-top">
<form method="GET" action="{{myDevicePath}}">
<button class="btn-black-action" name="view" value="">
<i class="fw fw-view padding-right"></i>View
</button>
<button class="btn-black-action" name="edit" value="">
<i class="fw fw-edit padding-right"></i>Edit
</button>
<button class="btn-black-action" name="remove" value="">
<i class="fw fw-delete padding-right"></i>Remove
</button>
</form>
</td>
</tr>
<tr class="border-top"> <tr class="border-top">
<th scope="row">003</th> <th scope="row">{{deviceIdentifier}}</th>
<td>BeagleBone</td> <td>{{name}}</td>
<td class="float-right border-top "> <td class="float-right border-top ">
<form method="GET" action="{{myDevicePath}}"> <button class="btn-black-action" name="deviceId"
<button class="btn-black-action" name="view" value=""> value="{{deviceIdentifier}}">
<i class="fw fw-view padding-right"></i>View <i class="fw fw-view padding-right"></i>View
</button> </button>
<button class="btn-black-action" name="edit" value=""> <button class="btn-black-action" name="deviceId" value="{{deviceIdentifier}}">
<i class="fw fw-edit padding-right"></i>Edit <i class="fw fw-edit padding-right"></i>Edit
</button> </button>
<button class="btn-black-action" name="remove" value=""> <button class="btn-black-action" name="deviceId" value="{{deviceIdentifier}}">
<i class="fw fw-delete padding-right"></i>Remove <i class="fw fw-delete padding-right"></i>Remove
</button> </button>
</form>
</td> </td>
</tr> </tr>
<tr class="border-top"> {{/each}}
<th scope="row">003</th>
<td>Fire Alarm</td>
<td class="float-right border-top">
<form method="GET" action="{{myDevicePath}}">
<button class="btn-black-action" name="view" value="">
<i class="fw fw-view padding-right"></i>View
</button>
<button class="btn-black-action" name="edit" value="">
<i class="fw fw-edit padding-right"></i>Edit
</button>
<button class="btn-black-action" name="remove" value="">
<i class="fw fw-delete padding-right"></i>Remove
</button>
</form> </form>
</td>
</tr>
</tbody> </tbody>
</table> </table>
</div> </div>

@ -1,5 +1,5 @@
function onRequest(context) { function onRequest(context) {
context.myDevicePath = "mydevice"; context.myDevicePath = "/iot/mydevice";
var constants = require("/modules/constants.js"); var constants = require("/modules/constants.js");
var httpReq = new XMLHttpRequest(); var httpReq = new XMLHttpRequest();
@ -7,28 +7,29 @@ function onRequest(context) {
var endPoint = "http://localhost:9763/iotdevices/DevicesManager/getDevices?username=" + user.username; var endPoint = "http://localhost:9763/iotdevices/DevicesManager/getDevices?username=" + user.username;
// //
httpReq.open("GET", endPoint, false); httpReq.open("GET", endPoint, false);
log.info("%%%%"); httpReq.setRequestHeader("Content-type","application/json");
log.info(httpReq.response); httpReq.send();
//
context.devices = { context.devices = JSON.parse(httpReq.responseText);
"devices": [
{"name":"device1",
"id" : 1234
},
{"name":"device2",
"id" : 5678}
]
};
return context; return context;
} }
//
//{ //{
// "devices": [ // "device": [
// {"name":"device1", // {
// "id" : 1234 // "dateOfEnrolment": 1432978481443,
// "dateOfLastUpdate": 1432978481443,
// "deviceIdentifier": "qhnva32dy2ck",
// "deviceTypeId": 1,
// "id": 1,
// "name": "rasikas_firealarm_qhn",
// "owner": "rasika",
// "properties": {
// "name": "DEVICE_NAME",
// "value": "rasikas_firealarm_qhn"
// }, // },
// {"name":"device2", // "status": "ACTIVE",
// "id" : 5678} // "type": "firealarm"
// }
//] //]
//} //}

@ -25,6 +25,9 @@
<li><a href="#">GUIDE</a></li> <li><a href="#">GUIDE</a></li>
<li><a href="#">SUPPORT</a></li> <li><a href="#">SUPPORT</a></li>
<li><a href="#">COMMUNITY</a></li> <li><a href="#">COMMUNITY</a></li>
{{#if user}}
<li><a href="/iot/alldevices">MY DEVICES</a></li>
{{/if}}
</ul> </ul>
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">

@ -40,10 +40,6 @@
<button class="blue-btn margin-right" type="submit">Create <button class="blue-btn margin-right" type="submit">Create
Sketch Sketch
for Ethernet</button> for Ethernet</button>
<button class="blue-btn" type="button" onclick="document
.location
.href='mydevice'">My
Devices</button>
</form> </form>
</div> </div>

@ -34,8 +34,8 @@
</div> </div>
<div class="right margin-right"> <div class="right margin-right">
<input class="right margin-right" id="date-range1" size="60" value=""> <input class="right margin-right" id="date-range1" size="60" value="" style="margin-top: 20px">
<button type="button" id="btn-draw-graphs" class="btn btn-primary"> <button type="button" id="btn-draw-graphs" class="btn btn-primary" style="margin-top: 20px">
Draw Graphs Draw Graphs
</button> </button>
</div> </div>

@ -44,8 +44,6 @@ $('#date-range1').dateRangePicker(configObject)
$('#btn-draw-graphs').on('click', function () { $('#btn-draw-graphs').on('click', function () {
var deviceId = $('#device-id').val(); var deviceId = $('#device-id').val();
console.log(deviceId);
console.log(dateRange.date1.toString());
getStats(deviceId, fromDate, toDate); getStats(deviceId, fromDate, toDate);
}) })
@ -63,10 +61,6 @@ function getStats(deviceId, from, to) {
requestData['to'] = to; requestData['to'] = to;
} }
console.log("from: "+from);
console.log("to:" +to);
var getStatsRequest = $.ajax({ var getStatsRequest = $.ajax({
url: "api/stats", url: "api/stats",
method: "GET", method: "GET",

Loading…
Cancel
Save