http://git-wip-us.apache.org/repos/asf/nifi/blob/2c374baf/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-client.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-client.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-client.js index 812f20a..cd6521d 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-client.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-client.js @@ -21,8 +21,8 @@ if (typeof define === 'function' && define.amd) { define(['jquery', 'nf.Common'], - function ($, common) { - return (nf.Client = factory($, common)); + function ($, nfCommon) { + return (nf.Client = factory($, nfCommon)); }); } else if (typeof exports === 'object' && typeof module === 'object') { module.exports = (nf.Client = @@ -33,7 +33,7 @@ factory(root.$, root.nf.Common); } -}(this, function ($, common) { +}(this, function ($, nfCommon) { 'use strict'; var clientId = null; @@ -73,7 +73,7 @@ * @return {boolean} whether proposedData is newer than currentData */ isNewerRevision: function (currentData, proposedData) { - if (common.isDefinedAndNotNull(currentData)) { + if (nfCommon.isDefinedAndNotNull(currentData)) { var currentRevision = currentData.revision; var proposedRevision = proposedData.revision;
http://git-wip-us.apache.org/repos/asf/nifi/blob/2c374baf/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-common.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-common.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-common.js index 58e5b63..2b2677a 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-common.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-common.js @@ -23,8 +23,8 @@ define(['jquery', 'd3', 'nf.Storage'], - function ($, d3, storage) { - return (nf.Common = factory($, d3, storage)); + function ($, d3, nfStorage) { + return (nf.Common = factory($, d3, nfStorage)); }); } else if (typeof exports === 'object' && typeof module === 'object') { module.exports = (nf.Common = factory(require('jquery'), @@ -35,7 +35,7 @@ root.d3, root.nf.Storage); } -}(this, function ($, d3, storage) { +}(this, function ($, d3, nfStorage) { 'use strict'; $(document).ready(function () { @@ -73,14 +73,14 @@ }); // shows the logout link in the message-pane when appropriate and schedule token refresh - if (storage.getItem('jwt') !== null) { + if (nfStorage.getItem('jwt') !== null) { $('#user-logout-container').css('display', 'block'); nfCommon.scheduleTokenRefresh(); } // handle logout $('#user-logout').on('click', function () { - storage.removeItem('jwt'); + nfStorage.removeItem('jwt'); window.location = '/nifi/login'; }); @@ -227,7 +227,7 @@ var interval = nfCommon.MILLIS_PER_MINUTE; var checkExpiration = function () { - var expiration = storage.getItemExpiration('jwt'); + var expiration = nfStorage.getItemExpiration('jwt'); // ensure there is an expiration and token present if (expiration !== null) { @@ -501,7 +501,7 @@ * Shows the logout link if appropriate. */ showLogoutLink: function () { - if (storage.getItem('jwt') === null) { + if (nfStorage.getItem('jwt') === null) { $('#user-logout-container').css('display', 'none'); } else { $('#user-logout-container').css('display', 'block'); @@ -823,7 +823,7 @@ */ getAccessToken: function (accessTokenUrl) { return $.Deferred(function (deferred) { - if (storage.hasItem('jwt')) { + if (nfStorage.hasItem('jwt')) { $.ajax({ type: 'POST', url: accessTokenUrl http://git-wip-us.apache.org/repos/asf/nifi/blob/2c374baf/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-connection-details.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-connection-details.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-connection-details.js index d06d8a3..a6538a9 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-connection-details.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-connection-details.js @@ -22,8 +22,8 @@ define(['jquery', 'nf.Common', 'nf.ErrorHandler'], - function ($, common, errorHandler) { - return (nf.ConnectionDetails = factory($, common, errorHandler)); + function ($, nfCommon, nfErrorHandler) { + return (nf.ConnectionDetails = factory($, nfCommon, nfErrorHandler)); }); } else if (typeof exports === 'object' && typeof module === 'object') { module.exports = (nf.ConnectionDetails = factory(require('jquery'), @@ -34,7 +34,7 @@ root.nf.Common, root.nf.ErrorHandler); } -}(this, function ($, common, errorHandler) { +}(this, function ($, nfCommon, nfErrorHandler) { 'use strict'; /** @@ -72,7 +72,7 @@ }).done(function (response) { var processor = response.component; var processorName = $('<div class="label"></div>').text(processor.name).addClass('ellipsis').attr('title', processor.name); - var processorType = $('<div></div>').text(common.substringAfterLast(processor.type, '.')).addClass('ellipsis').attr('title', common.substringAfterLast(processor.type, '.')); + var processorType = $('<div></div>').text(nfCommon.substringAfterLast(processor.type, '.')).addClass('ellipsis').attr('title', nfCommon.substringAfterLast(processor.type, '.')); // populate source processor details $('#read-only-connection-source-label').text('From processor'); @@ -232,7 +232,7 @@ }).done(function (response) { var processor = response.component; var processorName = $('<div class="label"></div>').text(processor.name).addClass('ellipsis').attr('title', processor.name); - var processorType = $('<div></div>').text(common.substringAfterLast(processor.type, '.')).addClass('ellipsis').attr('title', common.substringAfterLast(processor.type, '.')); + var processorType = $('<div></div>').text(nfCommon.substringAfterLast(processor.type, '.')).addClass('ellipsis').attr('title', nfCommon.substringAfterLast(processor.type, '.')); // populate destination processor details $('#read-only-connection-target-label').text('To processor'); @@ -410,8 +410,8 @@ $('#read-only-relationship-names').empty(); // clear the connection details - common.clearField('read-only-connection-name'); - common.clearField('read-only-connection-id'); + nfCommon.clearField('read-only-connection-name'); + nfCommon.clearField('read-only-connection-id'); // clear the connection source details $('#read-only-connection-source-label').text(''); @@ -433,7 +433,7 @@ $('#read-only-prioritizers').empty(); }, open: function () { - common.toggleScrollable($('#' + this.find('.tab-container').attr('id') + '-content').get(0)); + nfCommon.toggleScrollable($('#' + this.find('.tab-container').attr('id') + '-content').get(0)); } } }); @@ -483,7 +483,7 @@ var selectedRelationships = connection.selectedRelationships; // show the available relationship if applicable - if (common.isDefinedAndNotNull(availableRelationships) || common.isDefinedAndNotNull(selectedRelationships)) { + if (nfCommon.isDefinedAndNotNull(availableRelationships) || nfCommon.isDefinedAndNotNull(selectedRelationships)) { // populate the available connections $.each(availableRelationships, function (i, name) { createRelationshipOption(name); @@ -516,17 +516,17 @@ } // set the connection details - common.populateField('read-only-connection-name', connection.name); - common.populateField('read-only-connection-id', connection.id); - common.populateField('read-only-flow-file-expiration', connection.flowFileExpiration); - common.populateField('read-only-back-pressure-object-threshold', connection.backPressureObjectThreshold); - common.populateField('read-only-back-pressure-data-size-threshold', connection.backPressureDataSizeThreshold); + nfCommon.populateField('read-only-connection-name', connection.name); + nfCommon.populateField('read-only-connection-id', connection.id); + nfCommon.populateField('read-only-flow-file-expiration', connection.flowFileExpiration); + nfCommon.populateField('read-only-back-pressure-object-threshold', connection.backPressureObjectThreshold); + nfCommon.populateField('read-only-back-pressure-data-size-threshold', connection.backPressureDataSizeThreshold); // prioritizers - if (common.isDefinedAndNotNull(connection.prioritizers) && connection.prioritizers.length > 0) { + if (nfCommon.isDefinedAndNotNull(connection.prioritizers) && connection.prioritizers.length > 0) { var prioritizerList = $('<ol></ol>').css('list-style', 'decimal inside none'); $.each(connection.prioritizers, function (i, type) { - prioritizerList.append($('<li></li>').text(common.substringAfterLast(type, '.'))); + prioritizerList.append($('<li></li>').text(nfCommon.substringAfterLast(type, '.'))); }); $('#read-only-prioritizers').append(prioritizerList); } else { @@ -545,9 +545,9 @@ if (relationshipNames.is(':visible') && relationshipNames.get(0).scrollHeight > Math.round(relationshipNames.innerHeight())) { relationshipNames.css('border-width', '1px'); } - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); } - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); } }; })); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/nifi/blob/2c374baf/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-error-handler.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-error-handler.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-error-handler.js index 0929b76..f7a538f 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-error-handler.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-error-handler.js @@ -22,8 +22,8 @@ define(['jquery', 'nf.Dialog', 'nf.Common'], - function ($, dialog, common) { - return (nf.ErrorHandler = factory($, dialog, common)); + function ($, nfDialog, nfCommon) { + return (nf.ErrorHandler = factory($, nfDialog, nfCommon)); }); } else if (typeof exports === 'object' && typeof module === 'object') { module.exports = (nf.ErrorHandler = factory(require('jquery'), @@ -34,7 +34,7 @@ root.nf.Dialog, root.nf.Common); } -}(this, function ($, dialog, common) { +}(this, function ($, nfDialog, nfCommon) { 'use strict'; return { @@ -54,7 +54,7 @@ // show the error pane $('#message-pane').show(); } else { - dialog.showOkDialog({ + nfDialog.showOkDialog({ headerText: 'Session Expired', dialogContent: 'Your session has expired. Please press Ok to log in again.', okHandler: function () { @@ -88,21 +88,21 @@ return; } - // status code 400, 404, and 409 are expected response codes for common errors. + // status code 400, 404, and 409 are expected response codes for nfCommon errors. if (xhr.status === 400 || xhr.status === 404 || xhr.status === 409 || xhr.status === 503) { - dialog.showOkDialog({ + nfDialog.showOkDialog({ headerText: 'Error', - dialogContent: common.escapeHtml(xhr.responseText) + dialogContent: nfCommon.escapeHtml(xhr.responseText) }); } else if (xhr.status === 403) { - dialog.showOkDialog({ + nfDialog.showOkDialog({ headerText: 'Insufficient Permissions', - dialogContent: common.escapeHtml(xhr.responseText) + dialogContent: nfCommon.escapeHtml(xhr.responseText) }); } else { if (xhr.status < 99 || xhr.status === 12007 || xhr.status === 12029) { var content = 'Please ensure the application is running and check the logs for any errors.'; - if (common.isDefinedAndNotNull(status)) { + if (nfCommon.isDefinedAndNotNull(status)) { if (status === 'timeout') { content = 'Request has timed out. Please ensure the application is running and check the logs for any errors.'; } else if (status === 'abort') { http://git-wip-us.apache.org/repos/asf/nifi/blob/2c374baf/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-ng-app-controller.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-ng-app-controller.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-ng-app-controller.js index fb89f09..5e7b267 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-ng-app-controller.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-ng-app-controller.js @@ -24,8 +24,8 @@ 'nf.CanvasUtils', 'nf.ClusterSummary', 'nf.Actions'], - function (angularBridge, canvasUtils, common, clusterSummary, actions) { - return (nf.ng.AppCtrl = factory(angularBridge, canvasUtils, common, clusterSummary, actions)); + function (nfNgBridge, nfCanvasUtils, nfCommon, nfClusterSummary, nfActions) { + return (nf.ng.AppCtrl = factory(nfNgBridge, nfCanvasUtils, nfCommon, nfClusterSummary, nfActions)); }); } else if (typeof exports === 'object' && typeof module === 'object') { module.exports = (nf.ng.AppCtrl = @@ -41,7 +41,7 @@ root.nf.ClusterSummary, root.nf.Actions); } -}(this, function (angularBridge, canvasUtils, common, clusterSummary, actions) { +}(this, function (nfNgBridge, nfCanvasUtils, nfCommon, nfClusterSummary, nfActions) { 'use strict'; return function ($scope, serviceProvider) { @@ -50,10 +50,10 @@ function AppCtrl(serviceProvider) { //add essential modules to the scope for availability throughout the angular container this.nf = { - "Common": common, - "ClusterSummary": clusterSummary, - "Actions": actions, - "CanvasUtils": canvasUtils, + "Common": nfCommon, + "ClusterSummary": nfClusterSummary, + "Actions": nfActions, + "CanvasUtils": nfCanvasUtils, }; //any registered angular service is available through the serviceProvider @@ -69,6 +69,6 @@ //For production angular applications .scope() is unavailable so we set //the root scope of the bootstrapped app on the bridge - angularBridge.rootScope = $scope; + nfNgBridge.rootScope = $scope; } })); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/nifi/blob/2c374baf/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-processor-details.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-processor-details.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-processor-details.js index 3130c86..1b6b28a 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-processor-details.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-processor-details.js @@ -26,8 +26,8 @@ 'nf.ErrorHandler', 'nf.CustomUi', 'nf.ClusterSummary'], - function ($, common, universalCapture, dialog, errorHandler, customUi, clusterSummary) { - return (nf.ProcessorDetails = factory($, common, universalCapture, dialog, errorHandler, customUi, clusterSummary)); + function ($, nfCommon, nfUniversalCapture, nfDialog, nfErrorHandler, nfCustomUi, nfClusterSummary) { + return (nf.ProcessorDetails = factory($, nfCommon, nfUniversalCapture, nfDialog, nfErrorHandler, nfCustomUi, nfClusterSummary)); }); } else if (typeof exports === 'object' && typeof module === 'object') { module.exports = (nf.ProcessorDetails = @@ -47,7 +47,7 @@ root.nf.CustomUi, root.nf.ClusterSummary); } -}(this, function ($, common, universalCapture, dialog, errorHandler, customUi, clusterSummary) { +}(this, function ($, nfCommon, nfUniversalCapture, nfDialog, nfErrorHandler, nfCustomUi, nfClusterSummary) { 'use strict'; /** @@ -65,7 +65,7 @@ // build the relationship container element var relationshipContainerElement = $('<div class="processor-relationship-container"></div>').append(relationshipLabel).appendTo('#read-only-auto-terminate-relationship-names'); - if (!common.isBlank(relationship.description)) { + if (!nfCommon.isBlank(relationship.description)) { var relationshipDescription = $('<div class="relationship-description"></div>').text(relationship.description); relationshipContainerElement.append(relationshipDescription); } @@ -99,7 +99,7 @@ }], select: function () { // remove all property detail dialogs - universalCapture.removeAllPropertyDetailDialogs(); + nfUniversalCapture.removeAllPropertyDetailDialogs(); // resize the property grid in case this is the first time its rendered if ($(this).text() === 'Properties') { @@ -127,25 +127,25 @@ $('#read-only-processor-properties').propertytable('clear'); // clear the processor details - common.clearField('read-only-processor-id'); - common.clearField('read-only-processor-type'); - common.clearField('read-only-processor-name'); - common.clearField('read-only-concurrently-schedulable-tasks'); - common.clearField('read-only-scheduling-period'); - common.clearField('read-only-penalty-duration'); - common.clearField('read-only-yield-duration'); - common.clearField('read-only-run-duration'); - common.clearField('read-only-bulletin-level'); - common.clearField('read-only-execution-node'); - common.clearField('read-only-execution-status'); - common.clearField('read-only-processor-comments'); + nfCommon.clearField('read-only-processor-id'); + nfCommon.clearField('read-only-processor-type'); + nfCommon.clearField('read-only-processor-name'); + nfCommon.clearField('read-only-concurrently-schedulable-tasks'); + nfCommon.clearField('read-only-scheduling-period'); + nfCommon.clearField('read-only-penalty-duration'); + nfCommon.clearField('read-only-yield-duration'); + nfCommon.clearField('read-only-run-duration'); + nfCommon.clearField('read-only-bulletin-level'); + nfCommon.clearField('read-only-execution-node'); + nfCommon.clearField('read-only-execution-status'); + nfCommon.clearField('read-only-processor-comments'); // removed the cached processor details $('#processor-details').removeData('processorDetails'); $('#processor-details').removeData('processorHistory'); }, open: function () { - common.toggleScrollable($('#' + this.find('.tab-container').attr('id') + '-content').get(0)); + nfCommon.toggleScrollable($('#' + this.find('.tab-container').attr('id') + '-content').get(0)); } } }); @@ -170,7 +170,7 @@ url: '../nifi-api/processors/' + encodeURIComponent(processorId), dataType: 'json' }).done(function (response) { - if (common.isDefinedAndNotNull(response.component)) { + if (nfCommon.isDefinedAndNotNull(response.component)) { // get the processor details var details = response.component; @@ -178,16 +178,16 @@ $('#processor-details').data('processorDetails', details); // populate the processor settings - common.populateField('read-only-processor-id', details['id']); - common.populateField('read-only-processor-type', common.substringAfterLast(details['type'], '.')); - common.populateField('read-only-processor-name', details['name']); - common.populateField('read-only-concurrently-schedulable-tasks', details.config['concurrentlySchedulableTaskCount']); - common.populateField('read-only-scheduling-period', details.config['schedulingPeriod']); - common.populateField('read-only-penalty-duration', details.config['penaltyDuration']); - common.populateField('read-only-yield-duration', details.config['yieldDuration']); - common.populateField('read-only-run-duration', common.formatDuration(details.config['runDurationMillis'])); - common.populateField('read-only-bulletin-level', details.config['bulletinLevel']); - common.populateField('read-only-processor-comments', details.config['comments']); + nfCommon.populateField('read-only-processor-id', details['id']); + nfCommon.populateField('read-only-processor-type', nfCommon.substringAfterLast(details['type'], '.')); + nfCommon.populateField('read-only-processor-name', details['name']); + nfCommon.populateField('read-only-concurrently-schedulable-tasks', details.config['concurrentlySchedulableTaskCount']); + nfCommon.populateField('read-only-scheduling-period', details.config['schedulingPeriod']); + nfCommon.populateField('read-only-penalty-duration', details.config['penaltyDuration']); + nfCommon.populateField('read-only-yield-duration', details.config['yieldDuration']); + nfCommon.populateField('read-only-run-duration', nfCommon.formatDuration(details.config['runDurationMillis'])); + nfCommon.populateField('read-only-bulletin-level', details.config['bulletinLevel']); + nfCommon.populateField('read-only-processor-comments', details.config['comments']); var showRunSchedule = true; @@ -204,7 +204,7 @@ } else { schedulingStrategy = "On primary node"; } - common.populateField('read-only-scheduling-strategy', schedulingStrategy); + nfCommon.populateField('read-only-scheduling-strategy', schedulingStrategy); // only show the run schedule when applicable if (showRunSchedule === true) { @@ -216,13 +216,13 @@ var executionNode = details.config['executionNode']; // only show the execution-node when applicable - if (clusterSummary.isClustered() || executionNode === 'PRIMARY') { + if (nfClusterSummary.isClustered() || executionNode === 'PRIMARY') { if (executionNode === 'ALL') { executionNode = "All nodes"; } else if (executionNode === 'PRIMARY') { executionNode = "Primary node only"; } - common.populateField('read-only-execution-node', executionNode); + nfCommon.populateField('read-only-execution-node', executionNode); $('#read-only-execution-node-options').show(); } else { @@ -230,7 +230,7 @@ } // load the relationship list - if (!common.isEmpty(details.relationships)) { + if (!nfCommon.isEmpty(details.relationships)) { $.each(details.relationships, function (i, relationship) { createRelationshipOption(relationship); }); @@ -278,7 +278,7 @@ }]; // determine if we should show the advanced button - if (top === window && common.isDefinedAndNotNull(customUi) && common.isDefinedAndNotNull(processor.config.customUiUrl) && processor.config.customUiUrl !== '') { + if (top === window && nfCommon.isDefinedAndNotNull(nfCustomUi) && nfCommon.isDefinedAndNotNull(processor.config.customUiUrl) && processor.config.customUiUrl !== '') { buttons.push({ buttonText: 'Advanced', clazz: 'fa fa-cog button-icon', @@ -293,7 +293,7 @@ $('#processor-details').modal('hide'); // show the custom ui - customUi.showCustomUi(processorResponse, processor.config.customUiUrl, false); + nfCustomUi.showCustomUi(processorResponse, processor.config.customUiUrl, false); } } }); @@ -312,12 +312,12 @@ } }).fail(function (xhr, status, error) { if (xhr.status === 400 || xhr.status === 404 || xhr.status === 409) { - dialog.showOkDialog({ + nfDialog.showOkDialog({ headerText: 'Error', - dialogContent: common.escapeHtml(xhr.responseText) + dialogContent: nfCommon.escapeHtml(xhr.responseText) }); } else { - errorHandler.handleAjaxError(xhr, status, error); + nfErrorHandler.handleAjaxError(xhr, status, error); } }); } http://git-wip-us.apache.org/repos/asf/nifi/blob/2c374baf/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-shell.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-shell.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-shell.js index 9860572..9296f21 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-shell.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-shell.js @@ -21,8 +21,8 @@ if (typeof define === 'function' && define.amd) { define(['jquery', 'nf.Common'], - function ($, common) { - return (nf.Shell = factory($, common)); + function ($, nfCommon) { + return (nf.Shell = factory($, nfCommon)); }); } else if (typeof exports === 'object' && typeof module === 'object') { module.exports = (nf.Shell = factory(require('jquery'), @@ -31,7 +31,7 @@ nf.Shell = factory(root.$, root.nf.Common); } -}(this, function ($, common) { +}(this, function ($, nfCommon) { 'use strict'; $(document).ready(function () { @@ -55,7 +55,7 @@ // register a listener when the frame is undocked $('#shell-undock-button').click(function () { var uri = $('#shell-iframe').attr('src'); - if (!common.isBlank(uri)) { + if (!nfCommon.isBlank(uri)) { // open the page and close the shell window.open(uri); @@ -74,10 +74,10 @@ /** * Initialize the shell. * - * @param contextMenu The reference to the contextMenu controller. + * @param nfContextMenuRef The nfContextMenu module. */ - init: function (contextMenu) { - nfContextMenu = contextMenu; + init: function (nfContextMenuRef) { + nfContextMenu = nfContextMenuRef; }, resizeContent: function (shell) { @@ -107,7 +107,7 @@ */ showPage: function (uri, canUndock) { // if the context menu is on this page, attempt to close - if (common.isDefinedAndNotNull(nfContextMenu)) { + if (nfCommon.isDefinedAndNotNull(nfContextMenu)) { nfContextMenu.hide(); } @@ -115,7 +115,7 @@ var shell = $('#shell'); // default undockable to true - if (common.isNull(canUndock) || common.isUndefined(canUndock)) { + if (nfCommon.isNull(canUndock) || nfCommon.isUndefined(canUndock)) { canUndock = true; } @@ -128,7 +128,7 @@ // register a new open handler $('#shell-dialog').modal('setOpenHandler', function () { - common.toggleScrollable($('#' + this.find('.tab-container').attr('id') + '-content').get(0)); + nfCommon.toggleScrollable($('#' + this.find('.tab-container').attr('id') + '-content').get(0)); }); // show the custom processor ui @@ -161,7 +161,7 @@ */ showContent: function (domId) { // if the context menu is on this page, attempt to close - if (common.isDefinedAndNotNull(nfContextMenu)) { + if (nfCommon.isDefinedAndNotNull(nfContextMenu)) { nfContextMenu.hide(); } http://git-wip-us.apache.org/repos/asf/nifi/blob/2c374baf/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-status-history.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-status-history.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-status-history.js index 2624319..ab3cb85 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-status-history.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-status-history.js @@ -24,8 +24,8 @@ 'nf.Common', 'nf.Dialog', 'nf.ErrorHandler'], - function ($, d3, common, dialog, errorHandler) { - return (nf.StatusHistory = factory($, d3, common, dialog, errorHandler)); + function ($, d3, nfCommon, nfDialog, nfErrorHandler) { + return (nf.StatusHistory = factory($, d3, nfCommon, nfDialog, nfErrorHandler)); }); } else if (typeof exports === 'object' && typeof module === 'object') { module.exports = (nf.StatusHistory = factory(require('jquery'), @@ -40,7 +40,7 @@ root.nf.Dialog, root.nf.ErrorHandler); } -}(this, function ($, d3, common, dialog, errorHandler) { +}(this, function ($, d3, nfCommon, nfDialog, nfErrorHandler) { var config = { nifiInstanceId: 'nifi-instance-id', nifiInstanceLabel: 'NiFi', @@ -65,19 +65,19 @@ */ var formatters = { 'DURATION': function (d) { - return common.formatDuration(d); + return nfCommon.formatDuration(d); }, 'COUNT': function (d) { // need to handle floating point number since this formatter // will also be used for average values if (d % 1 === 0) { - return common.formatInteger(d); + return nfCommon.formatInteger(d); } else { - return common.formatFloat(d); + return nfCommon.formatFloat(d); } }, 'DATA_SIZE': function (d) { - return common.formatDataSize(d); + return nfCommon.formatDataSize(d); } }; @@ -125,10 +125,10 @@ // get the descriptors var descriptors = componentStatusHistory.fieldDescriptors; statusHistory.details = componentStatusHistory.componentDetails; - statusHistory.selectedDescriptor = common.isUndefined(selectedDescriptor) ? descriptors[0] : selectedDescriptor; + statusHistory.selectedDescriptor = nfCommon.isUndefined(selectedDescriptor) ? descriptors[0] : selectedDescriptor; // ensure enough status snapshots - if (common.isDefinedAndNotNull(componentStatusHistory.aggregateSnapshots) && componentStatusHistory.aggregateSnapshots.length > 1) { + if (nfCommon.isDefinedAndNotNull(componentStatusHistory.aggregateSnapshots) && componentStatusHistory.aggregateSnapshots.length > 1) { statusHistory.instances.push({ id: config.nifiInstanceId, label: config.nifiInstanceLabel, @@ -142,7 +142,7 @@ // get the status for each node in the cluster if applicable $.each(componentStatusHistory.nodeSnapshots, function (_, nodeSnapshots) { // ensure enough status snapshots - if (common.isDefinedAndNotNull(nodeSnapshots.statusSnapshots) && nodeSnapshots.statusSnapshots.length > 1) { + if (nfCommon.isDefinedAndNotNull(nodeSnapshots.statusSnapshots) && nodeSnapshots.statusSnapshots.length > 1) { statusHistory.instances.push({ id: nodeSnapshots.nodeId, label: nodeSnapshots.address + ':' + nodeSnapshots.apiPort, @@ -168,7 +168,7 @@ */ var insufficientHistory = function () { // notify the user - dialog.showOkDialog({ + nfDialog.showOkDialog({ headerText: 'Status History', dialogContent: 'Insufficient history, please try again later.' }); @@ -216,7 +216,7 @@ options.push({ text: d.label, value: d.field, - description: common.escapeHtml(d.description) + description: nfCommon.escapeHtml(d.description) }); }); @@ -329,7 +329,7 @@ // go through each instance of this status history $.each(statusHistory.instances, function (_, instance) { // if this is the first time this instance is being rendered, make it visible - if (common.isUndefinedOrNull(instances[instance.id])) { + if (nfCommon.isUndefinedOrNull(instances[instance.id])) { instances[instance.id] = true; } @@ -463,8 +463,8 @@ return s.timestamp; }); }); - addDetailItem(detailsContainer, 'Start', common.formatDateTime(minDate)); - addDetailItem(detailsContainer, 'End', common.formatDateTime(maxDate)); + addDetailItem(detailsContainer, 'Start', nfCommon.formatDateTime(minDate)); + addDetailItem(detailsContainer, 'End', nfCommon.formatDateTime(maxDate)); // determine the x axis range x.domain([minDate, maxDate]); @@ -744,7 +744,7 @@ .on('brush', brushed); // conditionally set the brush extent - if (common.isDefinedAndNotNull(brushExtent)) { + if (nfCommon.isDefinedAndNotNull(brushExtent)) { brush = brush.extent(brushExtent); } @@ -924,29 +924,29 @@ // containment // ----------- dialog = $('#status-history-dialog'); - var nfDialog = {}; - if (common.isDefinedAndNotNull(dialog.data('nf-dialog'))) { - nfDialog = dialog.data('nf-dialog'); + var nfDialogData = {}; + if (nfCommon.isDefinedAndNotNull(dialog.data('nf-dialog'))) { + nfDialogData = dialog.data('nf-dialog'); } - nfDialog['min-width'] = (dialog.width() / $(window).width()) * 100 + '%'; - nfDialog['min-height'] = (dialog.height() / $(window).height()) * 100 + '%'; - nfDialog.responsive['fullscreen-width'] = dialog.outerWidth() + 'px'; - nfDialog.responsive['fullscreen-height'] = dialog.outerHeight() + 'px'; + nfDialogData['min-width'] = (dialog.width() / $(window).width()) * 100 + '%'; + nfDialogData['min-height'] = (dialog.height() / $(window).height()) * 100 + '%'; + nfDialogData.responsive['fullscreen-width'] = dialog.outerWidth() + 'px'; + nfDialogData.responsive['fullscreen-height'] = dialog.outerHeight() + 'px'; maxWidth = getChartMaxWidth(); if (ui.helper.width() > maxWidth) { ui.helper.width(maxWidth); - nfDialog.responsive['fullscreen-width'] = $(window).width() + 'px'; - nfDialog['min-width'] = '100%'; + nfDialogData.responsive['fullscreen-width'] = $(window).width() + 'px'; + nfDialogData['min-width'] = '100%'; } maxHeight = getChartMaxHeight(); if (ui.helper.height() > maxHeight) { ui.helper.height(maxHeight); - nfDialog.responsive['fullscreen-height'] = $(window).height() + 'px'; - nfDialog['min-height'] = '100%'; + nfDialogData.responsive['fullscreen-height'] = $(window).height() + 'px'; + nfDialogData['min-height'] = '100%'; } minHeight = getChartMinHeight(); @@ -954,11 +954,11 @@ ui.helper.height(minHeight); } - nfDialog['min-width'] = (parseInt(nfDialog['min-width'], 10) >= 100) ? '100%' : nfDialog['min-width']; - nfDialog['min-height'] = (parseInt(nfDialog['min-height'], 10) >= 100) ? '100%' : nfDialog['min-height']; + nfDialogData['min-width'] = (parseInt(nfDialogData['min-width'], 10) >= 100) ? '100%' : nfDialogData['min-width']; + nfDialogData['min-height'] = (parseInt(nfDialogData['min-height'], 10) >= 100) ? '100%' : nfDialogData['min-height']; //persist data attribute - dialog.data('nfDialog', nfDialog); + dialog.data('nfDialog', nfDialogData); // ---------------------- // status history dialog @@ -1042,7 +1042,7 @@ $('<div class="setting-name"></div>').text(label).appendTo(detailContainer); var detailElement = $('<div class="setting-field"></div>').text(value).appendTo(detailContainer); - if (common.isDefinedAndNotNull(valueElementId)) { + if (nfCommon.isDefinedAndNotNull(valueElementId)) { detailElement.attr('id', valueElementId); } }; @@ -1111,7 +1111,7 @@ if (e.target === window) { updateChart(); } - common.toggleScrollable($('#status-history-details').get(0)); + nfCommon.toggleScrollable($('#status-history-details').get(0)); }) }, @@ -1129,7 +1129,7 @@ dataType: 'json' }).done(function (response) { handleStatusHistoryResponse(groupId, connectionId, response.statusHistory, config.type.connection, selectedDescriptor); - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); }, /** @@ -1146,7 +1146,7 @@ dataType: 'json' }).done(function (response) { handleStatusHistoryResponse(groupId, processorId, response.statusHistory, config.type.processor, selectedDescriptor); - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); }, /** @@ -1163,7 +1163,7 @@ dataType: 'json' }).done(function (response) { handleStatusHistoryResponse(groupId, processGroupId, response.statusHistory, config.type.processGroup, selectedDescriptor); - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); }, /** @@ -1180,7 +1180,7 @@ dataType: 'json' }).done(function (response) { handleStatusHistoryResponse(groupId, remoteProcessGroupId, response.statusHistory, config.type.remoteProcessGroup, selectedDescriptor); - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); } }; http://git-wip-us.apache.org/repos/asf/nifi/blob/2c374baf/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance-lineage.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance-lineage.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance-lineage.js index f46d287..28ef92f 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance-lineage.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance-lineage.js @@ -24,8 +24,8 @@ 'nf.Common', 'nf.Dialog', 'nf.ErrorHandler'], - function ($, d3, common, dialog, errorHandler) { - return (nf.ng.ProvenanceLineage = factory($, d3, common, dialog, errorHandler)); + function ($, d3, nfCommon, nfDialog, nfErrorHandler) { + return (nf.ng.ProvenanceLineage = factory($, d3, nfCommon, nfDialog, nfErrorHandler)); }); } else if (typeof exports === 'object' && typeof module === 'object') { module.exports = (nf.ng.ProvenanceLineage = @@ -41,7 +41,7 @@ root.nf.Dialog, root.nf.ErrorHandler); } -}(this, function ($, d3, common, dialog, errorHandler) { +}(this, function ($, d3, nfCommon, nfDialog, nfErrorHandler) { 'use strict'; var mySelf = function () { @@ -136,7 +136,7 @@ data: JSON.stringify(lineageEntity), dataType: 'json', contentType: 'application/json' - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); }; /** @@ -147,7 +147,7 @@ */ var getLineage = function (lineage) { var url = lineage.uri; - if (common.isDefinedAndNotNull(lineage.request.clusterNodeId)) { + if (nfCommon.isDefinedAndNotNull(lineage.request.clusterNodeId)) { url += '?' + $.param({ clusterNodeId: lineage.request.clusterNodeId }); @@ -157,7 +157,7 @@ type: 'GET', url: url, dataType: 'json' - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); }; /** @@ -168,7 +168,7 @@ */ var cancelLineage = function (lineage) { var url = lineage.uri; - if (common.isDefinedAndNotNull(lineage.request.clusterNodeId)) { + if (nfCommon.isDefinedAndNotNull(lineage.request.clusterNodeId)) { url += '?' + $.param({ clusterNodeId: lineage.request.clusterNodeId }); @@ -178,7 +178,7 @@ type: 'DELETE', url: url, dataType: 'json' - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); }; var DEFAULT_NODE_SPACING = 100; @@ -216,7 +216,7 @@ descendants.add(link.target.id); }); - if (common.isUndefined(depth)) { + if (nfCommon.isUndefined(depth)) { locateDescendants(children, descendants); } else if (depth > 1) { locateDescendants(children, descendants, depth - 1); @@ -483,11 +483,11 @@ node.incoming = []; // ensure this event has an event time - if (common.isUndefined(minMillis) || minMillis > node.millis) { + if (nfCommon.isUndefined(minMillis) || minMillis > node.millis) { minMillis = node.millis; minTimestamp = node.timestamp; } - if (common.isUndefined(maxMillis) || maxMillis < node.millis) { + if (nfCommon.isUndefined(maxMillis) || maxMillis < node.millis) { maxMillis = node.millis; } }); @@ -526,7 +526,7 @@ // create the proper date by adjusting by the offsets var date = new Date(millis + userTimeOffset + provenanceTableCtrl.serverTimeOffset); - return common.formatDateTime(date); + return nfCommon.formatDateTime(date); }; // handle context menu clicks... @@ -800,7 +800,7 @@ // closes the searching dialog and cancels the query on the server var closeDialog = function () { // cancel the provenance results since we've successfully processed the results - if (common.isDefinedAndNotNull(lineage)) { + if (nfCommon.isDefinedAndNotNull(lineage)) { cancelLineage(lineage); } @@ -827,11 +827,11 @@ } // close the dialog if the results contain an error - if (!common.isEmpty(lineage.results.errors)) { + if (!nfCommon.isEmpty(lineage.results.errors)) { var errors = lineage.results.errors; - dialog.showOkDialog({ + nfDialog.showOkDialog({ headerText: 'Process Lineage', - dialogContent: common.formatUnorderedList(errors) + dialogContent: nfCommon.formatUnorderedList(errors) }); closeDialog(); @@ -851,7 +851,7 @@ renderEventLineage(results); } else { // inform the user that no results were found - dialog.showOkDialog({ + nfDialog.showOkDialog({ headerText: 'Lineage Results', dialogContent: 'The lineage search has completed successfully but there no results were found. The events may have aged off.' }); @@ -1346,7 +1346,7 @@ // closes the searching dialog and cancels the query on the server var closeDialog = function () { // cancel the provenance results since we've successfully processed the results - if (common.isDefinedAndNotNull(lineage)) { + if (nfCommon.isDefinedAndNotNull(lineage)) { cancelLineage(lineage); } @@ -1372,11 +1372,11 @@ } // close the dialog if the results contain an error - if (!common.isEmpty(lineage.results.errors)) { + if (!nfCommon.isEmpty(lineage.results.errors)) { var errors = lineage.results.errors; - dialog.showOkDialog({ + nfDialog.showOkDialog({ headerText: 'Process Lineage', - dialogContent: common.formatUnorderedList(errors) + dialogContent: nfCommon.formatUnorderedList(errors) }); closeDialog(); http://git-wip-us.apache.org/repos/asf/nifi/blob/2c374baf/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance-table.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance-table.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance-table.js index 5bbaa09..1ae4c1d 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance-table.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance-table.js @@ -26,8 +26,8 @@ 'nf.ErrorHandler', 'nf.Storage', 'nf.ng.Bridge'], - function ($, Slick, common, dialog, errorHandler, storage, angularBridge) { - return (nf.ng.ProvenanceTable = factory($, Slick, common, dialog, errorHandler, storage, angularBridge)); + function ($, Slick, nfCommon, nfDialog, nfErrorHandler, nfStorage, nfNgBridge) { + return (nf.ng.ProvenanceTable = factory($, Slick, nfCommon, nfDialog, nfErrorHandler, nfStorage, nfNgBridge)); }); } else if (typeof exports === 'object' && typeof module === 'object') { module.exports = (nf.ng.ProvenanceTable = @@ -47,7 +47,7 @@ root.nf.Storage, root.nf.ng.Bridge); } -}(this, function ($, Slick, common, dialog, errorHandler, storage, angularBridge) { +}(this, function ($, Slick, nfCommon, nfDialog, nfErrorHandler, nfStorage, nfNgBridge) { 'use strict'; var nfProvenanceTable = function (provenanceLineageCtrl) { @@ -93,17 +93,17 @@ var dataUri = config.urls.provenanceEvents + encodeURIComponent(eventId) + '/content/' + encodeURIComponent(direction); // perform the request once we've received a token - common.getAccessToken(config.urls.downloadToken).done(function (downloadToken) { + nfCommon.getAccessToken(config.urls.downloadToken).done(function (downloadToken) { var parameters = {}; // conditionally include the ui extension token - if (!common.isBlank(downloadToken)) { + if (!nfCommon.isBlank(downloadToken)) { parameters['access_token'] = downloadToken; } // conditionally include the cluster node id var clusterNodeId = $('#provenance-event-cluster-node-id').text(); - if (!common.isBlank(clusterNodeId)) { + if (!nfCommon.isBlank(clusterNodeId)) { parameters['clusterNodeId'] = clusterNodeId; } @@ -114,7 +114,7 @@ window.open(dataUri + '?' + $.param(parameters)); } }).fail(function () { - dialog.showOkDialog({ + nfDialog.showOkDialog({ headerText: 'Provenance', dialogContent: 'Unable to generate access token for downloading content.' }); @@ -135,7 +135,7 @@ // generate tokens as necessary var getAccessTokens = $.Deferred(function (deferred) { - if (storage.hasItem('jwt')) { + if (nfStorage.hasItem('jwt')) { // generate a token for the ui extension and another for the callback var uiExtensionToken = $.ajax({ type: 'POST', @@ -152,7 +152,7 @@ var downloadToken = downloadTokenResult[0]; deferred.resolve(uiExtensionToken, downloadToken); }).fail(function () { - dialog.showOkDialog({ + nfDialog.showOkDialog({ headerText: 'Provenance', dialogContent: 'Unable to generate access token for viewing content.' }); @@ -169,12 +169,12 @@ // conditionally include the cluster node id var clusterNodeId = $('#provenance-event-cluster-node-id').text(); - if (!common.isBlank(clusterNodeId)) { + if (!nfCommon.isBlank(clusterNodeId)) { dataUriParameters['clusterNodeId'] = clusterNodeId; } // include the download token if applicable - if (!common.isBlank(downloadToken)) { + if (!nfCommon.isBlank(downloadToken)) { dataUriParameters['access_token'] = downloadToken; } @@ -200,7 +200,7 @@ }; // include the download token if applicable - if (!common.isBlank(uiExtensionToken)) { + if (!nfCommon.isBlank(uiExtensionToken)) { contentViewerParameters['access_token'] = uiExtensionToken; } @@ -257,7 +257,7 @@ $('#modified-attribute-toggle').removeClass('checkbox-checked').addClass('checkbox-unchecked'); }, open: function () { - common.toggleScrollable($('#' + this.find('.tab-container').attr('id') + '-content').get(0)); + nfCommon.toggleScrollable($('#' + this.find('.tab-container').attr('id') + '-content').get(0)); } } }); @@ -283,7 +283,7 @@ }); // if a content viewer url is specified, use it - if (common.isContentViewConfigured()) { + if (nfCommon.isContentViewConfigured()) { // input view $('#input-content-view').on('click', function () { viewContent('input'); @@ -303,7 +303,7 @@ // conditionally include the cluster node id var clusterNodeId = $('#provenance-event-cluster-node-id').text(); - if (!common.isBlank(clusterNodeId)) { + if (!nfCommon.isBlank(clusterNodeId)) { replayEntity['clusterNodeId'] = clusterNodeId; } @@ -314,11 +314,11 @@ dataType: 'json', contentType: 'application/json' }).done(function (response) { - dialog.showOkDialog({ + nfDialog.showOkDialog({ headerText: 'Provenance', dialogContent: 'Successfully submitted replay request.' }); - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); $('#event-details-dialog').modal('hide'); }); @@ -388,7 +388,7 @@ $('#provenance-search-location').combo({ options: searchableOptions }); - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); // show the node search combo $('#provenance-search-location-container').show(); @@ -534,7 +534,7 @@ var searchValue = $.trim(searchableField.find('input.searchable-field-input').val()); // if the field isn't blank include it in the search - if (!common.isBlank(searchValue)) { + if (!nfCommon.isBlank(searchValue)) { searchCriteria[fieldId] = searchValue; } }); @@ -623,7 +623,7 @@ // define how general values are formatted var valueFormatter = function (row, cell, value, columnDef, dataContext) { - return common.formatValue(value); + return nfCommon.formatValue(value); }; // determine if the this page is in the shell @@ -634,13 +634,13 @@ var markup = ''; // conditionally include the cluster node id - if (common.SUPPORTS_SVG) { + if (nfCommon.SUPPORTS_SVG) { markup += '<div title="Show Lineage" class="pointer show-lineage icon icon-lineage" style="margin-right: 3px;"></div>'; } // conditionally support going to the component var isRemotePort = dataContext.componentType === 'Remote Input Port' || dataContext.componentType === 'Remote Output Port'; - if (isInShell && common.isDefinedAndNotNull(dataContext.groupId) && isRemotePort === false) { + if (isInShell && nfCommon.isDefinedAndNotNull(dataContext.groupId) && isRemotePort === false) { markup += '<div class="pointer go-to fa fa-long-arrow-right" title="Go To"></div>'; } @@ -717,7 +717,7 @@ } // conditionally show the action column - if (common.SUPPORTS_SVG || isInShell) { + if (nfCommon.SUPPORTS_SVG || isInShell) { provenanceColumns.push({ id: 'actions', name: ' ', @@ -797,7 +797,7 @@ provenanceGrid.render(); // update the total number of displayed events if necessary - $('#displayed-events').text(common.formatInteger(args.current)); + $('#displayed-events').text(nfCommon.formatInteger(args.current)); }); provenanceData.onRowsChanged.subscribe(function (e, args) { provenanceGrid.invalidateRows(args.rows); @@ -820,7 +820,7 @@ var provenanceGrid = $('#provenance-table').data('gridInstance'); // ensure the grid has been initialized - if (common.isDefinedAndNotNull(provenanceGrid)) { + if (nfCommon.isDefinedAndNotNull(provenanceGrid)) { var provenanceData = provenanceGrid.getData(); // update the search criteria @@ -874,24 +874,24 @@ // defines a function for sorting var comparer = function (a, b) { if (sortDetails.columnId === 'eventTime') { - var aTime = common.parseDateTime(a[sortDetails.columnId]).getTime(); - var bTime = common.parseDateTime(b[sortDetails.columnId]).getTime(); + var aTime = nfCommon.parseDateTime(a[sortDetails.columnId]).getTime(); + var bTime = nfCommon.parseDateTime(b[sortDetails.columnId]).getTime(); if (aTime === bTime) { return a['id'] - b['id']; } else { return aTime - bTime; } } else if (sortDetails.columnId === 'fileSize') { - var aSize = common.parseSize(a[sortDetails.columnId]); - var bSize = common.parseSize(b[sortDetails.columnId]); + var aSize = nfCommon.parseSize(a[sortDetails.columnId]); + var bSize = nfCommon.parseSize(b[sortDetails.columnId]); if (aSize === bSize) { return a['id'] - b['id']; } else { return aSize - bSize; } } else { - var aString = common.isDefinedAndNotNull(a[sortDetails.columnId]) ? a[sortDetails.columnId] : ''; - var bString = common.isDefinedAndNotNull(b[sortDetails.columnId]) ? b[sortDetails.columnId] : ''; + var aString = nfCommon.isDefinedAndNotNull(a[sortDetails.columnId]) ? a[sortDetails.columnId] : ''; + var bString = nfCommon.isDefinedAndNotNull(b[sortDetails.columnId]) ? b[sortDetails.columnId] : ''; if (aString === bString) { return a['id'] - b['id']; } else { @@ -928,7 +928,7 @@ data: JSON.stringify(provenanceEntity), dataType: 'json', contentType: 'application/json' - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); }; /** @@ -939,7 +939,7 @@ */ var getProvenance = function (provenance) { var url = provenance.uri; - if (common.isDefinedAndNotNull(provenance.request.clusterNodeId)) { + if (nfCommon.isDefinedAndNotNull(provenance.request.clusterNodeId)) { url += '?' + $.param({ clusterNodeId: provenance.request.clusterNodeId, summarize: true, @@ -956,7 +956,7 @@ type: 'GET', url: url, dataType: 'json' - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); }; /** @@ -967,7 +967,7 @@ */ var cancelProvenance = function (provenance) { var url = provenance.uri; - if (common.isDefinedAndNotNull(provenance.request.clusterNodeId)) { + if (nfCommon.isDefinedAndNotNull(provenance.request.clusterNodeId)) { url += '?' + $.param({ clusterNodeId: provenance.request.clusterNodeId }); @@ -977,7 +977,7 @@ type: 'DELETE', url: url, dataType: 'json' - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); }; /** @@ -990,7 +990,7 @@ var provenanceResults = provenance.results; // ensure there are groups specified - if (common.isDefinedAndNotNull(provenanceResults.provenanceEvents)) { + if (nfCommon.isDefinedAndNotNull(provenanceResults.provenanceEvents)) { var provenanceTable = $('#provenance-table').data('gridInstance'); var provenanceData = provenanceTable.getData(); @@ -1003,21 +1003,21 @@ $('#provenance-last-refreshed').text(provenanceResults.generated); // update the oldest event available - $('#oldest-event').html(common.formatValue(provenanceResults.oldestEvent)); + $('#oldest-event').html(nfCommon.formatValue(provenanceResults.oldestEvent)); // record the server offset provenanceTableCtrl.serverTimeOffset = provenanceResults.timeOffset; // determines if the specified query is blank (no search terms, start or end date) var isBlankQuery = function (query) { - return common.isUndefinedOrNull(query.startDate) && common.isUndefinedOrNull(query.endDate) && $.isEmptyObject(query.searchTerms); + return nfCommon.isUndefinedOrNull(query.startDate) && nfCommon.isUndefinedOrNull(query.endDate) && $.isEmptyObject(query.searchTerms); }; // update the filter message based on the request if (isBlankQuery(provenanceRequest)) { var message = 'Showing the most recent '; if (provenanceResults.totalCount >= config.maxResults) { - message += (common.formatInteger(config.maxResults) + ' of ' + provenanceResults.total + ' events, please refine the search.'); + message += (nfCommon.formatInteger(config.maxResults) + ' of ' + provenanceResults.total + ' events, please refine the search.'); } else { message += ('events.'); } @@ -1026,7 +1026,7 @@ } else { var message = 'Showing '; if (provenanceResults.totalCount >= config.maxResults) { - message += (common.formatInteger(config.maxResults) + ' of ' + provenanceResults.total + ' events that match the specified query, please refine the search.'); + message += (nfCommon.formatInteger(config.maxResults) + ' of ' + provenanceResults.total + ' events that match the specified query, please refine the search.'); } else { message += ('the events that match the specified query.'); } @@ -1035,7 +1035,7 @@ } // update the total number of events - $('#total-events').text(common.formatInteger(provenanceResults.provenanceEvents.length)); + $('#total-events').text(nfCommon.formatInteger(provenanceResults.provenanceEvents.length)); } else { $('#total-events').text('0'); } @@ -1048,11 +1048,11 @@ */ var goTo = function (item) { // ensure the component is still present in the flow - if (common.isDefinedAndNotNull(item.groupId)) { + if (nfCommon.isDefinedAndNotNull(item.groupId)) { // only attempt this if we're within a frame if (top !== window) { // and our parent has canvas utils and shell defined - if (common.isDefinedAndNotNull(parent.nf) && common.isDefinedAndNotNull(parent.nf.CanvasUtils) && common.isDefinedAndNotNull(parent.nf.Shell)) { + if (nfCommon.isDefinedAndNotNull(parent.nf) && nfCommon.isDefinedAndNotNull(parent.nf.CanvasUtils) && nfCommon.isDefinedAndNotNull(parent.nf.Shell)) { parent.nf.CanvasUtils.showComponent(item.groupId, item.componentId); parent.$('#shell-close-button').click(); } @@ -1083,7 +1083,7 @@ // handles init failure var failure = function (xhr, status, error) { deferred.reject(); - errorHandler.handleAjaxError(xhr, status, error); + nfErrorHandler.handleAjaxError(xhr, status, error); }; // initialize the lineage view @@ -1104,7 +1104,7 @@ */ resetTableSize: function () { var provenanceGrid = $('#provenance-table').data('gridInstance'); - if (common.isDefinedAndNotNull(provenanceGrid)) { + if (nfCommon.isDefinedAndNotNull(provenanceGrid)) { provenanceGrid.resizeCanvas(); } }, @@ -1123,7 +1123,7 @@ // update the progress bar var label = $('<div class="progress-label"></div>').text(value + '%'); - (angularBridge.injector.get('$compile')($('<md-progress-linear ng-cloak ng-value="' + value + '" class="md-hue-2" md-mode="determinate" aria-label="Progress"></md-progress-linear>'))(angularBridge.rootScope)).appendTo(progressBar); + (nfNgBridge.injector.get('$compile')($('<md-progress-linear ng-cloak ng-value="' + value + '" class="md-hue-2" md-mode="determinate" aria-label="Progress"></md-progress-linear>'))(nfNgBridge.rootScope)).appendTo(progressBar); progressBar.append(label); }, @@ -1180,7 +1180,7 @@ // ----------------------------- // handle the specified query appropriately - if (common.isDefinedAndNotNull(query)) { + if (nfCommon.isDefinedAndNotNull(query)) { // store the last query performed cachedQuery = query; } else if (!$.isEmptyObject(cachedQuery)) { @@ -1194,7 +1194,7 @@ // closes the searching dialog and cancels the query on the server var closeDialog = function () { // cancel the provenance results since we've successfully processed the results - if (common.isDefinedAndNotNull(provenance)) { + if (nfCommon.isDefinedAndNotNull(provenance)) { cancelProvenance(provenance); } @@ -1227,11 +1227,11 @@ // process the results if they are finished if (provenance.finished === true) { // show any errors when the query finishes - if (!common.isEmpty(provenance.results.errors)) { + if (!nfCommon.isEmpty(provenance.results.errors)) { var errors = provenance.results.errors; - dialog.showOkDialog({ + nfDialog.showOkDialog({ headerText: 'Provenance', - dialogContent: common.formatUnorderedList(errors), + dialogContent: nfCommon.formatUnorderedList(errors), }); } @@ -1270,7 +1270,7 @@ */ getEventDetails: function (eventId, clusterNodeId) { var url; - if (common.isDefinedAndNotNull(clusterNodeId)) { + if (nfCommon.isDefinedAndNotNull(clusterNodeId)) { url = config.urls.provenanceEvents + encodeURIComponent(eventId) + '?' + $.param({ clusterNodeId: clusterNodeId }); @@ -1282,7 +1282,7 @@ type: 'GET', url: url, dataType: 'json' - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); }, /** @@ -1297,25 +1297,25 @@ // update the event details $('#provenance-event-id').text(event.eventId); - $('#provenance-event-time').html(common.formatValue(event.eventTime)).ellipsis(); - $('#provenance-event-type').html(common.formatValue(event.eventType)).ellipsis(); - $('#provenance-event-flowfile-uuid').html(common.formatValue(event.flowFileUuid)).ellipsis(); - $('#provenance-event-component-id').html(common.formatValue(event.componentId)).ellipsis(); - $('#provenance-event-component-name').html(common.formatValue(event.componentName)).ellipsis(); - $('#provenance-event-component-type').html(common.formatValue(event.componentType)).ellipsis(); - $('#provenance-event-details').html(common.formatValue(event.details)).ellipsis(); + $('#provenance-event-time').html(nfCommon.formatValue(event.eventTime)).ellipsis(); + $('#provenance-event-type').html(nfCommon.formatValue(event.eventType)).ellipsis(); + $('#provenance-event-flowfile-uuid').html(nfCommon.formatValue(event.flowFileUuid)).ellipsis(); + $('#provenance-event-component-id').html(nfCommon.formatValue(event.componentId)).ellipsis(); + $('#provenance-event-component-name').html(nfCommon.formatValue(event.componentName)).ellipsis(); + $('#provenance-event-component-type').html(nfCommon.formatValue(event.componentType)).ellipsis(); + $('#provenance-event-details').html(nfCommon.formatValue(event.details)).ellipsis(); // over the default tooltip with the actual byte count - var fileSize = $('#provenance-event-file-size').html(common.formatValue(event.fileSize)).ellipsis(); - fileSize.attr('title', common.formatInteger(event.fileSizeBytes) + ' bytes'); + var fileSize = $('#provenance-event-file-size').html(nfCommon.formatValue(event.fileSize)).ellipsis(); + fileSize.attr('title', nfCommon.formatInteger(event.fileSizeBytes) + ' bytes'); // sets an duration var setDuration = function (field, value) { - if (common.isDefinedAndNotNull(value)) { + if (nfCommon.isDefinedAndNotNull(value)) { if (value === 0) { field.text('< 1ms'); } else { - field.text(common.formatDuration(value)); + field.text(nfCommon.formatDuration(value)); } } else { field.html('<span class="unset">No value set</span>'); @@ -1330,7 +1330,7 @@ var formatEventDetail = function (label, value) { $('<div class="event-detail"></div>').append( $('<div class="detail-name"></div>').text(label)).append( - $('<div class="detail-value">' + common.formatValue(value) + '</div>').ellipsis()).append( + $('<div class="detail-value">' + nfCommon.formatValue(value) + '</div>').ellipsis()).append( $('<div class="clear"></div>')).appendTo('#additional-provenance-details'); }; @@ -1361,7 +1361,7 @@ } // conditionally show the cluster node identifier - if (common.isDefinedAndNotNull(event.clusterNodeId)) { + if (nfCommon.isDefinedAndNotNull(event.clusterNodeId)) { // save the cluster node id $('#provenance-event-cluster-node-id').text(event.clusterNodeId); @@ -1374,7 +1374,7 @@ var childUuids = $('#child-flowfiles-container'); // handle parent flowfiles - if (common.isEmpty(event.parentUuids)) { + if (nfCommon.isEmpty(event.parentUuids)) { $('#parent-flowfile-count').text(0); parentUuids.append('<span class="unset">No parents</span>'); } else { @@ -1385,7 +1385,7 @@ } // handle child flowfiles - if (common.isEmpty(event.childUuids)) { + if (nfCommon.isEmpty(event.childUuids)) { $('#child-flowfile-count').text(0); childUuids.append('<span class="unset">No children</span>'); } else { @@ -1402,23 +1402,23 @@ $.each(event.attributes, function (_, attribute) { // create the attribute record var attributeRecord = $('<div class="attribute-detail"></div>') - .append($('<div class="attribute-name">' + common.formatValue(attribute.name) + '</div>').ellipsis()) + .append($('<div class="attribute-name">' + nfCommon.formatValue(attribute.name) + '</div>').ellipsis()) .appendTo(attributesContainer); // add the current value attributeRecord - .append($('<div class="attribute-value">' + common.formatValue(attribute.value) + '</div>').ellipsis()) + .append($('<div class="attribute-value">' + nfCommon.formatValue(attribute.value) + '</div>').ellipsis()) .append('<div class="clear"></div>'); // show the previous value if the property has changed if (attribute.value !== attribute.previousValue) { - if (common.isDefinedAndNotNull(attribute.previousValue)) { + if (nfCommon.isDefinedAndNotNull(attribute.previousValue)) { attributeRecord - .append($('<div class="modified-attribute-value">' + common.formatValue(attribute.previousValue) + '<span class="unset"> (previous)</span></div>').ellipsis()) + .append($('<div class="modified-attribute-value">' + nfCommon.formatValue(attribute.previousValue) + '<span class="unset"> (previous)</span></div>').ellipsis()) .append('<div class="clear"></div>'); } else { attributeRecord - .append($('<div class="unset" style="font-size: 13px; padding-top: 2px;">' + common.formatValue(attribute.previousValue) + '</div>').ellipsis()) + .append($('<div class="unset" style="font-size: 13px; padding-top: 2px;">' + nfCommon.formatValue(attribute.previousValue) + '</div>').ellipsis()) .append('<div class="clear"></div>'); } } else { @@ -1428,7 +1428,7 @@ }); var formatContentValue = function (element, value) { - if (common.isDefinedAndNotNull(value)) { + if (nfCommon.isDefinedAndNotNull(value)) { element.removeClass('unset').text(value); } else { element.addClass('unset').text('No value previously set'); @@ -1446,9 +1446,9 @@ // input content file size var inputContentSize = $('#input-content-size'); formatContentValue(inputContentSize, event.inputContentClaimFileSize); - if (common.isDefinedAndNotNull(event.inputContentClaimFileSize)) { + if (nfCommon.isDefinedAndNotNull(event.inputContentClaimFileSize)) { // over the default tooltip with the actual byte count - inputContentSize.attr('title', common.formatInteger(event.inputContentClaimFileSizeBytes) + ' bytes'); + inputContentSize.attr('title', nfCommon.formatInteger(event.inputContentClaimFileSizeBytes) + ' bytes'); } formatContentValue($('#output-content-container'), event.outputContentClaimContainer); @@ -1460,15 +1460,15 @@ // output content file size var outputContentSize = $('#output-content-size'); formatContentValue(outputContentSize, event.outputContentClaimFileSize); - if (common.isDefinedAndNotNull(event.outputContentClaimFileSize)) { + if (nfCommon.isDefinedAndNotNull(event.outputContentClaimFileSize)) { // over the default tooltip with the actual byte count - outputContentSize.attr('title', common.formatInteger(event.outputContentClaimFileSizeBytes) + ' bytes'); + outputContentSize.attr('title', nfCommon.formatInteger(event.outputContentClaimFileSizeBytes) + ' bytes'); } if (event.inputContentAvailable === true) { $('#input-content-download').show(); - if (common.isContentViewConfigured()) { + if (nfCommon.isContentViewConfigured()) { $('#input-content-view').show(); } else { $('#input-content-view').hide(); @@ -1481,7 +1481,7 @@ if (event.outputContentAvailable === true) { $('#output-content-download').show(); - if (common.isContentViewConfigured()) { + if (nfCommon.isContentViewConfigured()) { $('#output-content-view').show(); } else { $('#output-content-view').hide();
