Commit 678043f8 by sameer79 Committed by Sarath Subramanian

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

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