Add android specific ui components

charithag 9 years ago
parent 2db7585488
commit 98ac42e801

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

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

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

Loading…
Cancel
Save