Add android specific ui components

charithag 9 years ago
parent 2db7585488
commit 98ac42e801

@ -1,49 +1,49 @@
function getAllDevices() { function getAllDevices() {
var getDevicesRequest = $.ajax({ var getDevicesRequest = $.ajax({
url: "api/devices/all/", url: "api/devices/all/",
method: "GET", method: "GET",
contentType: "application/json" contentType: "application/json"
}); });
getDevicesRequest.done(function (data) { getDevicesRequest.done(function (data) {
updateDevicesTable(JSON.parse(data)); updateDevicesTable(JSON.parse(data));
}); });
getDevicesRequest.fail(function (jqXHR, textStatus) { getDevicesRequest.fail(function (jqXHR, textStatus) {
var err = jqXHR; var err = jqXHR;
alert("Request failed: " + textStatus); alert("Request failed: " + textStatus);
}); });
} }
function updateDevicesTable(data) { function updateDevicesTable(data) {
devices = data.data.device; devices = data.data.device;
if (devices.length > 0) { if (devices.length > 0) {
clearTable('devicesTable'); clearTable('devicesTable');
for (var i = 0; i < devices.length; i++) { for (var i = 0; i < devices.length; i++) {
var deviceIdentifier = devices[i].deviceIdentifier; var deviceIdentifier = devices[i].deviceIdentifier;
var deviceName = devices[i].name; var deviceName = devices[i].name;
var deviceType = devices[i].type; var deviceType = devices[i].type;
$('#devicesTable tbody').append( $('#devicesTable tbody').append(
"<tr class='border-top'><th scope='row'>" + deviceIdentifier + "</th>" + "<tr class='border-top'><th scope='row'>" + deviceIdentifier + "</th>" +
"<td>" + deviceName + "</td>" + "<td>" + deviceName + "</td>" +
"<td>" + deviceType + "</td>" + "<td>" + deviceType + "</td>" +
"<td class='float-right border-top '>" + "<td class='float-right border-top '>" +
"<input type='hidden' name='deviceType' value='" + deviceType + "' >" + "<input type='hidden' name='deviceType' value='" + deviceType + "' >" +
"<button class='btn-black-action' name='deviceId' value='" + deviceIdentifier + "'>" + "<button class='btn-black-action' name='deviceId' value='" + deviceIdentifier + "'>" +
"<i class='fw fw-view padding-right'></i>View</button>" + "<i class='fw fw-view padding-right'></i>View</button>" +
"<button class='btn-black-action' name='deviceId' value='" + deviceIdentifier + "'>" + "<button class='btn-black-action' name='deviceId' value='" + deviceIdentifier + "'>" +
"<i class='fw fw-edit padding-right'></i>Edit</button>" + "<i class='fw fw-edit padding-right'></i>Edit</button>" +
"<button class='btn-black-action' name='deviceId' value='" + deviceIdentifier + "'>" + "<button class='btn-black-action' name='deviceId' value='" + deviceIdentifier + "'>" +
"<i class='fw fw-delete padding-right'></i>Remove</button>" + "<i class='fw fw-delete padding-right'></i>Remove</button>" +
"</td></tr>"); "</td></tr>");
} }
} }
} }
function clearTable(tableId) { function clearTable(tableId) {
$('#' + tableId + ' tbody > tr').remove(); $('#' + tableId + ' tbody > tr').remove();
} }
$(document).ready(function () { $(document).ready(function () {
getAllDevices(); getAllDevices();
}); });

@ -1,56 +1,56 @@
{{#zone "main"}} {{#zone "main"}}
<!-- new markup --> <!-- new markup -->
<!-- secondary header - app bar --> <!-- secondary header - app bar -->
<div id="nav" class="row wr-app-bar"> <div id="nav" class="row wr-app-bar">
<div class="wr-action-container"> <div class="wr-action-container">
<div class="wr-action-btn-bar"> <div class="wr-action-btn-bar">
<a href="javascript:openCollapsedNav()" class="cu-btn wr-hidden-nav-toggle-btn"> <a href="javascript:openCollapsedNav()" class="cu-btn wr-hidden-nav-toggle-btn">
<i class="fw fw-tiles fw-2x"></i> <i class="fw fw-tiles fw-2x"></i>
</a><a class="cu-btn page-title" href='javascript:location.reload();'> </a><a class="cu-btn page-title" href='javascript:location.reload();'>
<span class="fw-stack"></span> <span class="fw-stack"></span>
{{title}} {{title}}
</a>{{#each currentActions}}<a href="{{url}}" class="cu-btn {{class}}"> </a>{{#each currentActions}}<a href="{{url}}" class="cu-btn {{class}}">
<span class="fw-stack"> <span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i> <i class="fw fw-ring fw-stack-2x"></i>
<i class="fw {{icon}} fw-stack-1x"></i> <i class="fw {{icon}} fw-stack-1x"></i>
</span> </span>
{{title}} {{title}}
</a> </a>
{{/each}}{{#if enableBack}}<a href="javascript:history.go(-1)" class="cu-btn"> {{/each}}{{#if enableBack}}<a href="javascript:history.go(-1)" class="cu-btn">
<span class="fw-stack"> <span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i> <i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-left-arrow fw-stack-1x"></i> <i class="fw fw-left-arrow fw-stack-1x"></i>
</span> </span>
Go Back Go Back
</a> </a>
{{/if}} {{/if}}
<a href="javascript:toggleNotificationbar()" class="cu-btn wr-notification-toggle-btn"> <a href="javascript:toggleNotificationbar()" class="cu-btn wr-notification-toggle-btn">
<span class="fw-stack-md"> <span class="fw-stack-md">
<i class="fw fw-bell fw-stack-1-5x"></i> <i class="fw fw-bell fw-stack-1-5x"></i>
</span> </span>
<span class="wr-notification-bubble">0</span> <span class="wr-notification-bubble">0</span>
</a> </a>
</div> </div>
</div> </div>
</div> </div>
<!-- secondary header - app bar --> <!-- secondary header - app bar -->
<!-- common navigation --> <!-- common navigation -->
<div id="hiddenNav" class="wr-hidden-nav"> <div id="hiddenNav" class="wr-hidden-nav">
<ul> <ul>
<li><a href="/iotserver/dashboard"><i class="fw fw-dashboard"></i>Dashboard</a></li> <li><a href="/iotserver/dashboard"><i class="fw fw-dashboard"></i>Dashboard</a></li>
<li><a href="/iotserver/devices"><i class="fw fw-devices"></i>My Devices</a></li> <li><a href="/iotserver/devices"><i class="fw fw-devices"></i>My Devices</a></li>
<li><a href="/iotserver/groups"><i class="fw fw-grouping"></i>My Groups</a></li> <li><a href="/iotserver/groups"><i class="fw fw-grouping"></i>My Groups</a></li>
{{#if permissions.ADD_USER}} {{#if permissions.ADD_USER}}
<li><a href="/iotserver/users"><i class="fw fw-user"></i>User Management</a></li> <li><a href="/iotserver/users"><i class="fw fw-user"></i>User Management</a></li>
{{/if}} {{/if}}
<li><a href="/iotserver/policies"><i class="fw fw-policy"></i>Policy Management</a></li> <li><a href="/iotserver/policies"><i class="fw fw-policy"></i>Policy Management</a></li>
</ul> </ul>
</div> </div>
<!-- /common navigation --> <!-- /common navigation -->
{{/zone}} {{/zone}}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save