You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by mc...@apache.org on 2014/12/19 13:34:08 UTC
[39/43] incubator-nifi git commit: NIFI-180: - Obtaining the grid
instance correctly.
NIFI-180:
- Obtaining the grid instance correctly.
Project: http://git-wip-us.apache.org/repos/asf/incubator-nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-nifi/commit/12de20da
Tree: http://git-wip-us.apache.org/repos/asf/incubator-nifi/tree/12de20da
Diff: http://git-wip-us.apache.org/repos/asf/incubator-nifi/diff/12de20da
Branch: refs/heads/nifi-27
Commit: 12de20da86f0b6b6ff41230ed9f95c92b2e1028c
Parents: 045afa5
Author: Matt Gilman <ma...@gmail.com>
Authored: Wed Dec 17 10:46:54 2014 -0500
Committer: Matt Gilman <ma...@gmail.com>
Committed: Wed Dec 17 10:46:54 2014 -0500
----------------------------------------------------------------------
.../webapp/js/nf/cluster/nf-cluster-table.js | 23 +++++++++-----------
1 file changed, 10 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/12de20da/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/cluster/nf-cluster-table.js
----------------------------------------------------------------------
diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/cluster/nf-cluster-table.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/cluster/nf-cluster-table.js
index c82caa0..addd4be 100644
--- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/cluster/nf-cluster-table.js
+++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/cluster/nf-cluster-table.js
@@ -398,7 +398,7 @@ nf.ClusterTable = (function () {
* @argument {string} row The row
*/
promptForConnect: function (row) {
- var grid = $('#cluster-table');
+ var grid = $('#cluster-table').data('gridInstance');
if (nf.Common.isDefinedAndNotNull(grid)) {
var data = grid.getData();
var node = data.getItem(row);
@@ -421,7 +421,7 @@ nf.ClusterTable = (function () {
* @argument {string} row The row
*/
promptForDisconnect: function (row) {
- var grid = $('#cluster-table');
+ var grid = $('#cluster-table').data('gridInstance');
if (nf.Common.isDefinedAndNotNull(grid)) {
var data = grid.getData();
var node = data.getItem(row);
@@ -443,7 +443,7 @@ nf.ClusterTable = (function () {
* @argument {string} row The row
*/
makePrimary: function (row) {
- var grid = $('#cluster-table');
+ var grid = $('#cluster-table').data('gridInstance');
if (nf.Common.isDefinedAndNotNull(grid)) {
var data = grid.getData();
var item = data.getItem(row);
@@ -458,16 +458,13 @@ nf.ClusterTable = (function () {
}).done(function (response) {
var node = response.node;
- var clusterGrid = $('#cluster-table').data('gridInstance');
- var clusterData = clusterGrid.getData();
-
// start the update
- clusterData.beginUpdate();
- clusterData.updateItem(node.nodeId, node);
+ data.beginUpdate();
+ data.updateItem(node.nodeId, node);
// need to find the previous primary node
// get the property grid data
- var clusterItems = clusterData.getItems();
+ var clusterItems = data.getItems();
$.each(clusterItems, function (i, otherNode) {
// attempt to identify the previous primary node
if (node.nodeId !== otherNode.nodeId && otherNode.primary === true) {
@@ -476,7 +473,7 @@ nf.ClusterTable = (function () {
otherNode.status = 'CONNECTED';
// set the new node state
- clusterData.updateItem(otherNode.nodeId, otherNode);
+ data.updateItem(otherNode.nodeId, otherNode);
// no need to continue processing
return false;
@@ -484,7 +481,7 @@ nf.ClusterTable = (function () {
});
// end the update
- clusterData.endUpdate();
+ data.endUpdate();
}).fail(nf.Common.handleAjaxError);
}
},
@@ -495,7 +492,7 @@ nf.ClusterTable = (function () {
* @argument {string} row The row
*/
promptForRemoval: function (row) {
- var grid = $('#cluster-table');
+ var grid = $('#cluster-table').data('gridInstance');
if (nf.Common.isDefinedAndNotNull(grid)) {
var data = grid.getData();
var node = data.getItem(row);
@@ -559,7 +556,7 @@ nf.ClusterTable = (function () {
* @argument {string} row The row
*/
showNodeDetails: function (row) {
- var grid = $('#cluster-table');
+ var grid = $('#cluster-table').data('gridInstance');
if (nf.Common.isDefinedAndNotNull(grid)) {
var data = grid.getData();
var item = data.getItem(row);