NIFI-2302: - Showing a message on the history page when in a cluster to indicate that only the actions from the current node are displayed.

This closes #740

Signed-off-by: jpercivall <joepercivall@yahoo.com>
This commit is contained in:
Matt Gilman 2016-07-28 15:07:16 -04:00 committed by jpercivall
parent 70d70732b5
commit a73c8bba30
3 changed files with 44 additions and 9 deletions

View File

@ -18,12 +18,18 @@
<div id="history">
<div id="history-header-text">NiFi History</div>
<div id="history-filter-container">
<div id="history-filter-overview">
A filter has been applied.&nbsp;
<span id="clear-history-filter" class="link">Clear filter</span>
<div id="cluster-history-message" class="hidden">
Viewing history for the current node only. Browse to another node to view its history.
</div>
<button id="history-filter-button" title="Filter History" class="fa fa-filter"></button>
<button id="history-purge-button" title="Purge History" class="fa fa-eraser hidden"></button>
<div style="float: right">
<div id="history-filter-overview">
A filter has been applied.&nbsp;
<span id="clear-history-filter" class="link">Clear filter</span>
</div>
<button id="history-filter-button" title="Filter History" class="fa fa-filter"></button>
<button id="history-purge-button" title="Purge History" class="fa fa-eraser hidden"></button>
</div>
<div class="clear"></div>
</div>
<div id="history-table"></div>
</div>

View File

@ -63,7 +63,16 @@
#history-filter-container {
position: absolute;
right: 0px;
left: 0px;
top: 15px;
font-family: Roboto;
font-size: 13px;
font-weight: normal;
}
#cluster-history-message {
float: left;
margin-top: 30px;
}
#history-filter-button {
@ -73,10 +82,7 @@
#history-filter-overview {
visibility: hidden;
font-family: Roboto;
font-size: 13px;
margin-bottom: 5px;
font-weight: normal;
}
#history-purge-button {

View File

@ -31,7 +31,8 @@ nf.History = (function () {
urls: {
banners: '../nifi-api/flow/banners',
about: '../nifi-api/flow/about',
currentUser: '../nifi-api/flow/current-user'
currentUser: '../nifi-api/flow/current-user',
clusterSummary: '../nifi-api/flow/cluster/summary'
}
};
@ -48,6 +49,26 @@ nf.History = (function () {
}).fail(nf.Common.handleAjaxError);
};
/**
* Loads the flow configuration and updated the cluster state.
*
* @returns xhr
*/
var loadClusterSummary = function () {
return $.ajax({
type: 'GET',
url: config.urls.clusterSummary,
dataType: 'json'
}).done(function (response) {
var clusterSummary = response.clusterSummary;
// if clustered, show message to indicate location of actions
if (clusterSummary.clustered === true) {
$('#cluster-history-message').show();
}
});
};
/**
* Initializes the history page.
*/
@ -116,6 +137,8 @@ nf.History = (function () {
// load the current user
loadCurrentUser().done(function () {
loadClusterSummary();
// create the history table
nf.HistoryTable.init();