adding group tile

application-manager-new
Rasika Perera 10 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";
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++;
}
}
result.data = count;
result = count.toString();
} else if (uriMatcher.match("/{context}/api/devices/types")) {

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

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

@ -59,6 +59,34 @@
</div>
</div>
{{/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="wr-stats-board-tile">
<div class="tile-name">Policies</div>

@ -2,7 +2,7 @@ var updateStats = function (serviceURL, id) {
invokerUtil.get(
serviceURL,
function (result) {
$(id).html(JSON.parse(result).data);
$(id).html(JSON.parse(result));
}, function (message) {
console.log(message);
}
@ -11,6 +11,7 @@ var updateStats = function (serviceURL, id) {
$(document).ready(function(){
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/users/count", "#user-count");
});
Loading…
Cancel
Save