Commit 678043f8 by sameer79 Committed by Sarath Subramanian

ATLAS-3438: UI: Show shell entity count in metric popup.

parent 4b8db750
......@@ -19,6 +19,7 @@
<th>Entities</th>
<th>Active <span data-id="activeEntity"></span></th>
<th>Deleted <span data-id="deletedEntity"></span></th>
<th>Shell <span data-id="shellEntity"></span></th>
</tr>
</thead>
{{#if data}}
......@@ -36,6 +37,11 @@
{{else}}
<td>0</td>
{{/if}}
{{#if this.shell}}
<td>{{this.shell}}</td>
{{else}}
<td>0</td>
{{/if}}
</tr>
{{/each}}
</tbody>
......
......@@ -128,18 +128,24 @@ define(['require',
entityData = data.entity,
activeEntities = entityData.entityActive || {},
deletedEntities = entityData.entityDeleted || {},
shellEntities = entityData.entityShell || {},
stats = {},
activeEntityCount = 0,
deletedEntityCount = 0,
shellEntityCount = 0,
createEntityData = function(opt) {
var entityData = opt.entityData,
type = opt.type;
_.each(entityData, function(val, key) {
var intVal = _.isUndefined(val) ? 0 : val;
if (type == "active") {
if (type === "active") {
activeEntityCount += intVal;
} else {
}
if(type === "deleted"){
deletedEntityCount += intVal;
}
if(type === "shell") {
shellEntityCount += intVal
}
intVal = _.numberFormatWithComa(intVal)
if (stats[key]) {
......@@ -158,6 +164,10 @@ define(['require',
"entityData": deletedEntities,
"type": "deleted"
});
createEntityData({
"entityData": shellEntities,
"type": "shell"
});
if (!_.isEmpty(stats)) {
that.ui.entityCard.html(
EntityTable({
......@@ -166,6 +176,7 @@ define(['require',
);
that.$('[data-id="activeEntity"]').html("&nbsp;(" + _.numberFormatWithComa(activeEntityCount) + ")");
that.$('[data-id="deletedEntity"]').html("&nbsp;(" + _.numberFormatWithComa(deletedEntityCount) + ")");
that.$('[data-id="shellEntity"]').html("&nbsp;(" + _.numberFormatWithComa(shellEntityCount) + ")");
that.ui.entityHeader.html("&nbsp;(" + _.numberFormatWithComa(data.general.entityCount) + ")");
}
},
......
......@@ -19,6 +19,7 @@
<th>Entities</th>
<th>Active <span data-id="activeEntity"></span></th>
<th>Deleted <span data-id="deletedEntity"></span></th>
<th>Shell <span data-id="shellEntity"></span></th>
</tr>
</thead>
{{#if data}}
......@@ -36,6 +37,11 @@
{{else}}
<td>0</td>
{{/if}}
{{#if this.shell}}
<td>{{this.shell}}</td>
{{else}}
<td>0</td>
{{/if}}
</tr>
{{/each}}
</tbody>
......
......@@ -128,9 +128,11 @@ define(['require',
entityData = data.entity,
activeEntities = entityData.entityActive || {},
deletedEntities = entityData.entityDeleted || {},
shellEntities = entityData.entityShell || {},
stats = {},
activeEntityCount = 0,
deletedEntityCount = 0,
shellEntityCount = 0,
createEntityData = function(opt) {
var entityData = opt.entityData,
type = opt.type;
......@@ -138,8 +140,12 @@ define(['require',
var intVal = _.isUndefined(val) ? 0 : val;
if (type == "active") {
activeEntityCount += intVal;
} else {
}
if(type == "deleted"){
deletedEntityCount += intVal;
}
if(type == "shell") {
shellEntityCount += intVal
}
intVal = _.numberFormatWithComa(intVal)
if (stats[key]) {
......@@ -158,6 +164,10 @@ define(['require',
"entityData": deletedEntities,
"type": "deleted"
});
createEntityData({
"entityData": shellEntities,
"type": "shell"
});
if (!_.isEmpty(stats)) {
that.ui.entityCard.html(
EntityTable({
......@@ -166,6 +176,7 @@ define(['require',
);
that.$('[data-id="activeEntity"]').html("&nbsp;(" + _.numberFormatWithComa(activeEntityCount) + ")");
that.$('[data-id="deletedEntity"]').html("&nbsp;(" + _.numberFormatWithComa(deletedEntityCount) + ")");
that.$('[data-id="shellEntity"]').html("&nbsp;(" + _.numberFormatWithComa(shellEntityCount) + ")");
that.ui.entityHeader.html("&nbsp;(" + _.numberFormatWithComa(data.general.entityCount) + ")");
}
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment