adding group tile

merge-requests/1/head
Rasika Perera 9 years ago
parent 9a49bd4786
commit 7ac755a33f

@ -105,7 +105,7 @@ if (uriMatcher.match("/{context}/api/device/sketch/download/{downloadId}")) {
sketchGenerateLinkEndPoint = deviceManagerService + "/device/" + sketchType + "/generate_link"; sketchGenerateLinkEndPoint = deviceManagerService + "/device/" + sketchType + "/generate_link";
var fileId = get(sketchGenerateLinkEndPoint + "?owner=" + user.username, null, "text"); var fileId = get(sketchGenerateLinkEndPoint + "?owner=" + user.username, null, "text");
result = "curl -k " + carbonHttpsServletTransport + constants.WEB_APP_CONTEXT + "/api/device/sketch/download/" + fileId.data + " > agent.zip"; result = "curl -k " + carbonHttpsServletTransport + constants.WEB_APP_CONTEXT + "/api/device/sketch/download/" + fileId.data;
} }
} }
@ -193,7 +193,7 @@ if (uriMatcher.match("/{context}/api/device/sketch/download/{downloadId}")) {
count++; count++;
} }
} }
result.data = count; result = count.toString();
} else if (uriMatcher.match("/{context}/api/devices/types")) { } else if (uriMatcher.match("/{context}/api/devices/types")) {

@ -59,8 +59,7 @@ if (uriMatcher.match("/{context}/api/policies/update")) {
result = 500; result = 500;
} }
} else if (uriMatcher.match("/{context}/api/policies/count")) { } else if (uriMatcher.match("/{context}/api/policies/count")) {
result = {} result = policyModule.getPolicies().length.toString();
result.data = policyModule.getPolicies().length;
} }
// returning the result. // returning the result.

@ -141,8 +141,7 @@ if (uriMatcher.match("/{context}/api/user/login/")) {
result = userModule.getUsers(); result = userModule.getUsers();
} else if (uriMatcher.match("/{context}/api/users/count")) { } else if (uriMatcher.match("/{context}/api/users/count")) {
result = {}; result = userModule.getUsers().length;
result.data = userModule.getUsers().length;
} }
// returning the result. // returning the result.

@ -59,6 +59,34 @@
</div> </div>
</div> </div>
{{/if}} {{/if}}
<div class="col-md-4">
<div class="wr-stats-board-tile">
<div class="tile-name">Groups</div>
<div>
<div class="tile-icon"><i class="fw fw-policy"></i></div>
<div class="tile-stats">
<span id="group-count">Loading...</span>
<span class="tile-stats-free">
<a href="groups">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-view fw-stack-1x"></i>
</span>
View
</a>
<a href="groups/add-group">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-add fw-stack-1x"></i>
</span>
Add
</a>
</span>
</div>
</div>
</div>
</div>
<div class="col-md-4"> <div class="col-md-4">
<div class="wr-stats-board-tile"> <div class="wr-stats-board-tile">
<div class="tile-name">Policies</div> <div class="tile-name">Policies</div>

@ -2,7 +2,7 @@ var updateStats = function (serviceURL, id) {
invokerUtil.get( invokerUtil.get(
serviceURL, serviceURL,
function (result) { function (result) {
$(id).html(JSON.parse(result).data); $(id).html(JSON.parse(result));
}, function (message) { }, function (message) {
console.log(message); console.log(message);
} }
@ -11,6 +11,7 @@ var updateStats = function (serviceURL, id) {
$(document).ready(function(){ $(document).ready(function(){
updateStats("/iotserver/api/devices/count", "#device-count"); updateStats("/iotserver/api/devices/count", "#device-count");
updateStats("/iotserver/api/group/all/count", "#group-count");
updateStats("/iotserver/api/policies/count", "#policy-count"); updateStats("/iotserver/api/policies/count", "#policy-count");
updateStats("/iotserver/api/users/count", "#user-count"); updateStats("/iotserver/api/users/count", "#user-count");
}); });
Loading…
Cancel
Save