Commit 22041f51 by Abhishek Kadam Committed by kevalbhatt

ATLAS-3005 Modal for metrics statistic added

Signed-off-by: 's avatarkevalbhatt <kbhatt@apache.org>
parent 83fbe467
......@@ -156,3 +156,9 @@ pre {
font-family: monospace;
}
}
#accordion {
.panel-default > .panel-heading{
cursor: pointer;
}
}
\ No newline at end of file
......@@ -112,9 +112,7 @@ header {
h1 {
&.title {
word-break: break-all;
}
// margin-top: 50px;
} // margin-top: 50px;
margin-bottom: 10px;
font-weight: 600;
@include ellipsis();
......@@ -283,6 +281,29 @@ hr[size="10"] {
z-index: 999;
}
.panel.expand_collapse_panel-icon {
.panel-heading {
.panel-title {
display: inline-block;
}
i.ec-icon:before {
content: "\f078"
}
&.collapsed,
&[aria-expanded="false"] {
i.ec-icon:before {
content: "\f078"
}
}
&[aria-expanded="true"] {
i.ec-icon:before {
content: "\f077"
}
}
}
}
.no-padding {
padding: 0px !important;
}
......
......@@ -73,6 +73,13 @@ define([
},
bindCommonEvents: function() {
var that = this;
$('body').on('click', 'a.show-stat', function() {
require([
'views/common/Statistics',
], function(AboutAtlas) {
new AboutAtlas();
});
});
$('body').on('click', 'li.aboutAtlas', function() {
require([
'views/common/AboutAtlas',
......
<!--
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
-->
<div class="panel-group" id="accordion">
<div class="panel panel-default expand_collapse_panel-icon">
<div class="panel-heading" data-toggle="collapse" href="#collapse1" aria-expanded="true">
<h4 class="panel-title">
<a>Active Entities</a>
</h4>
<div class="btn-group pull-right">
<button type="button" title="Collapse"><i class="ec-icon fa"></i></button>
</div>
</div>
<div id="collapse1" class="panel-collapse collapse in">
<div class="panel-body">
<table class="table table-quickMenu">
<thead>
<tr>
<th>Entity</th>
<th>Count</th>
</tr>
</thead>
<tbody data-id="entityActive">
</tbody>
</table>
</div>
</div>
</div>
<div class="panel panel-default expand_collapse_panel-icon">
<div class="panel-heading" data-toggle="collapse" href="#collapse2">
<h4 class="panel-title">
<a>Deleted Entities</a>
</h4>
<div class="btn-group pull-right">
<button type="button" title="Collapse"><i class="ec-icon fa"></i></button>
</div>
</div>
<div id="collapse2" class="panel-collapse collapse">
<div class="panel-body">
<table class="table table-quickMenu">
<thead>
<tr>
<th>Entity</th>
<th>Count</th>
</tr>
</thead>
<tbody data-id="entityDelete">
</tbody>
</table>
</div>
</div>
</div>
</div>
\ No newline at end of file
......@@ -22,6 +22,7 @@
<li class="details-backbutton"><a href="javascript:void(0);" data-id="backButton"><i class="fa fa-chevron-left"></i> Back To Results</a></li>
</ul>
<div class="btn-group pull-right header-menu ">
<a class="show-stat" href="javascript:void(0);"><i class="fa fa-bar-chart"></i></a>
<a target="_blank" href="http://atlas.apache.org/"><i class="fa fa-question-circle"></i></a>
<a href="javascript:void(0);" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" class="user-dropdown"><i class="fa fa-user user-circle "></i><span class="userName"></span></a>
<ul class="dropdown-menu">
......
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
define(['require',
'backbone',
'hbs!tmpl/common/Statistics_tmpl',
'modules/Modal',
'models/VCommon',
'utils/UrlLinks',
'collection/VTagList',
'utils/CommonViewFunction'
], function(require, Backbone, StatTmpl, Modal, VCommon, UrlLinks, VTagList, CommonViewFunction) {
'use strict';
var StatisticsView = Backbone.Marionette.LayoutView.extend(
/** @lends AboutAtlasView */
{
template: StatTmpl,
/** Layout sub regions */
regions: {},
/** ui selector cache */
ui: {
entityActive: "[data-id='entityActive']",
entityDelete: "[data-id='entityDelete']"
},
/** ui events hash */
events: function() {},
/**
* intialize a new AboutAtlasView Layout
* @constructs
*/
initialize: function(options) {
_.extend(this, options);
var modal = new Modal({
title: 'Statistics',
content: this,
okCloses: true,
showFooter: true,
allowCancel: false,
}).open();
modal.on('closeModal', function() {
modal.trigger('cancel');
});
},
bindEvents: function() {},
onRender: function() {
var that = this;
var entityCountCollection = new VTagList();
entityCountCollection.url = UrlLinks.entityCountApi();
entityCountCollection.modelAttrName = "data";
entityCountCollection.fetch({
success: function(data) {
var data = _.first(data.toJSON()),
no_records = '<tr class="empty text-center"><td colspan="2"><span>No records found!</span></td></tr>',
activeEntityTable = _.isEmpty(data.entity.entityActive) ? no_records : CommonViewFunction.propertyTable({ scope: that, valueObject: data.entity.entityActive }),
deleteEntityTable = _.isEmpty(data.entity.entityDelete) ? no_records : CommonViewFunction.propertyTable({ scope: that, valueObject: data.entity.entityDelete });
that.ui.entityActive.html(activeEntityTable);
that.ui.entityDelete.html(deleteEntityTable);
}
});
},
});
return StatisticsView;
});
\ No newline at end of file
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