You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by ma...@apache.org on 2019/04/15 18:51:25 UTC
[atlas] branch master updated (a910609 -> 011e854)
This is an automated email from the ASF dual-hosted git repository.
madhan pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git.
from a910609 ATLAS-3136: assigning a term to an invalid entity guid throws 500, instead of 400
new 9c9eed2 ATLAS-3139: updated basic search to include relationship attributes as well in the result
new 2af5eed ATLAS-3138 : UI : Stats popup table layout improve for better readability
new 011e854 ATLAS-3137 : UI : Create entity add element validation and design improvement
The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
dashboardv2/public/css/scss/form.scss | 6 +-
dashboardv2/public/css/scss/override.scss | 12 ++
dashboardv2/public/css/scss/panel.scss | 44 ++++++-
dashboardv2/public/css/scss/stats.scss | 116 +++++++++++++++++
dashboardv2/public/css/scss/style.scss | 1 +
dashboardv2/public/css/scss/table.scss | 5 +
dashboardv2/public/css/scss/theme.scss | 127 ------------------
.../entity/CreateEntityLayoutView_tmpl.html | 4 +-
.../site/Statistics_Notification_table_tmpl.html | 2 +-
.../public/js/templates/site/Statistics_tmpl.html | 44 ++-----
...tification_table_tmpl.html => entity_tmpl.html} | 27 ++--
dashboardv2/public/js/utils/Enums.js | 7 +-
dashboardv2/public/js/utils/Utils.js | 9 +-
.../js/views/entity/CreateEntityLayoutView.js | 63 ++++++---
dashboardv2/public/js/views/site/Statistics.js | 142 +++++++++++++--------
.../org/apache/atlas/type/AtlasStructType.java | 6 +-
.../atlas/discovery/EntityDiscoveryService.java | 8 ++
.../store/graph/v2/EntityGraphRetriever.java | 8 +-
18 files changed, 374 insertions(+), 257 deletions(-)
create mode 100644 dashboardv2/public/css/scss/stats.scss
copy dashboardv2/public/js/templates/site/{Statistics_Notification_table_tmpl.html => entity_tmpl.html} (67%)
[atlas] 03/03: ATLAS-3137 : UI : Create entity add element
validation and design improvement
Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
madhan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git
commit 011e854660a08a6eed014d4fc5b56f55d8ca6cdd
Author: kevalbhatt <kb...@apache.org>
AuthorDate: Mon Apr 15 23:10:15 2019 +0530
ATLAS-3137 : UI : Create entity add element validation and design improvement
Signed-off-by: Madhan Neethiraj <ma...@apache.org>
---
dashboardv2/public/css/scss/form.scss | 6 ++-
dashboardv2/public/css/scss/override.scss | 12 +++++
.../entity/CreateEntityLayoutView_tmpl.html | 4 +-
dashboardv2/public/js/utils/Utils.js | 9 ++--
.../js/views/entity/CreateEntityLayoutView.js | 63 +++++++++++++++-------
5 files changed, 69 insertions(+), 25 deletions(-)
diff --git a/dashboardv2/public/css/scss/form.scss b/dashboardv2/public/css/scss/form.scss
index 3e63e8b..388713e 100644
--- a/dashboardv2/public/css/scss/form.scss
+++ b/dashboardv2/public/css/scss/form.scss
@@ -54,9 +54,13 @@
.form-control {
//Instead of the line below you could use @include border-radius($radius, $vertical-radius)
- background-color: $color_mystic_approx;
+ background-color: $color_white_lilac_approx;
border: 1px $color_mystic_approx solid;
+ &[disabled] {
+ background-color: $color_gallery_approx;
+ }
+
&:focus {
border-color: $color_bali_hai_approx;
outline: 0; //Instead of the line below you could use @include box-shadow($shadow-1, $shadow-2, $shadow-3, $shadow-4, $shadow-5, $shadow-6, $shadow-7, $shadow-8, $shadow-9, $shadow-10)
diff --git a/dashboardv2/public/css/scss/override.scss b/dashboardv2/public/css/scss/override.scss
index f388c0b..ea5b6a7 100644
--- a/dashboardv2/public/css/scss/override.scss
+++ b/dashboardv2/public/css/scss/override.scss
@@ -210,7 +210,19 @@ td {
}
.select2-container--default {
+ &.select2-container--disabled {
+ .select2-selection--multiple {
+ background-color: $color_gallery_approx !important;
+ cursor: not-allowed;
+
+ input.select2-search__field {
+ cursor: not-allowed;
+ }
+ }
+ }
+
.select2-selection--multiple {
+
background-color: $color_white_lilac_approx !important;
border: 1px $color_mystic_approx solid !important;
diff --git a/dashboardv2/public/js/templates/entity/CreateEntityLayoutView_tmpl.html b/dashboardv2/public/js/templates/entity/CreateEntityLayoutView_tmpl.html
index 65ca406..5645d51 100644
--- a/dashboardv2/public/js/templates/entity/CreateEntityLayoutView_tmpl.html
+++ b/dashboardv2/public/js/templates/entity/CreateEntityLayoutView_tmpl.html
@@ -16,7 +16,7 @@
-->
<form name="entityDefinitionform">
<div class="clearfix">
- <div class="col-sm-12 form-group">
+ <div class="col-sm-12 form-group" data-id="entitySelectionBox">
<div class="row">
{{#if guid}}
<div class="col-sm-8">
@@ -37,7 +37,7 @@
</div>
</div>
</div>
- <div class="col-sm-12 entityInputData create-entity-form" data-id="entityInputData"></div>
+ <div class="col-sm-12 entityInputData create-entity-form form-group" data-id="entityInputData"></div>
</div>
</form>
<div class="fontLoader-relative entityLoader" style="display:none">
diff --git a/dashboardv2/public/js/utils/Utils.js b/dashboardv2/public/js/utils/Utils.js
index ae71602..8f33c2e 100644
--- a/dashboardv2/public/js/utils/Utils.js
+++ b/dashboardv2/public/js/utils/Utils.js
@@ -602,8 +602,9 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
var mainData = options.data,
collection = options.collection,
attrMerge = options.attrMerge,
- mergeRelationAttributes = options.mergeRelationAttributes || false,
- seperateRelatioshipAttr = options.seperateRelatioshipAttr || false;
+ seperateRelatioshipAttr = options.seperateRelatioshipAttr || false,
+ mergeRelationAttributes = options.mergeRelationAttributes || (seperateRelatioshipAttr ? false : true);
+
if (mergeRelationAttributes && seperateRelatioshipAttr) {
throw "Both mergeRelationAttributes & seperateRelatioshipAttr cannot be true!"
}
@@ -681,9 +682,9 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
} else {
attributeDefs = _.uniq(_.sortBy(attributeDefs, 'name'), true, function(obj) {
if (obj.relationshipTypeName) {
- (obj.name + obj.relationshipTypeName)
+ return (obj.name + obj.relationshipTypeName)
} else {
- (obj.name)
+ return (obj.name)
}
});
}
diff --git a/dashboardv2/public/js/views/entity/CreateEntityLayoutView.js b/dashboardv2/public/js/views/entity/CreateEntityLayoutView.js
index a7bef78..22ce48c 100644
--- a/dashboardv2/public/js/views/entity/CreateEntityLayoutView.js
+++ b/dashboardv2/public/js/views/entity/CreateEntityLayoutView.js
@@ -56,7 +56,9 @@ define(['require',
entityInputData: "[data-id='entityInputData']",
toggleRequired: 'input[name="toggleRequired"]',
assetName: "[data-id='assetName']",
- entityInput: "[data-id='entityInput']"
+ entityInput: "[data-id='entityInput']",
+ entitySelectionBox: "[data-id='entitySelectionBox']",
+
},
/** ui events hash */
events: function() {
@@ -149,22 +151,18 @@ define(['require',
if (this.value !== "") {
if ($(this).data('select2')) {
$(this).data('select2').$container.find('.select2-selection').removeClass("errorClass");
- if (that.ui.entityInputData.find('.errorClass').length === 0) {
- that.modal.$el.find('button.ok').prop("disabled", false);
- }
} else {
$(this).removeClass('errorClass');
- if (that.ui.entityInputData.find('.errorClass').length === 0) {
- that.modal.$el.find('button.ok').prop("disabled", false);
- }
+ }
+ if (that.ui.entityInputData.find('.errorClass').length === 0) {
+ that.modal.$el.find('button.ok').prop("disabled", false);
}
} else {
+ that.modal.$el.find('button.ok').prop("disabled", true);
if ($(this).data('select2')) {
$(this).data('select2').$container.find('.select2-selection').addClass("errorClass");
- that.modal.$el.find('button.ok').prop("disabled", true);
} else {
$(this).addClass('errorClass');
- that.modal.$el.find('button.ok').prop("disabled", true);
}
}
});
@@ -370,6 +368,7 @@ define(['require',
return;
}
var elFound = that.ui.entityInputData.find('[data-key="' + key + '"]');
+ elFound.prop('disabled', true);
elFound.parent().prepend(visitedAttr[key]);
});
} else {
@@ -378,7 +377,21 @@ define(['require',
}
}
- that.ui.entityInputData.find("select[data-for-key]").select2({})
+ that.ui.entityInputData.find("select[data-for-key]").select2({}).on('change', function() {
+ var forKey = $(this).data('forKey'),
+ forKeyEl = null;
+ if (forKey && forKey.length) {
+ forKeyEl = that.ui.entityInputData.find('[data-key="' + forKey + '"]');
+ if (forKeyEl) {
+ if (this.value == "") {
+ forKeyEl.val(null).trigger('change');
+ forKeyEl.prop("disabled", true);
+ } else {
+ forKeyEl.prop("disabled", false);
+ }
+ }
+ }
+ });
return false;
},
subAttributeData: function(data) {
@@ -628,7 +641,9 @@ define(['require',
},
okButton: function() {
var that = this;
- this.showLoader();
+ this.showLoader({
+ editVisiblityOfEntitySelectionBox: true
+ });
this.parentEntity = this.ui.entityList.val();
var entityAttribute = {},
referredEntities = {},
@@ -751,7 +766,7 @@ define(['require',
success: function(model, response) {
that.modal.close();
Utils.notifySuccess({
- content: "entity " + Messages[that.guid ? 'editSuccessMessage' : 'addSuccessMessage']
+ content: "Entity " + Messages[that.guid ? 'editSuccessMessage' : 'addSuccessMessage']
});
if (that.guid && that.callback) {
that.callback();
@@ -766,7 +781,9 @@ define(['require',
}
},
complete: function() {
- that.hideLoader();
+ that.hideLoader({
+ editVisiblityOfEntitySelectionBox: true
+ });
}
});
@@ -774,16 +791,26 @@ define(['require',
Utils.notifyError({
content: e.message
});
- that.hideLoader();
+ that.hideLoader({
+ editVisiblityOfEntitySelectionBox: true
+ });
}
},
- showLoader: function() {
- this.$('.entityLoader').show();
+ showLoader: function(options) {
+ var editVisiblityOfEntitySelectionBox = options && options.editVisiblityOfEntitySelectionBox;
+ this.$('.entityLoader').addClass('show');
this.$('.entityInputData').hide();
+ if (this.guid || editVisiblityOfEntitySelectionBox) {
+ this.ui.entitySelectionBox.hide();
+ }
},
- hideLoader: function() {
- this.$('.entityLoader').hide();
+ hideLoader: function(options) {
+ var editVisiblityOfEntitySelectionBox = options && options.editVisiblityOfEntitySelectionBox
+ this.$('.entityLoader').removeClass('show');
this.$('.entityInputData').show();
+ if (this.guid || editVisiblityOfEntitySelectionBox) {
+ this.ui.entitySelectionBox.show();
+ }
// To enable scroll after selecting value from select2.
this.ui.entityList.select2('open');
this.ui.entityList.select2('close');
[atlas] 01/03: ATLAS-3139: updated basic search to include
relationship attributes as well in the result
Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
madhan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git
commit 9c9eed274532391ceb57a0e17d0b2f8611530f8a
Author: Madhan Neethiraj <ma...@apache.org>
AuthorDate: Sun Apr 14 23:42:08 2019 -0700
ATLAS-3139: updated basic search to include relationship attributes as well in the result
---
intg/src/main/java/org/apache/atlas/type/AtlasStructType.java | 6 +++---
.../java/org/apache/atlas/discovery/EntityDiscoveryService.java | 8 ++++++++
.../atlas/repository/store/graph/v2/EntityGraphRetriever.java | 8 +++++++-
3 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/intg/src/main/java/org/apache/atlas/type/AtlasStructType.java b/intg/src/main/java/org/apache/atlas/type/AtlasStructType.java
index 31953bd..254eee4 100644
--- a/intg/src/main/java/org/apache/atlas/type/AtlasStructType.java
+++ b/intg/src/main/java/org/apache/atlas/type/AtlasStructType.java
@@ -744,19 +744,19 @@ public class AtlasStructType extends AtlasType {
this.inverseRefAttributeName = inverseRefAttribute;
this.relationshipEdgeDirection = AtlasRelationshipEdgeDirection.OUT;
- switch (attributeType.getTypeCategory()) {
+ switch (this.attributeType.getTypeCategory()) {
case OBJECT_ID_TYPE:
isObjectRef = true;
break;
case MAP:
- AtlasMapType mapType = (AtlasMapType) attributeType;
+ AtlasMapType mapType = (AtlasMapType) this.attributeType;
isObjectRef = mapType.getValueType().getTypeCategory() == OBJECT_ID_TYPE;
break;
case ARRAY:
- AtlasArrayType arrayType = (AtlasArrayType) attributeType;
+ AtlasArrayType arrayType = (AtlasArrayType) this.attributeType;
isObjectRef = arrayType.getElementType().getTypeCategory() == OBJECT_ID_TYPE;
break;
diff --git a/repository/src/main/java/org/apache/atlas/discovery/EntityDiscoveryService.java b/repository/src/main/java/org/apache/atlas/discovery/EntityDiscoveryService.java
index 19f81d3..420e359 100644
--- a/repository/src/main/java/org/apache/atlas/discovery/EntityDiscoveryService.java
+++ b/repository/src/main/java/org/apache/atlas/discovery/EntityDiscoveryService.java
@@ -451,6 +451,10 @@ public class EntityDiscoveryService implements AtlasDiscoveryService {
for (String resultAttribute : resultAttributes) {
AtlasAttribute attribute = entityType.getAttribute(resultAttribute);
+ if (attribute == null) {
+ attribute = entityType.getRelationshipAttribute(resultAttribute, null);
+ }
+
if (attribute != null) {
AtlasType attributeType = attribute.getAttributeType();
@@ -536,6 +540,10 @@ public class EntityDiscoveryService implements AtlasDiscoveryService {
AtlasAttribute attribute = entityType.getAttribute(relation);
+ if (attribute == null) {
+ attribute = entityType.getRelationshipAttribute(relation, null);
+ }
+
if (attribute != null) {
if (attribute.isObjectRef()) {
relation = attribute.getRelationshipEdgeLabel();
diff --git a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphRetriever.java b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphRetriever.java
index 5aa6c8f..03d2c06 100644
--- a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphRetriever.java
+++ b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphRetriever.java
@@ -533,7 +533,13 @@ public class EntityGraphRetriever {
continue;
}
- Object attrValue = getVertexAttribute(entityVertex, entityType.getAttribute(nonQualifiedAttrName));
+ AtlasAttribute attribute = entityType.getAttribute(nonQualifiedAttrName);
+
+ if (attribute == null) {
+ attribute = entityType.getRelationshipAttribute(nonQualifiedAttrName, null);
+ }
+
+ Object attrValue = getVertexAttribute(entityVertex, attribute);
if (attrValue != null) {
ret.setAttribute(nonQualifiedAttrName, attrValue);
[atlas] 02/03: ATLAS-3138 : UI : Stats popup table layout improve
for better readability
Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
madhan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git
commit 2af5eedeee0a53422b9652eb44f9d7315a79f6aa
Author: kevalbhatt <kb...@apache.org>
AuthorDate: Mon Apr 15 23:11:55 2019 +0530
ATLAS-3138 : UI : Stats popup table layout improve for better readability
Signed-off-by: Madhan Neethiraj <ma...@apache.org>
---
dashboardv2/public/css/scss/panel.scss | 44 ++++++-
dashboardv2/public/css/scss/stats.scss | 116 +++++++++++++++++
dashboardv2/public/css/scss/style.scss | 1 +
dashboardv2/public/css/scss/table.scss | 5 +
dashboardv2/public/css/scss/theme.scss | 127 ------------------
.../site/Statistics_Notification_table_tmpl.html | 2 +-
.../public/js/templates/site/Statistics_tmpl.html | 44 ++-----
...tification_table_tmpl.html => entity_tmpl.html} | 27 ++--
dashboardv2/public/js/utils/Enums.js | 7 +-
dashboardv2/public/js/views/site/Statistics.js | 142 +++++++++++++--------
10 files changed, 287 insertions(+), 228 deletions(-)
diff --git a/dashboardv2/public/css/scss/panel.scss b/dashboardv2/public/css/scss/panel.scss
index 5673a7f..37b0da0 100644
--- a/dashboardv2/public/css/scss/panel.scss
+++ b/dashboardv2/public/css/scss/panel.scss
@@ -24,16 +24,19 @@
color: $color_jungle_green_approx;
background: $white;
border-color: $color_jungle_green_approx;
+
button {
color: $color_jungle_green_approx;
background: $white;
border: none;
}
+
.panel-title {
font-weight: bold;
padding-top: 8px;
}
}
+
.nav-tabs {
>li {
&.active {
@@ -41,6 +44,7 @@
color: $color_jungle_green_approx;
}
}
+
>a {
color: $black;
}
@@ -51,8 +55,9 @@
.panel-fullscreen {
.panel-body {
//overflow: hidden;
- height: calc(100% - 46px)!important;
+ height: calc(100% - 46px) !important;
}
+
.ui-resizable-handle {
display: none !important;
}
@@ -72,10 +77,47 @@
&>div {
position: relative;
}
+
&.active {
padding: 20px 10px 0px 10px;
min-height: 50px;
}
}
}
+}
+
+.panel-fullscreen {
+ position: fixed;
+ height: 100%;
+ top: 0px;
+ bottom: 0;
+ left: 0;
+ width: 100%;
+ right: 0;
+ 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 newline at end of file
diff --git a/dashboardv2/public/css/scss/stats.scss b/dashboardv2/public/css/scss/stats.scss
new file mode 100644
index 0000000..8333386
--- /dev/null
+++ b/dashboardv2/public/css/scss/stats.scss
@@ -0,0 +1,116 @@
+/*
+ * 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.
+ */
+
+.server-stats-container {
+
+ .connection-status {
+ height: 10px;
+ width: 10px;
+ border-radius: 50%;
+ display: inline-block;
+
+ &.connected {
+ background-color: #4CAF50;
+ }
+
+ &.not-connected {
+ background-color: #f44336;
+ }
+ }
+
+ .notification-card {
+ padding-top: 5px;
+ }
+
+ .card-container {
+ &.panel {
+ &.panel-primary {
+ border: 1px solid #ddd;
+ padding: 5px;
+ }
+ }
+
+ &.panel-primary>.panel-heading {
+ color: #686868;
+ background-color: #fff;
+ font-size: 14px;
+ font-weight: bold;
+ }
+ }
+
+
+ .panel-group {
+ .panel {
+ padding: 5px;
+ }
+ }
+
+ .panel {
+ &.panel-default {
+ padding: 5px;
+ }
+
+ .panel-body {
+
+ .col-sm-6,
+ .col-sm-12 {
+ padding: 5px;
+
+ .panel-heading {
+ padding: 5px 0 0 15px;
+ }
+ }
+
+ }
+
+ }
+
+ .table {
+ &.stat-table {
+ &.notification-table {
+ &.table-striped>tbody>tr:nth-of-type(odd) {
+ background-color: $color_white_lilac_approx;
+ }
+
+ tr {
+
+ th:not(:first-child),
+ td:not(:first-child) {
+ text-align: right;
+ }
+ }
+ }
+
+
+ }
+ }
+
+ .entityTable {
+ &.table {
+ tr {
+
+ th:not(:first-child),
+ td:not(:first-child) {
+ width: 33%;
+ text-align: right;
+ }
+ }
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/dashboardv2/public/css/scss/style.scss b/dashboardv2/public/css/scss/style.scss
index 904aa4e..4ee7cf9 100644
--- a/dashboardv2/public/css/scss/style.scss
+++ b/dashboardv2/public/css/scss/style.scss
@@ -34,4 +34,5 @@
@import "profile-table.scss";
@import "glossary.scss";
@import "wizard.scss";
+@import "stats.scss";
@import "override.scss";
\ No newline at end of file
diff --git a/dashboardv2/public/css/scss/table.scss b/dashboardv2/public/css/scss/table.scss
index a2a674f..e3e4717 100644
--- a/dashboardv2/public/css/scss/table.scss
+++ b/dashboardv2/public/css/scss/table.scss
@@ -36,4 +36,9 @@ tr.empty {
}
}
}
+}
+
+.table-action-btn {
+ position: absolute;
+ right: 0px;
}
\ No newline at end of file
diff --git a/dashboardv2/public/css/scss/theme.scss b/dashboardv2/public/css/scss/theme.scss
index 772f5f6..14a1688 100644
--- a/dashboardv2/public/css/scss/theme.scss
+++ b/dashboardv2/public/css/scss/theme.scss
@@ -272,43 +272,6 @@ hr[size="10"] {
}
}
-.panel-fullscreen {
- position: fixed;
- height: 100%;
- top: 0px;
- bottom: 0;
- left: 0;
- width: 100%;
- right: 0;
- 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;
}
@@ -432,11 +395,6 @@ hr[size="10"] {
}
}
-.table-action-btn {
- position: absolute;
- right: 0px;
-}
-
.entity-icon-box {
display: inline-block;
background: #cee0fa;
@@ -452,89 +410,4 @@ hr[size="10"] {
img {
height: 50px;
}
-}
-
-.server-stats-container {
-
- .connection-status {
- height: 10px;
- width: 10px;
- border-radius: 50%;
- display: inline-block;
-
- &.connected {
- background-color: #4CAF50;
- }
-
- &.not-connected {
- background-color: #f44336;
- }
- }
-
- .notification-card {
- padding-top: 5px;
- }
-
- .card-container {
- &.panel {
- &.panel-primary {
- border: 1px solid #ddd;
- padding: 5px;
- }
- }
-
- &.panel-primary>.panel-heading {
- color: #686868;
- background-color: #fff;
- font-size: 14px;
- font-weight: bold;
- }
- }
-
-
- .panel-group {
- .panel {
- padding: 5px;
- }
- }
-
- .panel {
- &.panel-default {
- padding: 5px;
- }
-
- .panel-body {
-
- .col-sm-6,
- .col-sm-12 {
- padding: 5px;
-
- .panel-heading {
- padding: 5px 0 0 15px;
- }
- }
-
- }
-
- }
-
- .table {
- &.stat-table {
- &.notification-table {
- &.table-striped>tbody>tr:nth-of-type(odd) {
- background-color: $color_white_lilac_approx;
- }
-
- tr {
-
- th:not(:first-child),
- td:not(:first-child) {
- text-align: right;
- }
- }
- }
-
-
- }
- }
}
\ No newline at end of file
diff --git a/dashboardv2/public/js/templates/site/Statistics_Notification_table_tmpl.html b/dashboardv2/public/js/templates/site/Statistics_Notification_table_tmpl.html
index d302263..dc5a191 100644
--- a/dashboardv2/public/js/templates/site/Statistics_Notification_table_tmpl.html
+++ b/dashboardv2/public/js/templates/site/Statistics_Notification_table_tmpl.html
@@ -31,7 +31,7 @@
<tr>
<td>{{{this.label}}}</td>
{{#each ../tableHeader}}
- <td>{{callmyfunction ../../getValue ../this this}}</td>
+ <td>{{callmyfunction ../../getTmplValue ../this this}}</td>
{{/each }}
</tr>
{{/each}}
diff --git a/dashboardv2/public/js/templates/site/Statistics_tmpl.html b/dashboardv2/public/js/templates/site/Statistics_tmpl.html
index c29c9c6..76e6f84 100644
--- a/dashboardv2/public/js/templates/site/Statistics_tmpl.html
+++ b/dashboardv2/public/js/templates/site/Statistics_tmpl.html
@@ -15,10 +15,10 @@
* limitations under the License.
-->
<div class="panel-group server-stats-container statsContainer hide" id="accordion">
- <div class="panel panel-default expand_collapse_panel-icon" data-id="entityActive">
+ <div class="panel panel-default expand_collapse_panel-icon" data-id="entity">
<div class="panel-heading" data-toggle="collapse" href="#collapse1" aria-expanded="true">
<h4 class="panel-title">
- <a>Active Entities <span class="count">(0)</span></a>
+ <a>Entities <span class="count">(0)</span></a>
</h4>
<div class="btn-group pull-right">
<button type="button" title="Collapse"><i class="ec-icon fa"></i></button>
@@ -26,45 +26,18 @@
</div>
<div id="collapse1" class="panel-collapse collapse in">
<div class="panel-body">
- <table class="table stat-table">
- <thead>
- <tr>
- <th>Entity</th>
- <th>Count</th>
- </tr>
- </thead>
+ <table class="table stat-table entityTable" data-id="entity-card">
<tbody>
- </tbody>
- </table>
- </div>
- </div>
- </div>
- <div class="panel panel-default expand_collapse_panel-icon" data-id="entityDelete">
- <div class="panel-heading" data-toggle="collapse" href="#collapse2">
- <h4 class="panel-title">
- <a>Deleted Entities <span class="count">(0)</span></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 stat-table">
- <thead>
- <tr>
- <th>Entity</th>
- <th>Count</th>
+ <tr class="empty text-center">
+ <td colspan="3"><span>No records found!</span></td>
</tr>
- </thead>
- <tbody>
</tbody>
</table>
</div>
</div>
</div>
<div class="panel panel-default expand_collapse_panel-icon" data-id="stats">
- <div class="panel-heading" data-toggle="collapse" href="#collapse3">
+ <div class="panel-heading" data-toggle="collapse" href="#collapse3" aria-expanded="true">
<h4 class="panel-title">
<a>Server Statistics </a>
</h4>
@@ -72,7 +45,7 @@
<button type="button" title="Collapse"><i class="ec-icon fa"></i></button>
</div>
</div>
- <div id="collapse3" class="panel-collapse collapse">
+ <div id="collapse3" class="panel-collapse collapse in">
<div class="panel-body">
<div class="col-sm-12">
<div class="card-container panel panel-primary">
@@ -99,7 +72,8 @@
</tr>
</tbody>
</table>
- <hr></hr>
+ <hr>
+ </hr>
<table data-id="notification-card" class="table stat-table notification-table table-striped ">
<tbody>
<tr class="empty text-center">
diff --git a/dashboardv2/public/js/templates/site/Statistics_Notification_table_tmpl.html b/dashboardv2/public/js/templates/site/entity_tmpl.html
similarity index 67%
copy from dashboardv2/public/js/templates/site/Statistics_Notification_table_tmpl.html
copy to dashboardv2/public/js/templates/site/entity_tmpl.html
index d302263..e4190d1 100644
--- a/dashboardv2/public/js/templates/site/Statistics_Notification_table_tmpl.html
+++ b/dashboardv2/public/js/templates/site/entity_tmpl.html
@@ -16,23 +16,26 @@
-->
<thead>
<tr>
- <th>Period</th>
- <th>Count</th>
- <th>Avg Time <span style="text-transform: lowercase;">(ms)</span></th>
- <th>Creates</th>
- <th>Updates</th>
- <th>Deletes</th>
- <th>Failed</th>
+ <th>Entities</th>
+ <th>Active <span data-id="activeEntity"></span></th>
+ <th>Deleted <span data-id="deletedEntity"></span></th>
</tr>
</thead>
{{#if data}}
<tbody>
- {{#each tableCol}}
+ {{#each data}}
<tr>
- <td>{{{this.label}}}</td>
- {{#each ../tableHeader}}
- <td>{{callmyfunction ../../getValue ../this this}}</td>
- {{/each }}
+ <td>{{@key}}</td>
+ {{#if this.active}}
+ <td>{{this.active}}</td>
+ {{else}}
+ <td>0</td>
+ {{/if}}
+ {{#if this.deleted}}
+ <td>{{this.deleted}}</td>
+ {{else}}
+ <td>0</td>
+ {{/if}}
</tr>
{{/each}}
</tbody>
diff --git a/dashboardv2/public/js/utils/Enums.js b/dashboardv2/public/js/utils/Enums.js
index aeb8ec2..7e1df04 100644
--- a/dashboardv2/public/js/utils/Enums.js
+++ b/dashboardv2/public/js/utils/Enums.js
@@ -137,14 +137,17 @@ define(['require'], function(require) {
Enums.addOnClassification = ["_CLASSIFIED", "_NOT_CLASSIFIED"];
Enums.stats = {
+ generalData: {
+ "collectionTime": "day"
+ },
Server: {
"startTimeStamp": "day",
"activeTimeStamp": "day",
"upTime": "none"
},
ConnectionStatus: {
- "backendStore": "none",
- "indexStore": "none"
+ "statusBackendStore": "status-html",
+ "statusIndexStore": "status-html"
},
Notification: {
"currentDay": "number",
diff --git a/dashboardv2/public/js/views/site/Statistics.js b/dashboardv2/public/js/views/site/Statistics.js
index bc25ddc..6f402cf 100644
--- a/dashboardv2/public/js/views/site/Statistics.js
+++ b/dashboardv2/public/js/views/site/Statistics.js
@@ -20,6 +20,7 @@ define(['require',
'backbone',
'hbs!tmpl/site/Statistics_tmpl',
'hbs!tmpl/site/Statistics_Notification_table_tmpl',
+ 'hbs!tmpl/site/entity_tmpl',
'modules/Modal',
'models/VCommon',
'utils/UrlLinks',
@@ -29,7 +30,7 @@ define(['require',
'moment',
'utils/Utils',
'moment-timezone'
-], function(require, Backbone, StatTmpl, StatsNotiTable, Modal, VCommon, UrlLinks, VTagList, CommonViewFunction, Enums, moment, Utils) {
+], function(require, Backbone, StatTmpl, StatsNotiTable, EntityTable, Modal, VCommon, UrlLinks, VTagList, CommonViewFunction, Enums, moment, Utils) {
'use strict';
var StatisticsView = Backbone.Marionette.LayoutView.extend(
@@ -41,15 +42,13 @@ define(['require',
regions: {},
/** ui selector cache */
ui: {
- entityActive: "[data-id='entityActive'] tbody",
- entityDelete: "[data-id='entityDelete'] tbody",
- entityActiveHeader: "[data-id='entityActive'] .count",
- entityDeletedHeader: "[data-id='entityDelete'] .count",
+ entityHeader: "[data-id='entity'] .count",
serverCard: "[data-id='server-card']",
connectionCard: "[data-id='connection-card']",
notificationCard: "[data-id='notification-card']",
statsNotificationTable: "[data-id='stats-notification-table']",
- notificationSmallCard: "[data-id='notification-small-card']"
+ notificationSmallCard: "[data-id='notification-small-card']",
+ entityCard: "[data-id='entity-card']"
},
/** ui events hash */
events: function() {},
@@ -80,25 +79,9 @@ define(['require',
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 : that.getTable({ valueObject: data.entity.entityActive }),
- deleteEntityTable = _.isEmpty(data.entity.entityDeleted) ? no_records : that.getTable({ valueObject: data.entity.entityDeleted });
- that.renderStats({ valueObject: data.general.stats });
- var totalActive = 0,
- totalDeleted = 0;
- if (data.entity && data.general.entityCount) {
- totalActive = data.general.entityCount;
- }
- if (data.entity && data.entity.entityDeleted) {
- _.each(data.entity.entityDeleted, function(val) {
- totalDeleted += val;
- });
- }
- that.ui.entityActive.html(activeEntityTable);
- that.ui.entityDelete.html(deleteEntityTable);
- that.ui.entityActiveHeader.html(" (" + _.numberFormatWithComa((totalActive - totalDeleted)) + ")");
- that.ui.entityDeletedHeader.html(" (" + _.numberFormatWithComa(totalDeleted) + ")");
+ var data = _.first(data.toJSON());
+ that.renderStats({ valueObject: data.general.stats, dataObject: data.general });
+ that.renderEntities({ data: data });
that.$('.statsContainer,.statsNotificationContainer').removeClass('hide');
that.$('.statsLoader,.statsNotificationLoader').removeClass('show');
}
@@ -120,25 +103,78 @@ define(['require',
});
return stats;
},
+ renderEntities: function(options) {
+ var that = this,
+ data = options.data,
+ entityData = data.entity,
+ activeEntities = entityData.entityActive || {},
+ deletedEntities = entityData.entityDeleted || {},
+ stats = {},
+ activeEntityCount = 0,
+ deletedEntityCount = 0,
+ createEntityData = function(opt) {
+ var entityData = opt.entityData,
+ type = opt.type;
+ _.each(entityData, function(val, key) {
+ var intVal = _.isUndefined(val) ? 0 : val;
+ if (stats[key]) {
+ stats[key][type] = intVal;
+ } else {
+ stats[key] = {};
+ stats[key][type] = intVal;
+ }
+ if (type == "active") {
+ activeEntityCount += intVal;
+ } else {
+ deletedEntityCount += intVal;
+ }
+ })
+ };
+
+ createEntityData({
+ "entityData": activeEntities,
+ "type": "active"
+ })
+ createEntityData({
+ "entityData": deletedEntities,
+ "type": "deleted"
+ });
+ if (!_.isEmpty(stats)) {
+ that.ui.entityCard.html(
+ EntityTable({
+ "data": _.pick(stats, (_.keys(stats).sort())),
+ })
+ );
+ that.$('[data-id="activeEntity"]').html(" (" + _.numberFormatWithComa(activeEntityCount) + ")");
+ that.$('[data-id="deletedEntity"]').html(" (" + _.numberFormatWithComa(deletedEntityCount) + ")");
+ that.ui.entityHeader.html(" (" + _.numberFormatWithComa(data.general.entityCount) + ")");
+ }
+ },
renderStats: function(options) {
var that = this,
data = this.genrateStatusData(options.valueObject),
+ generalData = options.dataObject,
createTable = function(obj) {
var tableBody = '',
enums = obj.enums,
- data = obj.data,
- showConnectionStatus = obj.showConnectionStatus;
+ data = obj.data;
_.each(data, function(value, key, list) {
tableBody += '<tr><td>' + key + '</td><td class="">' + that.getValue({
"value": value,
- "type": enums[key],
- "showConnectionStatus": showConnectionStatus
+ "type": enums[key]
}) + '</td></tr>';
});
return tableBody;
};
if (data.Notification) {
- var tableCol = [{ label: "Total", key: "total" },
+ var tableCol = [
+ {
+ label: "Total <br> (from " + (that.getValue({
+ "value": data.Server["startTimeStamp"],
+ "type": Enums.stats.Server["startTimeStamp"],
+ })) + ")",
+ key: "total"
+ },
{
label: "Current Hour <br> (from " + (that.getValue({
"value": data.Notification["currentHourStartTime"],
@@ -163,33 +199,45 @@ define(['require',
"data": data.Notification,
"tableHeader": tableHeader,
"tableCol": tableCol,
- "getValue": function(argument, args) {
- var returnVal = (args == 'count' ? data.Notification[argument.key] : data.Notification[argument.key.concat(args)]);
+ "getTmplValue": function(argument, args) {
+ var pickValueFrom = argument.key.concat(args);
+ if (argument.key == "total" && args == "EntityCreates") {
+ pickValueFrom = "totalCreates";
+ } else if (argument.key == "total" && args == "EntityUpdates") {
+ pickValueFrom = "totalUpdates";
+ } else if (argument.key == "total" && args == "EntityDeletes") {
+ pickValueFrom = "totalDeletes";
+ } else if (args == "count") {
+ pickValueFrom = argument.key;
+ }
+ var returnVal = data.Notification[pickValueFrom];
return returnVal ? _.numberFormatWithComa(returnVal) : 0;
}
})
);
- that.ui.notificationSmallCard.html(createTable({
- "enums": Enums.stats.Notification,
- "data": _.pick(data.Notification, 'lastMessageProcessedTime', 'offsetCurrent', 'offsetStart')
- }));
+ that.ui.notificationSmallCard.html(
+ createTable({
+ "enums": Enums.stats.Notification,
+ "data": _.pick(data.Notification, 'lastMessageProcessedTime', 'offsetCurrent', 'offsetStart')
+ })
+ );
}
if (data.Server) {
that.ui.serverCard.html(
createTable({
- "enums": _.extend(Enums.stats.Server, Enums.stats.ConnectionStatus),
- "data": _.extend(_.pick(data.Server, 'startTimeStamp', 'activeTimeStamp', 'upTime'), data.ConnectionStatus),
- "showConnectionStatus": true
+ "enums": _.extend(Enums.stats.Server, Enums.stats.ConnectionStatus, Enums.stats.generalData),
+ "data": _.extend(
+ _.pick(data.Server, 'startTimeStamp', 'activeTimeStamp', 'upTime', 'statusBackendStore', 'statusIndexStore'),
+ _.pick(generalData, 'collectionTime'))
})
);
}
},
getValue: function(options) {
var value = options.value,
- type = options.type,
- showConnectionStatus = options.showConnectionStatus;
+ type = options.type;
if (type == 'time') {
return Utils.millisecondsToTime(value);
} else if (type == 'day') {
@@ -198,18 +246,12 @@ define(['require',
return _.numberFormatWithComa(value);
} else if (type == 'millisecond') {
return _.numberFormatWithComa(value) + " millisecond/s";
- } else if ((showConnectionStatus && (value.indexOf('connected') != -1))) {
- return '<span class="connection-status ' + (showConnectionStatus && showConnectionStatus == true ? value : "") + '"></span>';
+ } else if (type == "status-html") {
+ return '<span class="connection-status ' + value + '"></span>';
} else {
return value;
}
- },
- getTable: function(obj) {
- return CommonViewFunction.propertyTable(_.extend({
- scope: this,
- formatIntVal: true
- }, obj))
}
});
return StatisticsView;
-});
\ No newline at end of file
+});