You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ranger.apache.org by ni...@apache.org on 2021/04/20 13:35:44 UTC
[ranger] branch ranger-2.2 updated: RANGER-3240 : Show Latest
Response from Server on all pages of Ranger UI.
This is an automated email from the ASF dual-hosted git repository.
ni3galave pushed a commit to branch ranger-2.2
in repository https://gitbox.apache.org/repos/asf/ranger.git
The following commit(s) were added to refs/heads/ranger-2.2 by this push:
new 17173e5 RANGER-3240 : Show Latest Response from Server on all pages of Ranger UI.
17173e5 is described below
commit 17173e575e2721946fc82accbee6829251afb341
Author: Nitin Galave <ni...@apache.org>
AuthorDate: Wed Apr 14 18:21:27 2021 +0530
RANGER-3240 : Show Latest Response from Server on all pages of Ranger UI.
---
security-admin/src/main/webapp/index.html | 5 ++++-
.../src/main/webapp/scripts/modules/XAOverrides.js | 1 +
.../webapp/scripts/views/DownloadServicePolicy.js | 3 +++
.../main/webapp/scripts/views/UploadServicePolicy.js | 3 +++
.../webapp/scripts/views/common/XATableLayout.js | 3 +++
.../main/webapp/scripts/views/reports/AuditLayout.js | 4 +++-
.../webapp/scripts/views/reports/UserAccessLayout.js | 3 +++
.../webapp/scripts/views/service/ServiceCreate.js | 4 +++-
security-admin/src/main/webapp/styles/xa.css | 20 ++++++++++++++++++++
9 files changed, 43 insertions(+), 3 deletions(-)
diff --git a/security-admin/src/main/webapp/index.html b/security-admin/src/main/webapp/index.html
index b871a14..bc006cd 100644
--- a/security-admin/src/main/webapp/index.html
+++ b/security-admin/src/main/webapp/index.html
@@ -67,7 +67,10 @@
================================================== -->
<section id="r_sidebar"></section>
<section class="container-fluid">
- <section id="r_breadcrumbs" class="r_breadcrumbs"></section>
+ <div class="headerBreadcrumbs">
+ <section id="r_breadcrumbs" class="r_breadcrumbs"></section>
+ <div class="latestResponse"></div>
+ </div>
<div class="notifications top-right ranger-notifications"></div>
<section id="r_content" style="min-height: 450px;">
<div class="loading-img">
diff --git a/security-admin/src/main/webapp/scripts/modules/XAOverrides.js b/security-admin/src/main/webapp/scripts/modules/XAOverrides.js
index a7904eb..1c4e457 100644
--- a/security-admin/src/main/webapp/scripts/modules/XAOverrides.js
+++ b/security-admin/src/main/webapp/scripts/modules/XAOverrides.js
@@ -29,6 +29,7 @@
require('jquery-toggles');
Backbone.history.getHash = function(window) {
+ $('.latestResponse').html('<b>Last Response Time : </b>' + Globalize.format(new Date(), "MM/dd/yyyy hh:mm:ss tt"));
var pathStripper = /#.*$/;
var match = (window || this).location.href.match(/#(.*)$/);
return match ? this.decodeFragment(match[1].replace(pathStripper, '')) : '';
diff --git a/security-admin/src/main/webapp/scripts/views/DownloadServicePolicy.js b/security-admin/src/main/webapp/scripts/views/DownloadServicePolicy.js
index f85d2bd..291cbec 100644
--- a/security-admin/src/main/webapp/scripts/views/DownloadServicePolicy.js
+++ b/security-admin/src/main/webapp/scripts/views/DownloadServicePolicy.js
@@ -81,6 +81,9 @@ define(function(require){
var exportUrl = urlString +urls+ '?serviceName='+serviceName;
}
XAUtil.blockUI();
+ if (!_.isUndefined($('.latestResponse')) && $('.latestResponse').length > 0) {
+ $('.latestResponse').html('<b>Last Response Time : </b>' + Globalize.format(new Date(), "MM/dd/yyyy hh:mm:ss tt"));
+ }
$.ajax({
type: "GET",
url:exportUrl+'&checkPoliciesExists=true',
diff --git a/security-admin/src/main/webapp/scripts/views/UploadServicePolicy.js b/security-admin/src/main/webapp/scripts/views/UploadServicePolicy.js
index d30e74e..f7d3b73 100644
--- a/security-admin/src/main/webapp/scripts/views/UploadServicePolicy.js
+++ b/security-admin/src/main/webapp/scripts/views/UploadServicePolicy.js
@@ -245,6 +245,9 @@ define(function(require){
compString = _.map(_.groupBy(selectedZoneServices, function(m){return m.get('type')}), function(m, key){return key}).toString();
}
XAUtil.blockUI();
+ if (!_.isUndefined($('.latestResponse')) && $('.latestResponse').length > 0) {
+ $('.latestResponse').html('<b>Last Response Time : </b>' + Globalize.format(new Date(), "MM/dd/yyyy hh:mm:ss tt"));
+ }
$.ajax({
type: 'POST',
url: url+"&serviceType="+compString,
diff --git a/security-admin/src/main/webapp/scripts/views/common/XATableLayout.js b/security-admin/src/main/webapp/scripts/views/common/XATableLayout.js
index 49ebf66..6acbc19 100644
--- a/security-admin/src/main/webapp/scripts/views/common/XATableLayout.js
+++ b/security-admin/src/main/webapp/scripts/views/common/XATableLayout.js
@@ -198,6 +198,9 @@ define(function(require){
}));
},
showHidePager : function(){
+ if (!_.isUndefined($('.latestResponse')) && $('.latestResponse').length > 0) {
+ $('.latestResponse').html('<b>Last Response Time : </b>' + Globalize.format(new Date(), "MM/dd/yyyy hh:mm:ss tt"));
+ }
$('.popover').remove();
if(this.collection.state && this.collection.state.totalRecords > XAGlobals.settings.PAGE_SIZE) {
this.$el.find(this.rPagination.el).show()
diff --git a/security-admin/src/main/webapp/scripts/views/reports/AuditLayout.js b/security-admin/src/main/webapp/scripts/views/reports/AuditLayout.js
index 0b24c10..63bb024 100644
--- a/security-admin/src/main/webapp/scripts/views/reports/AuditLayout.js
+++ b/security-admin/src/main/webapp/scripts/views/reports/AuditLayout.js
@@ -130,7 +130,8 @@ define(function(require) {
console.log("initialized a AuditLayout Layout");
_.extend(this, _.pick(options, 'accessAuditList','tab'));
- var that = this;
+ var that = this;
+ $('.latestResponse').hide();
this.bindEvents();
this.currentTab = '#'+this.tab.split('?')[0];
var date = new Date().toString();
@@ -2293,6 +2294,7 @@ define(function(require) {
clearInterval(this.timerId);
clearInterval(this.clearTimeUpdateInterval);
XAUtils.removeUnwantedDomElement();
+ $('.latestResponse').show();
}
});
diff --git a/security-admin/src/main/webapp/scripts/views/reports/UserAccessLayout.js b/security-admin/src/main/webapp/scripts/views/reports/UserAccessLayout.js
index 146e3f3..19b6dbe 100644
--- a/security-admin/src/main/webapp/scripts/views/reports/UserAccessLayout.js
+++ b/security-admin/src/main/webapp/scripts/views/reports/UserAccessLayout.js
@@ -752,6 +752,9 @@ define(function(require) {'use strict';
},
onDownload: function(e){
var that = this, url = '';
+ if (!_.isUndefined($('.latestResponse')) && $('.latestResponse').length > 0) {
+ $('.latestResponse').html('<b>Last Response Time : </b>' + Globalize.format(new Date(), "MM/dd/yyyy hh:mm:ss tt"));
+ }
if(!this.allowDownload){
return XAUtil.alertBoxWithTimeSet(localization.tt('msg.noPolicytoExport'))
}
diff --git a/security-admin/src/main/webapp/scripts/views/service/ServiceCreate.js b/security-admin/src/main/webapp/scripts/views/service/ServiceCreate.js
index c040a26..10ac8b6 100644
--- a/security-admin/src/main/webapp/scripts/views/service/ServiceCreate.js
+++ b/security-admin/src/main/webapp/scripts/views/service/ServiceCreate.js
@@ -177,7 +177,9 @@ define(function(require){
msg :'Are you sure want to delete ?',
callback : function(){
XAUtil.blockUI();
-
+ if (!_.isUndefined($('.latestResponse')) && $('.latestResponse').length > 0) {
+ $('.latestResponse').html('<b>Last Response Time : </b>' + Globalize.format(new Date(), "MM/dd/yyyy hh:mm:ss tt"));
+ }
that.model.destroy({
success: function(model, response) {
XAUtil.blockUI('unblock');
diff --git a/security-admin/src/main/webapp/styles/xa.css b/security-admin/src/main/webapp/styles/xa.css
index afc848a..9762a3b 100644
--- a/security-admin/src/main/webapp/styles/xa.css
+++ b/security-admin/src/main/webapp/styles/xa.css
@@ -2688,6 +2688,8 @@ textarea:read-only{
z-index: 10;
background: #eeeeee;
padding-top: 14px;
+ width: 70%;
+ display: inline-block;
}
#zoneServiceAccordion .accordion-inner{
@@ -4671,4 +4673,22 @@ input.textFiledInputPadding:disabled {
.clearBoth {
clear: both;
+}
+
+
+.latestResponse {
+ width: 29%;
+ display: inline-block;
+ text-align: right;
+ top: -10px;
+ position: relative;
+}
+
+.headerBreadcrumbs {
+ position: sticky;
+ top: 42px;
+ z-index: 10;
+ background: #eeeeee;
+ width: 100%;
+ display: inline-block;
}
\ No newline at end of file