fixing jaggery errors

merge-requests/1/head
Rasika 10 years ago
parent c0b573e473
commit e0d6cf2554

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

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

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

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

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

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

Loading…
Cancel
Save