diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/jquery/modal/jquery.modal.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/jquery/modal/jquery.modal.js index 03cca9669d..25fe57ff74 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/jquery/modal/jquery.modal.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/jquery/modal/jquery.modal.js @@ -167,37 +167,37 @@ var dialog = $(this).addClass('dialog cancellable modal'); dialog.css('display', 'none'); - var nfDialog = {}; + var nfDialogData = {}; if (isDefinedAndNotNull(dialog.data('nf-dialog'))) { - nfDialog = dialog.data('nf-dialog'); + nfDialogData = dialog.data('nf-dialog'); } // ensure the options have been properly specified if (isDefinedAndNotNull(options)) { - $.extend(nfDialog, options); + $.extend(nfDialogData, options); //persist data attribute - dialog.data('nfDialog', nfDialog); + dialog.data('nfDialog', nfDialogData); } // determine if dialog needs a header - if (!isDefinedAndNotNull(nfDialog.header) || nfDialog.header) { + if (!isDefinedAndNotNull(nfDialogData.header) || nfDialogData.header) { var dialogHeaderText = $(''); var dialogHeader = $('
').prepend(dialogHeaderText); // determine if the specified header text is null - if (!isBlank(nfDialog.headerText)) { - dialogHeaderText.text(nfDialog.headerText); + if (!isBlank(nfDialogData.headerText)) { + dialogHeaderText.text(nfDialogData.headerText); } dialog.prepend(dialogHeader); } // determine if dialog needs footer/buttons - if (!isDefinedAndNotNull(nfDialog.footer) || nfDialog.footer) { + if (!isDefinedAndNotNull(nfDialogData.footer) || nfDialogData.footer) { // add the buttons - addButtons(dialog, nfDialog.buttons); + addButtons(dialog, nfDialogData.buttons); } }); }, @@ -210,17 +210,17 @@ setCloseHandler: function (handler) { return this.each(function (index, dialog) { - var nfDialog = {}; + var nfDialogData = {}; if (isDefinedAndNotNull($(this).data('nf-dialog'))) { - nfDialog = $(dialog).data('nf-dialog'); + nfDialogData = $(dialog).data('nf-dialog'); } - if (!isDefinedAndNotNull(nfDialog.handler)){ - nfDialog.handler = {}; + if (!isDefinedAndNotNull(nfDialogData.handler)){ + nfDialogData.handler = {}; } - nfDialog.handler.close = handler; + nfDialogData.handler.close = handler; //persist data attribute - $(dialog).data('nfDialog', nfDialog); + $(dialog).data('nfDialog', nfDialogData); }); }, @@ -232,17 +232,17 @@ setOpenHandler: function (handler) { return this.each(function (index, dialog) { - var nfDialog = {}; + var nfDialogData = {}; if (isDefinedAndNotNull($(this).data('nf-dialog'))) { - nfDialog = $(dialog).data('nf-dialog'); + nfDialogData = $(dialog).data('nf-dialog'); } - if (!isDefinedAndNotNull(nfDialog.handler)){ - nfDialog.handler = {}; + if (!isDefinedAndNotNull(nfDialogData.handler)){ + nfDialogData.handler = {}; } - nfDialog.handler.open = handler; + nfDialogData.handler.open = handler; //persist data attribute - $(dialog).data('nfDialog', nfDialog); + $(dialog).data('nfDialog', nfDialogData); }); }, @@ -254,17 +254,17 @@ setResizeHandler: function (handler) { return this.each(function (index, dialog) { - var nfDialog = {}; + var nfDialogData = {}; if (isDefinedAndNotNull($(this).data('nf-dialog'))) { - nfDialog = $(dialog).data('nf-dialog'); + nfDialogData = $(dialog).data('nf-dialog'); } - if (!isDefinedAndNotNull(nfDialog.handler)){ - nfDialog.handler = {}; + if (!isDefinedAndNotNull(nfDialogData.handler)){ + nfDialogData.handler = {}; } - nfDialog.handler.resize = handler; + nfDialogData.handler.resize = handler; //persist data attribute - $(dialog).data('nfDialog', nfDialog); + $(dialog).data('nfDialog', nfDialogData); }); }, @@ -318,147 +318,147 @@ var dialog = $(this); var dialogContent = dialog.find('.dialog-content'); - var nfDialog = {}; + var nfDialogData = {}; if (isDefinedAndNotNull(dialog.data('nf-dialog'))) { - nfDialog = dialog.data('nf-dialog'); + nfDialogData = dialog.data('nf-dialog'); } //initialize responsive properties - if (!isDefinedAndNotNull(nfDialog.responsive)) { - nfDialog.responsive = {}; + if (!isDefinedAndNotNull(nfDialogData.responsive)) { + nfDialogData.responsive = {}; - if (!isDefinedAndNotNull(nfDialog.responsive.x)) { - nfDialog.responsive.x = true; + if (!isDefinedAndNotNull(nfDialogData.responsive.x)) { + nfDialogData.responsive.x = true; } - if (!isDefinedAndNotNull(nfDialog.responsive.y)) { - nfDialog.responsive.y = true; + if (!isDefinedAndNotNull(nfDialogData.responsive.y)) { + nfDialogData.responsive.y = true; } } else { - if (!isDefinedAndNotNull(nfDialog.responsive.x)) { - nfDialog.responsive.x = true; + if (!isDefinedAndNotNull(nfDialogData.responsive.x)) { + nfDialogData.responsive.x = true; } else { - nfDialog.responsive.x = (nfDialog.responsive.x == "true" || nfDialog.responsive.x == true) ? true : false; + nfDialogData.responsive.x = (nfDialogData.responsive.x == "true" || nfDialogData.responsive.x == true) ? true : false; } - if (!isDefinedAndNotNull(nfDialog.responsive.y)) { - nfDialog.responsive.y = true; + if (!isDefinedAndNotNull(nfDialogData.responsive.y)) { + nfDialogData.responsive.y = true; } else { - nfDialog.responsive.y = (nfDialog.responsive.y == "true" || nfDialog.responsive.y == true) ? true : false; + nfDialogData.responsive.y = (nfDialogData.responsive.y == "true" || nfDialogData.responsive.y == true) ? true : false; } } - if (nfDialog.responsive.y || nfDialog.responsive.x) { + if (nfDialogData.responsive.y || nfDialogData.responsive.x) { var fullscreenHeight; var fullscreenWidth; - if (isDefinedAndNotNull(nfDialog.responsive['fullscreen-height'])) { - fullscreenHeight = parseInt(nfDialog.responsive['fullscreen-height'], 10); + if (isDefinedAndNotNull(nfDialogData.responsive['fullscreen-height'])) { + fullscreenHeight = parseInt(nfDialogData.responsive['fullscreen-height'], 10); } else { - nfDialog.responsive['fullscreen-height'] = dialog.height() + 'px'; + nfDialogData.responsive['fullscreen-height'] = dialog.height() + 'px'; - fullscreenHeight = parseInt(nfDialog.responsive['fullscreen-height'], 10); + fullscreenHeight = parseInt(nfDialogData.responsive['fullscreen-height'], 10); } - if (isDefinedAndNotNull(nfDialog.responsive['fullscreen-width'])) { - fullscreenWidth = parseInt(nfDialog.responsive['fullscreen-width'], 10); + if (isDefinedAndNotNull(nfDialogData.responsive['fullscreen-width'])) { + fullscreenWidth = parseInt(nfDialogData.responsive['fullscreen-width'], 10); } else { - nfDialog.responsive['fullscreen-width'] = dialog.width() + 'px'; + nfDialogData.responsive['fullscreen-width'] = dialog.width() + 'px'; - fullscreenWidth = parseInt(nfDialog.responsive['fullscreen-width'], 10); + fullscreenWidth = parseInt(nfDialogData.responsive['fullscreen-width'], 10); } - if (!isDefinedAndNotNull(nfDialog.width)) { - nfDialog.width = dialog.css('width'); + if (!isDefinedAndNotNull(nfDialogData.width)) { + nfDialogData.width = dialog.css('width'); } - if (!isDefinedAndNotNull(nfDialog['min-width'])) { + if (!isDefinedAndNotNull(nfDialogData['min-width'])) { if (parseInt(dialog.css('min-width'), 10) > 0) { - nfDialog['min-width'] = dialog.css('min-width'); + nfDialogData['min-width'] = dialog.css('min-width'); } else { - nfDialog['min-width'] = nfDialog.width; + nfDialogData['min-width'] = nfDialogData.width; } } //min-width should always be set in terms of px - if (nfDialog['min-width'].indexOf("%") > 0) { - nfDialog['min-width'] = ($(window).width() * (parseInt(nfDialog['min-width'], 10) / 100)) + 'px'; + if (nfDialogData['min-width'].indexOf("%") > 0) { + nfDialogData['min-width'] = ($(window).width() * (parseInt(nfDialogData['min-width'], 10) / 100)) + 'px'; } - if (!isDefinedAndNotNull(nfDialog.height)) { - nfDialog.height = dialog.css('height'); + if (!isDefinedAndNotNull(nfDialogData.height)) { + nfDialogData.height = dialog.css('height'); } - if (!isDefinedAndNotNull(nfDialog['min-height'])) { + if (!isDefinedAndNotNull(nfDialogData['min-height'])) { if (parseInt(dialog.css('min-height'), 10) > 0) { - nfDialog['min-height'] = dialog.css('min-height'); + nfDialogData['min-height'] = dialog.css('min-height'); } else { - nfDialog['min-height'] = nfDialog.height; + nfDialogData['min-height'] = nfDialogData.height; } } //min-height should always be set in terms of px - if (nfDialog['min-height'].indexOf("%") > 0) { - nfDialog['min-height'] = ($(window).height() * (parseInt(nfDialog['min-height'], 10) / 100)) + 'px'; + if (nfDialogData['min-height'].indexOf("%") > 0) { + nfDialogData['min-height'] = ($(window).height() * (parseInt(nfDialogData['min-height'], 10) / 100)) + 'px'; } //resize dialog if ($(window).height() < fullscreenHeight) { - if (nfDialog.responsive.y) { + if (nfDialogData.responsive.y) { dialog.css('height', '100%'); dialog.css('min-height', '100%'); } } else { //set the dialog min-height - dialog.css('min-height', nfDialog['min-height']); - if (nfDialog.responsive.y) { - //make sure nfDialog.height is in terms of % - if (nfDialog.height.indexOf("px") > 0) { - nfDialog.height = (parseInt(nfDialog.height, 10) / $(window).height() * 100) + '%'; + dialog.css('min-height', nfDialogData['min-height']); + if (nfDialogData.responsive.y) { + //make sure nfDialogData.height is in terms of % + if (nfDialogData.height.indexOf("px") > 0) { + nfDialogData.height = (parseInt(nfDialogData.height, 10) / $(window).height() * 100) + '%'; } - dialog.css('height', nfDialog.height); + dialog.css('height', nfDialogData.height); } } if ($(window).width() < fullscreenWidth) { - if (nfDialog.responsive.x) { + if (nfDialogData.responsive.x) { dialog.css('width', '100%'); dialog.css('min-width', '100%'); } } else { //set the dialog width - dialog.css('min-width', nfDialog['min-width']); - if (nfDialog.responsive.x) { - //make sure nfDialog.width is in terms of % - if (nfDialog.width.indexOf("px") > 0) { - nfDialog.width = (parseInt(nfDialog.width, 10) / $(window).width() * 100) + '%'; + dialog.css('min-width', nfDialogData['min-width']); + if (nfDialogData.responsive.x) { + //make sure nfDialogData.width is in terms of % + if (nfDialogData.width.indexOf("px") > 0) { + nfDialogData.width = (parseInt(nfDialogData.width, 10) / $(window).width() * 100) + '%'; } - dialog.css('width', nfDialog.width); + dialog.css('width', nfDialogData.width); } } dialog.center(); //persist data attribute - dialog.data('nfDialog', nfDialog); + dialog.data('nfDialog', nfDialogData); } //apply scrollable style if applicable if (dialogContent[0].offsetHeight < dialogContent[0].scrollHeight) { // your element has overflow - if (isDefinedAndNotNull(nfDialog.scrollableContentStyle)) { - dialogContent.addClass(nfDialog.scrollableContentStyle); + if (isDefinedAndNotNull(nfDialogData.scrollableContentStyle)) { + dialogContent.addClass(nfDialogData.scrollableContentStyle); } } else { // your element doesn't have overflow - if (isDefinedAndNotNull(nfDialog.scrollableContentStyle)) { - dialogContent.removeClass(nfDialog.scrollableContentStyle); + if (isDefinedAndNotNull(nfDialogData.scrollableContentStyle)) { + dialogContent.removeClass(nfDialogData.scrollableContentStyle); } } - if (isDefinedAndNotNull(nfDialog.handler)) { - var handler = nfDialog.handler.resize; + if (isDefinedAndNotNull(nfDialogData.handler)) { + var handler = nfDialogData.handler.resize; if (isDefinedAndNotNull(handler) && typeof handler === 'function') { // invoke the handler handler.call(dialog); @@ -492,20 +492,20 @@ } dialog.css('z-index', zIndex); - var nfDialog = {}; + var nfDialogData = {}; if (isDefinedAndNotNull(dialog.data('nf-dialog'))) { - nfDialog = dialog.data('nf-dialog'); + nfDialogData = dialog.data('nf-dialog'); } var glasspane; - if (isDefinedAndNotNull(nfDialog.glasspane)) { - glasspane = nfDialog.glasspane; + if (isDefinedAndNotNull(nfDialogData.glasspane)) { + glasspane = nfDialogData.glasspane; } else { - nfDialog.glasspane = glasspane = dialog.find('.dialog-header').css('background-color'); //default to header color + nfDialogData.glasspane = glasspane = dialog.find('.dialog-header').css('background-color'); //default to header color } - if(top !== window || !isDefinedAndNotNull(nfDialog.glasspane)) { - nfDialog.glasspane = glasspane = 'transparent'; + if(top !== window || !isDefinedAndNotNull(nfDialogData.glasspane)) { + nfDialogData.glasspane = glasspane = 'transparent'; } if (!$('body').find("[data-nf-dialog-parent='" + dialog.attr('id') + "']").is(':visible')) { @@ -517,7 +517,7 @@ } //persist data attribute - dialog.data('nfDialog', nfDialog); + dialog.data('nfDialog', nfDialogData); return this.each(function () { // show the dialog @@ -526,8 +526,8 @@ dialog.modal('resize'); dialog.center(); - if (isDefinedAndNotNull(nfDialog.handler)) { - var handler = nfDialog.handler.open; + if (isDefinedAndNotNull(nfDialogData.handler)) { + var handler = nfDialogData.handler.open; if (isDefinedAndNotNull(handler) && typeof handler === 'function') { // invoke the handler handler.call(dialog); @@ -544,13 +544,13 @@ return this.each(function () { var dialog = $(this); - var nfDialog = {}; + var nfDialogData = {}; if (isDefinedAndNotNull(dialog.data('nf-dialog'))) { - nfDialog = dialog.data('nf-dialog'); + nfDialogData = dialog.data('nf-dialog'); } - if (isDefinedAndNotNull(nfDialog.handler)) { - var handler = nfDialog.handler.close; + if (isDefinedAndNotNull(nfDialogData.handler)) { + var handler = nfDialogData.handler.close; if (isDefinedAndNotNull(handler) && typeof handler === 'function') { // invoke the handler handler.call(dialog); diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/jquery/nfeditor/jquery.nfeditor.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/jquery/nfeditor/jquery.nfeditor.js index ba673a4751..8a00257cb9 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/jquery/nfeditor/jquery.nfeditor.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/jquery/nfeditor/jquery.nfeditor.js @@ -22,8 +22,8 @@ define(['jquery', 'CodeMirror', 'nf'], - function ($, common) { - factory($, common); + function ($, CodeMirror, nf) { + factory($, CodeMirror, nf); }); } else if (typeof exports === 'object' && typeof module === 'object') { factory(require('jquery'), diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/jquery/propertytable/jquery.propertytable.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/jquery/propertytable/jquery.propertytable.js index dacd8a0b62..5e298ae081 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/jquery/propertytable/jquery.propertytable.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/jquery/propertytable/jquery.propertytable.js @@ -32,22 +32,22 @@ 'nf.Settings'], function ($, Slick, - common, - universalCapture, - dialog, - client, - errorHandler, - processGroupConfiguration, - settings) { + nfCommon, + nfUniversalCapture, + nfDialog, + nfClient, + nfErrorHandler, + nfProcessGroupConfiguration, + nfSettings) { factory($, Slick, - common, - universalCapture, - dialog, - client, - errorHandler, - processGroupConfiguration, - settings); + nfCommon, + nfUniversalCapture, + nfDialog, + nfClient, + nfErrorHandler, + nfProcessGroupConfiguration, + nfSettings); }); } else if (typeof exports === 'object' && typeof module === 'object') { factory(require('jquery'), @@ -72,13 +72,13 @@ } }(this, function ($, Slick, - common, - universalCapture, - dialog, - client, - errorHandler, - processGroupConfiguration, - settings) { + nfCommon, + nfUniversalCapture, + nfDialog, + nfClient, + nfErrorHandler, + nfProcessGroupConfiguration, + nfSettings) { var languageId = 'nfel'; var editorClass = languageId + '-editor'; @@ -124,7 +124,8 @@ 'width': args.position.width + 'px', 'min-width': '212px', 'margin-bottom': '5px', - 'margin-top': '10px' + 'margin-top': '10px', + 'white-space': 'pre' }).tab().on('keydown', scope.handleKeyDown).appendTo(wrapper); wrapper.draggable({ @@ -219,12 +220,12 @@ this.loadValue = function (item) { // determine if this is a sensitive property var isEmptyChecked = false; - var sensitive = common.isSensitiveProperty(propertyDescriptor); + var sensitive = nfCommon.isSensitiveProperty(propertyDescriptor); // determine the value to use when populating the text field - if (common.isDefinedAndNotNull(item[args.column.field])) { + if (nfCommon.isDefinedAndNotNull(item[args.column.field])) { if (sensitive) { - initialValue = common.config.sensitiveText; + initialValue = nfCommon.config.sensitiveText; } else { initialValue = item[args.column.field]; isEmptyChecked = initialValue === ''; @@ -241,7 +242,7 @@ var sensitiveInput = $(this); if (sensitiveInput.hasClass('sensitive')) { sensitiveInput.removeClass('sensitive'); - if (sensitiveInput.val() === common.config.sensitiveText) { + if (sensitiveInput.val() === nfCommon.config.sensitiveText) { sensitiveInput.val(''); } } @@ -260,8 +261,8 @@ return ''; } else { // otherwise if the property is required - if (common.isRequiredProperty(propertyDescriptor)) { - if (common.isBlank(propertyDescriptor.defaultValue)) { + if (nfCommon.isRequiredProperty(propertyDescriptor)) { + if (nfCommon.isBlank(propertyDescriptor.defaultValue)) { return previousValue; } else { return propertyDescriptor.defaultValue; @@ -322,7 +323,7 @@ propertyDescriptor = descriptors[args.item.property]; // determine if this is a sensitive property - var sensitive = common.isSensitiveProperty(propertyDescriptor); + var sensitive = nfCommon.isSensitiveProperty(propertyDescriptor); // record the previous value previousValue = args.item[args.column.field]; @@ -439,12 +440,12 @@ this.loadValue = function (item) { // determine if this is a sensitive property var isEmptyChecked = false; - var sensitive = common.isSensitiveProperty(propertyDescriptor); + var sensitive = nfCommon.isSensitiveProperty(propertyDescriptor); // determine the value to use when populating the text field - if (common.isDefinedAndNotNull(item[args.column.field])) { + if (nfCommon.isDefinedAndNotNull(item[args.column.field])) { if (sensitive) { - initialValue = common.config.sensitiveText; + initialValue = nfCommon.config.sensitiveText; } else { initialValue = item[args.column.field]; isEmptyChecked = initialValue === ''; @@ -468,8 +469,8 @@ return ''; } else { // otherwise if the property is required - if (common.isRequiredProperty(propertyDescriptor)) { - if (common.isBlank(propertyDescriptor.defaultValue)) { + if (nfCommon.isRequiredProperty(propertyDescriptor)) { + if (nfCommon.isBlank(propertyDescriptor.defaultValue)) { return previousValue; } else { return propertyDescriptor.defaultValue; @@ -553,7 +554,7 @@ }).appendTo(container); // check for allowable values which will drive which editor to use - var allowableValues = common.getAllowableValues(propertyDescriptor); + var allowableValues = nfCommon.getAllowableValues(propertyDescriptor); // show the output port options var options = []; @@ -571,7 +572,7 @@ text: allowableValue.displayName, value: allowableValue.value, disabled: allowableValueEntity.canRead === false && allowableValue.value !== args.item['previousValue'], - description: common.escapeHtml(allowableValue.description) + description: nfCommon.escapeHtml(allowableValue.description) }); }); } @@ -587,7 +588,7 @@ } // if this descriptor identifies a controller service, provide a way to create one - if (common.isDefinedAndNotNull(propertyDescriptor.identifiesControllerService)) { + if (nfCommon.isDefinedAndNotNull(propertyDescriptor.identifiesControllerService)) { options.push({ text: 'Create new service...', value: undefined, @@ -685,13 +686,13 @@ this.loadValue = function (item) { // select as appropriate - if (!common.isUndefined(item.value)) { + if (!nfCommon.isUndefined(item.value)) { initialValue = item.value; combo.combo('setSelectedOption', { value: item.value }); - } else if (common.isDefinedAndNotNull(propertyDescriptor.defaultValue)) { + } else if (nfCommon.isDefinedAndNotNull(propertyDescriptor.defaultValue)) { initialValue = propertyDescriptor.defaultValue; combo.combo('setSelectedOption', { @@ -735,20 +736,20 @@ */ var showPropertyValue = function (propertyGrid, descriptors, row, cell) { // remove any currently open detail dialogs - universalCapture.removeAllPropertyDetailDialogs(); + nfUniversalCapture.removeAllPropertyDetailDialogs(); // get the property in question var propertyData = propertyGrid.getData(); var property = propertyData.getItem(row); // ensure there is a value - if (common.isDefinedAndNotNull(property.value)) { + if (nfCommon.isDefinedAndNotNull(property.value)) { // get the descriptor to insert the description tooltip var propertyDescriptor = descriptors[property.property]; // ensure we're not dealing with a sensitive property - if (!common.isSensitiveProperty(propertyDescriptor)) { + if (!nfCommon.isSensitiveProperty(propertyDescriptor)) { // get details about the location of the cell var cellNode = $(propertyGrid.getCellNode(row, cell)); @@ -769,7 +770,7 @@ 'left': offset.left - 20 }).appendTo('body'); - var allowableValues = common.getAllowableValues(propertyDescriptor); + var allowableValues = nfCommon.getAllowableValues(propertyDescriptor); if ($.isArray(allowableValues)) { // prevent dragging over the combo wrapper.draggable({ @@ -784,7 +785,7 @@ options.push({ text: allowableValue.displayName, value: allowableValue.value, - description: common.escapeHtml(allowableValue.description), + description: nfCommon.escapeHtml(allowableValue.description), disabled: true }); }); @@ -833,7 +834,7 @@ var editor = null; // so the nfel editor is appropriate - if (common.supportsEl(propertyDescriptor)) { + if (nfCommon.supportsEl(propertyDescriptor)) { var languageId = 'nfel'; var editorClass = languageId + '-editor'; @@ -957,15 +958,15 @@ var options = []; $.each(response.controllerServiceTypes, function (i, controllerServiceType) { options.push({ - text: common.substringAfterLast(controllerServiceType.type, '.'), + text: nfCommon.substringAfterLast(controllerServiceType.type, '.'), value: controllerServiceType.type, - description: common.escapeHtml(controllerServiceType.description) + description: nfCommon.escapeHtml(controllerServiceType.description) }); }); // ensure there are some applicable controller services if (options.length === 0) { - dialog.showOkDialog({ + nfDialog.showOkDialog({ headerText: 'Controller Service', dialogContent: 'No controller service types found that are applicable for this property.' }); @@ -1053,7 +1054,7 @@ // build the controller service entity var controllerServiceEntity = { - 'revision': client.getRevision({ + 'revision': nfClient.getRevision({ 'revision': { 'version': 0, } @@ -1065,7 +1066,7 @@ // determine the appropriate uri for creating the controller service var uri = '../nifi-api/controller/controller-services'; - if (common.isDefinedAndNotNull(groupId)) { + if (nfCommon.isDefinedAndNotNull(groupId)) { uri = '../nifi-api/process-groups/' + encodeURIComponent(groupId) + '/controller-services'; } @@ -1083,7 +1084,7 @@ // store the descriptor for use later var descriptors = gridContainer.data('descriptors'); - if (!common.isUndefined(descriptors)) { + if (!nfCommon.isUndefined(descriptors)) { descriptors[descriptor.name] = descriptor; } @@ -1101,7 +1102,7 @@ if (typeof configurationOptions.controllerServiceCreatedDeferred === 'function') { configurationOptions.controllerServiceCreatedDeferred(response); } - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); }; var cancel = function () { @@ -1110,7 +1111,7 @@ newControllerServiceDialog.modal('show'); } - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); }; var initPropertiesTable = function (table, options) { @@ -1130,8 +1131,8 @@ var propertyDescriptor = descriptors[dataContext.property]; // show the property description if applicable - if (common.isDefinedAndNotNull(propertyDescriptor)) { - if (!common.isBlank(propertyDescriptor.description) || !common.isBlank(propertyDescriptor.defaultValue) || !common.isBlank(propertyDescriptor.supportsEl)) { + if (nfCommon.isDefinedAndNotNull(propertyDescriptor)) { + if (!nfCommon.isBlank(propertyDescriptor.description) || !nfCommon.isBlank(propertyDescriptor.defaultValue) || !nfCommon.isBlank(propertyDescriptor.supportsEl)) { $('
').appendTo(cellContent); $('').text(dataContext.property).appendTo(cellContent); nameWidthOffset = 46; // 10 + icon width (10) + icon margin (6) + padding (20) @@ -1148,17 +1149,17 @@ // function for formatting the property value var valueFormatter = function (row, cell, value, columnDef, dataContext) { var valueMarkup; - if (common.isDefinedAndNotNull(value)) { + if (nfCommon.isDefinedAndNotNull(value)) { // get the property descriptor var descriptors = table.data('descriptors'); var propertyDescriptor = descriptors[dataContext.property]; // determine if the property is sensitive - if (common.isSensitiveProperty(propertyDescriptor)) { + if (nfCommon.isSensitiveProperty(propertyDescriptor)) { valueMarkup = 'Sensitive value set'; } else { // if there are allowable values, attempt to swap out for the display name - var allowableValues = common.getAllowableValues(propertyDescriptor); + var allowableValues = nfCommon.getAllowableValues(propertyDescriptor); if ($.isArray(allowableValues)) { $.each(allowableValues, function (_, allowableValueEntity) { var allowableValue = allowableValueEntity.allowableValue; @@ -1172,7 +1173,7 @@ if (value === '') { valueMarkup = 'Empty string set'; } else { - valueMarkup = '
' + common.escapeHtml(value) + '
'; + valueMarkup = '
' + nfCommon.escapeHtml(value) + '
'; } } } else { @@ -1220,8 +1221,8 @@ var descriptors = table.data('descriptors'); var propertyDescriptor = descriptors[dataContext.property]; - var identifiesControllerService = common.isDefinedAndNotNull(propertyDescriptor.identifiesControllerService); - var isConfigured = common.isDefinedAndNotNull(dataContext.value); + var identifiesControllerService = nfCommon.isDefinedAndNotNull(propertyDescriptor.identifiesControllerService); + var isConfigured = nfCommon.isDefinedAndNotNull(dataContext.value); // check to see if we should provide a button for going to a controller service if (identifiesControllerService && isConfigured && (options.supportsGoTo === true)) { @@ -1273,7 +1274,7 @@ var propertyDescriptor = descriptors[item.property]; // support el if specified or unsure yet (likely a dynamic property) - if (common.isUndefinedOrNull(propertyDescriptor) || common.supportsEl(propertyDescriptor)) { + if (nfCommon.isUndefinedOrNull(propertyDescriptor) || nfCommon.supportsEl(propertyDescriptor)) { return { columns: { value: { @@ -1283,7 +1284,7 @@ }; } else { // check for allowable values which will drive which editor to use - var allowableValues = common.getAllowableValues(propertyDescriptor); + var allowableValues = nfCommon.getAllowableValues(propertyDescriptor); if ($.isArray(allowableValues)) { return { columns: { @@ -1320,37 +1321,37 @@ var controllerService = controllerServiceEntity.component; $.Deferred(function (deferred) { - if (common.isDefinedAndNotNull(controllerService.parentGroupId)) { + if (nfCommon.isDefinedAndNotNull(controllerService.parentGroupId)) { if ($('#process-group-configuration').is(':visible')) { - processGroupConfiguration.loadConfiguration(controllerService.parentGroupId).done(function () { + nfProcessGroupConfiguration.loadConfiguration(controllerService.parentGroupId).done(function () { deferred.resolve(); }); } else { - processGroupConfiguration.showConfiguration(controllerService.parentGroupId).done(function () { + nfProcessGroupConfiguration.showConfiguration(controllerService.parentGroupId).done(function () { deferred.resolve(); }); } } else { if ($('#settings').is(':visible')) { // reload the settings - settings.loadSettings().done(function () { + nfSettings.loadSettings().done(function () { deferred.resolve(); }); } else { // reload the settings and show - settings.showSettings().done(function () { + nfSettings.showSettings().done(function () { deferred.resolve(); }); } } }).done(function () { - if (common.isDefinedAndNotNull(controllerService.parentGroupId)) { - processGroupConfiguration.selectControllerService(property.value); + if (nfCommon.isDefinedAndNotNull(controllerService.parentGroupId)) { + nfProcessGroupConfiguration.selectControllerService(property.value); } else { - settings.selectControllerService(property.value); + nfSettings.selectControllerService(property.value); } }); - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); }; // initialize the grid @@ -1433,11 +1434,11 @@ var propertyHistory = history[property]; // format the tooltip - var tooltip = common.formatPropertyTooltip(propertyDescriptor, propertyHistory); + var tooltip = nfCommon.formatPropertyTooltip(propertyDescriptor, propertyHistory); - if (common.isDefinedAndNotNull(tooltip)) { + if (nfCommon.isDefinedAndNotNull(tooltip)) { infoIcon.qtip($.extend({}, - common.config.tooltipConfig, + nfCommon.config.tooltipConfig, { content: tooltip })); @@ -1449,7 +1450,7 @@ var saveRow = function (table) { // get the property grid to commit the current edit var propertyGrid = table.data('gridInstance'); - if (common.isDefinedAndNotNull(propertyGrid)) { + if (nfCommon.isDefinedAndNotNull(propertyGrid)) { var editController = propertyGrid.getEditController(); editController.commitCurrentEdit(); } @@ -1486,7 +1487,7 @@ var propertyData = propertyGrid.getData(); // generate the properties - if (common.isDefinedAndNotNull(properties)) { + if (nfCommon.isDefinedAndNotNull(properties)) { propertyData.beginUpdate(); var i = 0; @@ -1497,10 +1498,10 @@ // determine the property type var type = 'userDefined'; var displayName = name; - if (common.isDefinedAndNotNull(descriptor)) { - if (common.isRequiredProperty(descriptor)) { + if (nfCommon.isDefinedAndNotNull(descriptor)) { + if (nfCommon.isRequiredProperty(descriptor)) { type = 'required'; - } else if (common.isDynamicProperty(descriptor)) { + } else if (nfCommon.isDynamicProperty(descriptor)) { type = 'userDefined'; } else { type = 'optional'; @@ -1510,7 +1511,7 @@ displayName = descriptor.displayName; // determine the value - if (common.isNull(value) && common.isDefinedAndNotNull(descriptor.defaultValue)) { + if (nfCommon.isNull(value) && nfCommon.isDefinedAndNotNull(descriptor.defaultValue)) { value = descriptor.defaultValue; } } @@ -1539,10 +1540,10 @@ var clear = function (propertyTableContainer) { var options = propertyTableContainer.data('options'); if (options.readOnly === true) { - universalCapture.removeAllPropertyDetailDialogs(); + nfUniversalCapture.removeAllPropertyDetailDialogs(); } else { // clear any existing new property dialogs - if (common.isDefinedAndNotNull(options.dialogContainer)) { + if (nfCommon.isDefinedAndNotNull(options.dialogContainer)) { $('#new-property-dialog').modal("hide"); } } @@ -1552,7 +1553,7 @@ table.removeData('descriptors history'); // clean up any tooltips that may have been generated - common.cleanUpTooltips(table, 'div.fa-question-circle'); + nfCommon.cleanUpTooltips(table, 'div.fa-question-circle'); // clear the data in the grid var propertyGrid = table.data('gridInstance'); @@ -1586,7 +1587,7 @@ init: function (options) { return this.each(function () { // ensure the options have been properly specified - if (common.isDefinedAndNotNull(options)) { + if (nfCommon.isDefinedAndNotNull(options)) { // get the tag cloud var propertyTableContainer = $(this); @@ -1601,7 +1602,7 @@ var table = $('
').appendTo(propertyTableContainer); // optionally add a add new property button - if (options.readOnly !== true && common.isDefinedAndNotNull(options.dialogContainer)) { + if (options.readOnly !== true && nfCommon.isDefinedAndNotNull(options.dialogContainer)) { // build the new property dialog var newPropertyDialogMarkup = '').append(concurrentTasks).appendTo(concurrentTasksContainer).find('div.concurrent-tasks-info').qtip($.extend({}, - common.config.tooltipConfig, + nfCommon.config.tooltipConfig, { content: 'The number of tasks that should be concurrently scheduled for this port.' })); @@ -461,7 +461,7 @@ portContainer.find('.ellipsis').ellipsis(); // inform Angular app values have changed - angularBridge.digest(); + nfNgBridge.digest(); }; /** @@ -506,7 +506,7 @@ */ showPorts: function (selection) { // if the specified component is a remote process group, load its properties - if (canvasUtils.isRemoteProcessGroup(selection)) { + if (nfCanvasUtils.isRemoteProcessGroup(selection)) { var selectionData = selection.datum(); // load the properties for the specified component @@ -527,7 +527,7 @@ // get the contents var remoteProcessGroupContents = remoteProcessGroup.contents; - if (common.isDefinedAndNotNull(remoteProcessGroupContents)) { + if (nfCommon.isDefinedAndNotNull(remoteProcessGroupContents)) { var connectedInputPorts = []; var disconnectedInputPorts = []; @@ -551,7 +551,7 @@ createPortOption(inputPortContainer, inputPort, 'input'); }); - if (common.isEmpty(connectedInputPorts) && common.isEmpty(disconnectedInputPorts)) { + if (nfCommon.isEmpty(connectedInputPorts) && nfCommon.isEmpty(disconnectedInputPorts)) { $('
').text("No ports to display").appendTo(inputPortContainer); } @@ -578,14 +578,14 @@ createPortOption(outputPortContainer, outputPort, 'output'); }); - if (common.isEmpty(connectedOutputPorts) && common.isEmpty(disconnectedOutputPorts)) { + if (nfCommon.isEmpty(connectedOutputPorts) && nfCommon.isEmpty(disconnectedOutputPorts)) { $('
').text("No ports to display").appendTo(outputPortContainer); } } // show the details $('#remote-process-group-ports').modal('show'); - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); } } }; diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-remote-process-group.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-remote-process-group.js index f487ca422a..9842c71d33 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-remote-process-group.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-remote-process-group.js @@ -25,8 +25,8 @@ 'nf.Common', 'nf.Client', 'nf.CanvasUtils'], - function ($, d3, connection, common, client, canvasUtils) { - return (nf.RemoteProcessGroup = factory($, d3, connection, common, client, canvasUtils)); + function ($, d3, nfConnection, nfCommon, nfClient, nfCanvasUtils) { + return (nf.RemoteProcessGroup = factory($, d3, nfConnection, nfCommon, nfClient, nfCanvasUtils)); }); } else if (typeof exports === 'object' && typeof module === 'object') { module.exports = (nf.RemoteProcessGroup = @@ -44,7 +44,7 @@ root.nf.Client, root.nf.CanvasUtils); } -}(this, function ($, d3, connection, common, client, canvasUtils) { +}(this, function ($, d3, nfConnection, nfCommon, nfClient, nfCanvasUtils) { 'use strict'; var nfConnectable; @@ -88,7 +88,7 @@ * @param {object} d */ var getProcessGroupComments = function (d) { - if (common.isBlank(d.component.comments)) { + if (nfCommon.isBlank(d.component.comments)) { return 'No comments specified'; } else { return d.component.comments; @@ -123,7 +123,7 @@ 'class': 'remote-process-group component' }) .classed('selected', selected) - .call(canvasUtils.position); + .call(nfCanvasUtils.position); // ---- // body @@ -211,7 +211,7 @@ var details = remoteProcessGroup.select('g.remote-process-group-details'); // update the component behavior as appropriate - canvasUtils.editable(remoteProcessGroup, nfConnectable, nfDraggable); + nfCanvasUtils.editable(remoteProcessGroup, nfConnectable, nfDraggable); // if this processor is visible, render everything if (remoteProcessGroup.classed('visible')) { @@ -532,7 +532,7 @@ remoteProcessGroupUri.text(null).selectAll('title').remove(); // apply ellipsis to the remote process group name as necessary - canvasUtils.ellipsis(remoteProcessGroupUri, d.component.targetUris); + nfCanvasUtils.ellipsis(remoteProcessGroupUri, d.component.targetUris); }).append('title').text(function (d) { return d.component.name; }); @@ -571,7 +571,7 @@ }); // add the tooltip - canvasUtils.canvasTooltip(tip, d3.select(this)); + nfCanvasUtils.canvasTooltip(tip, d3.select(this)); }); // --------------- @@ -587,9 +587,9 @@ remoteProcessGroupComments.text(null).selectAll('tspan, title').remove(); // apply ellipsis to the port name as necessary - canvasUtils.ellipsis(remoteProcessGroupComments, getProcessGroupComments(d)); + nfCanvasUtils.ellipsis(remoteProcessGroupComments, getProcessGroupComments(d)); }).classed('unset', function (d) { - return common.isBlank(d.component.comments); + return nfCommon.isBlank(d.component.comments); }).append('title').text(function (d) { return getProcessGroupComments(d); }); @@ -600,7 +600,7 @@ details.select('text.remote-process-group-last-refresh') .text(function (d) { - if (common.isDefinedAndNotNull(d.component.flowRefreshed)) { + if (nfCommon.isDefinedAndNotNull(d.component.flowRefreshed)) { return d.component.flowRefreshed; } else { return 'Remote flow not current'; @@ -616,7 +616,7 @@ remoteProcessGroupName.text(null).selectAll('title').remove(); // apply ellipsis to the remote process group name as necessary - canvasUtils.ellipsis(remoteProcessGroupName, d.component.name); + nfCanvasUtils.ellipsis(remoteProcessGroupName, d.component.name); }).append('title').text(function (d) { return d.component.name; }); @@ -680,13 +680,13 @@ // sent count value updated.select('text.remote-process-group-sent tspan.count') .text(function (d) { - return common.substringBeforeFirst(d.status.aggregateSnapshot.sent, ' '); + return nfCommon.substringBeforeFirst(d.status.aggregateSnapshot.sent, ' '); }); // sent size value updated.select('text.remote-process-group-sent tspan.size') .text(function (d) { - return ' ' + common.substringAfterFirst(d.status.aggregateSnapshot.sent, ' '); + return ' ' + nfCommon.substringAfterFirst(d.status.aggregateSnapshot.sent, ' '); }); // sent ports value @@ -704,13 +704,13 @@ // received count value updated.select('text.remote-process-group-received tspan.count') .text(function (d) { - return common.substringBeforeFirst(d.status.aggregateSnapshot.received, ' '); + return nfCommon.substringBeforeFirst(d.status.aggregateSnapshot.received, ' '); }); // received size value updated.select('text.remote-process-group-received tspan.size') .text(function (d) { - return ' ' + common.substringAfterFirst(d.status.aggregateSnapshot.received, ' '); + return ' ' + nfCommon.substringAfterFirst(d.status.aggregateSnapshot.received, ' '); }); // -------------------- @@ -723,7 +723,7 @@ .text(function (d) { var icon = ''; if (d.permissions.canRead) { - if (!common.isEmpty(d.component.authorizationIssues)) { + if (!nfCommon.isEmpty(d.component.authorizationIssues)) { icon = '\uf071'; } else if (d.component.transmitting === true) { icon = '\uf140'; @@ -736,7 +736,7 @@ .attr('font-family', function (d) { var family = ''; if (d.permissions.canRead) { - if (!common.isEmpty(d.component.authorizationIssues) || d.component.transmitting) { + if (!nfCommon.isEmpty(d.component.authorizationIssues) || d.component.transmitting) { family = 'FontAwesome'; } else { family = 'flowfont'; @@ -745,20 +745,20 @@ return family; }) .classed('invalid', function (d) { - return d.permissions.canRead && !common.isEmpty(d.component.authorizationIssues); + return d.permissions.canRead && !nfCommon.isEmpty(d.component.authorizationIssues); }) .classed('transmitting', function (d) { - return d.permissions.canRead && common.isEmpty(d.component.authorizationIssues) && d.component.transmitting === true; + return d.permissions.canRead && nfCommon.isEmpty(d.component.authorizationIssues) && d.component.transmitting === true; }) .classed('not-transmitting', function (d) { - return d.permissions.canRead && common.isEmpty(d.component.authorizationIssues) && d.component.transmitting === false; + return d.permissions.canRead && nfCommon.isEmpty(d.component.authorizationIssues) && d.component.transmitting === false; }) .each(function (d) { // get the tip var tip = d3.select('#authorization-issues-' + d.id); // if there are validation errors generate a tooltip - if (d.permissions.canRead && !common.isEmpty(d.component.authorizationIssues)) { + if (d.permissions.canRead && !nfCommon.isEmpty(d.component.authorizationIssues)) { // create the tip if necessary if (tip.empty()) { tip = d3.select('#remote-process-group-tooltips').append('div') @@ -770,7 +770,7 @@ // update the tip tip.html(function () { - var list = common.formatUnorderedList(d.component.authorizationIssues); + var list = nfCommon.formatUnorderedList(d.component.authorizationIssues); if (list === null || list.length === 0) { return ''; } else { @@ -779,7 +779,7 @@ }); // add the tooltip - canvasUtils.canvasTooltip(tip, d3.select(this)); + nfCanvasUtils.canvasTooltip(tip, d3.select(this)); } else { if (!tip.empty()) { tip.remove(); @@ -795,7 +795,7 @@ // active thread count // ------------------- - canvasUtils.activeThreadCount(remoteProcessGroup, d, function (off) { + nfCanvasUtils.activeThreadCount(remoteProcessGroup, d, function (off) { offset = off; }); @@ -804,10 +804,10 @@ // --------- remoteProcessGroup.select('rect.bulletin-background').classed('has-bulletins', function () { - return !common.isEmpty(d.status.aggregateSnapshot.bulletins); + return !nfCommon.isEmpty(d.status.aggregateSnapshot.bulletins); }); - canvasUtils.bulletins(remoteProcessGroup, d, function () { + nfCanvasUtils.bulletins(remoteProcessGroup, d, function () { return d3.select('#remote-process-group-tooltips'); }, offset); }); @@ -843,12 +843,17 @@ var nfRemoteProcessGroup = { /** * Initializes of the Process Group handler. + * + * @param nfConnectableRef The nfConnectable module. + * @param nfDraggableRef The nfDraggable module. + * @param nfSelectableRef The nfSelectable module. + * @param nfContextMenuRef The nfContextMenu module. */ - init: function (connectable, draggable, selectable, contextMenu) { - nfConnectable = connectable; - nfDraggable = draggable; - nfSelectable = selectable; - nfContextMenu = contextMenu; + init: function (nfConnectableRef, nfDraggableRef, nfSelectableRef, nfContextMenuRef) { + nfConnectable = nfConnectableRef; + nfDraggable = nfDraggableRef; + nfSelectable = nfSelectableRef; + nfContextMenu = nfContextMenuRef; remoteProcessGroupMap = d3.map(); removedCache = d3.map(); @@ -870,8 +875,8 @@ */ add: function (remoteProcessGroupEntities, options) { var selectAll = false; - if (common.isDefinedAndNotNull(options)) { - selectAll = common.isDefinedAndNotNull(options.selectAll) ? options.selectAll : selectAll; + if (nfCommon.isDefinedAndNotNull(options)) { + selectAll = nfCommon.isDefinedAndNotNull(options.selectAll) ? options.selectAll : selectAll; } // get the current time @@ -892,7 +897,7 @@ $.each(remoteProcessGroupEntities, function (_, remoteProcessGroupEntity) { add(remoteProcessGroupEntity); }); - } else if (common.isDefinedAndNotNull(remoteProcessGroupEntities)) { + } else if (nfCommon.isDefinedAndNotNull(remoteProcessGroupEntities)) { add(remoteProcessGroupEntities); } @@ -911,16 +916,16 @@ set: function (remoteProcessGroupEntities, options) { var selectAll = false; var transition = false; - if (common.isDefinedAndNotNull(options)) { - selectAll = common.isDefinedAndNotNull(options.selectAll) ? options.selectAll : selectAll; - transition = common.isDefinedAndNotNull(options.transition) ? options.transition : transition; + if (nfCommon.isDefinedAndNotNull(options)) { + selectAll = nfCommon.isDefinedAndNotNull(options.selectAll) ? options.selectAll : selectAll; + transition = nfCommon.isDefinedAndNotNull(options.transition) ? options.transition : transition; } var set = function (proposedRemoteProcessGroupEntity) { var currentRemoteProcessGroupEntity = remoteProcessGroupMap.get(proposedRemoteProcessGroupEntity.id); // set the remote process group if appropriate due to revision and wasn't previously removed - if (client.isNewerRevision(currentRemoteProcessGroupEntity, proposedRemoteProcessGroupEntity) && !removedCache.has(proposedRemoteProcessGroupEntity.id)) { + if (nfClient.isNewerRevision(currentRemoteProcessGroupEntity, proposedRemoteProcessGroupEntity) && !removedCache.has(proposedRemoteProcessGroupEntity.id)) { remoteProcessGroupMap.set(proposedRemoteProcessGroupEntity.id, $.extend({ type: 'RemoteProcessGroup', dimensions: dimensions @@ -944,14 +949,14 @@ $.each(remoteProcessGroupEntities, function (_, remoteProcessGroupEntity) { set(remoteProcessGroupEntity); }); - } else if (common.isDefinedAndNotNull(remoteProcessGroupEntities)) { + } else if (nfCommon.isDefinedAndNotNull(remoteProcessGroupEntities)) { set(remoteProcessGroupEntities); } // apply the selection and handle all new remote process groups var selection = select(); selection.enter().call(renderRemoteProcessGroups, selectAll); - selection.call(updateRemoteProcessGroups).call(canvasUtils.position, transition); + selection.call(updateRemoteProcessGroups).call(nfCanvasUtils.position, transition); selection.exit().call(removeRemoteProcessGroups); }, @@ -962,7 +967,7 @@ * @param {string} id */ get: function (id) { - if (common.isUndefined(id)) { + if (nfCommon.isUndefined(id)) { return remoteProcessGroupMap.values(); } else { return remoteProcessGroupMap.get(id); @@ -976,7 +981,7 @@ * @param {string} id Optional */ refresh: function (id) { - if (common.isDefinedAndNotNull(id)) { + if (nfCommon.isDefinedAndNotNull(id)) { d3.select('#id-' + id).call(updateRemoteProcessGroups); } else { d3.selectAll('g.remote-process-group').call(updateRemoteProcessGroups); @@ -1007,10 +1012,10 @@ nfRemoteProcessGroup.set(response); // reload the group's connections - var connections = connection.getComponentConnections(id); + var connections = nfConnection.getComponentConnections(id); $.each(connections, function (_, connection) { if (connection.permissions.canRead) { - connection.reload(connection.id); + nfConnection.reload(connection.id); } }); }); @@ -1023,7 +1028,7 @@ * @param {string} id The id */ position: function (id) { - d3.select('#id-' + id).call(canvasUtils.position); + d3.select('#id-' + id).call(nfCanvasUtils.position); }, /** diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-reporting-task.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-reporting-task.js index 88f6fb4c9a..bb1b07c95f 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-reporting-task.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-reporting-task.js @@ -28,8 +28,8 @@ 'nf.ControllerServices', 'nf.UniversalCapture', 'nf.CustomUi'], - function ($, errorHandler, common, dialog, client, controllerService, controllerServices, universalCapture, customUi) { - return (nf.ReportingTask = factory($, errorHandler, common, dialog, client, controllerService, controllerServices, universalCapture, customUi)); + function ($, nfErrorHandler, nfCommon, nfDialog, nfClient, nfControllerService, nfControllerServices, nfUniversalCapture, nfCustomUi) { + return (nf.ReportingTask = factory($, nfErrorHandler, nfCommon, nfDialog, nfClient, nfControllerService, nfControllerServices, nfUniversalCapture, nfCustomUi)); }); } else if (typeof exports === 'object' && typeof module === 'object') { module.exports = (nf.ReportingTask = @@ -53,7 +53,7 @@ root.nf.UniversalCapture, root.nf.CustomUi); } -}(this, function ($, errorHandler, common, dialog, client, controllerService, controllerServices, universalCapture, customUi) { +}(this, function ($, nfErrorHandler, nfCommon, nfDialog, nfClient, nfControllerService, nfControllerServices, nfUniversalCapture, nfCustomUi) { 'use strict'; var nfSettings; @@ -93,15 +93,15 @@ if (errors.length === 1) { content = $('').text(errors[0]); } else { - content = common.formatUnorderedList(errors); + content = nfCommon.formatUnorderedList(errors); } - dialog.showOkDialog({ + nfDialog.showOkDialog({ dialogContent: content, headerText: 'Reporting Task' }); } else { - errorHandler.handleAjaxError(xhr, status, error); + nfErrorHandler.handleAjaxError(xhr, status, error); } }; @@ -141,7 +141,7 @@ } // check the scheduling period - if (common.isDefinedAndNotNull(schedulingPeriod) && schedulingPeriod.val() !== (entity.component['schedulingPeriod'] + '')) { + if (nfCommon.isDefinedAndNotNull(schedulingPeriod) && schedulingPeriod.val() !== (entity.component['schedulingPeriod'] + '')) { return true; } @@ -204,13 +204,13 @@ var errors = []; var reportingTask = details['component']; - if (common.isBlank(reportingTask['schedulingPeriod'])) { + if (nfCommon.isBlank(reportingTask['schedulingPeriod'])) { errors.push('Run schedule must be specified'); } if (errors.length > 0) { - dialog.showOkDialog({ - dialogContent: common.formatUnorderedList(errors), + nfDialog.showOkDialog({ + dialogContent: nfCommon.formatUnorderedList(errors), headerText: 'Reporting Task' }); return false; @@ -241,7 +241,7 @@ */ var setRunning = function (reportingTaskEntity, running) { var entity = { - 'revision': client.getRevision(reportingTaskEntity), + 'revision': nfClient.getRevision(reportingTaskEntity), 'component': { 'id': reportingTaskEntity.id, 'state': running === true ? 'RUNNING' : 'STOPPED' @@ -257,8 +257,8 @@ }).done(function (response) { // update the task renderReportingTask(response); - controllerService.reloadReferencedServices(getControllerServicesTable(), response.component); - }).fail(errorHandler.handleAjaxError); + nfControllerService.reloadReferencedServices(getControllerServicesTable(), response.component); + }).fail(nfErrorHandler.handleAjaxError); }; /** @@ -272,7 +272,7 @@ // determine if changes have been made if (isSaveRequired()) { // see if those changes should be saved - dialog.showYesNoDialog({ + nfDialog.showYesNoDialog({ headerText: 'Save', dialogContent: 'Save changes before going to this Controller Service?', noHandler: function () { @@ -304,7 +304,7 @@ // ensure details are valid as far as we can tell if (validateDetails(updatedReportingTask)) { - updatedReportingTask['revision'] = client.getRevision(reportingTaskEntity); + updatedReportingTask['revision'] = nfClient.getRevision(reportingTaskEntity); // update the selected component return $.ajax({ @@ -338,15 +338,17 @@ propertyName: propertyName }, dataType: 'json' - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); }; var nfReportingTask = { /** * Initializes the reporting task configuration dialog. + * + * @param nfSettingsRef The nfSettings module. */ - init: function (settings) { - nfSettings = settings; + init: function (nfSettingsRef) { + nfSettings = nfSettingsRef; // initialize the configuration dialog tabs $('#reporting-task-configuration-tabs').tabbs({ @@ -365,7 +367,7 @@ }], select: function () { // remove all property detail dialogs - universalCapture.removeAllPropertyDetailDialogs(); + nfUniversalCapture.removeAllPropertyDetailDialogs(); // update the property table size in case this is the first time its rendered if ($(this).text() === 'Properties') { @@ -390,13 +392,13 @@ $('#reporting-task-properties').propertytable('clear'); // clear the comments - common.clearField('read-only-reporting-task-comments'); + nfCommon.clearField('read-only-reporting-task-comments'); // removed the cached reporting task details $('#reporting-task-configuration').removeData('reportingTaskDetails'); }, open: function () { - common.toggleScrollable($('#' + this.find('.tab-container').attr('id') + '-content').get(0)); + nfCommon.toggleScrollable($('#' + this.find('.tab-container').attr('id') + '-content').get(0)); } } }); @@ -408,7 +410,7 @@ dialogContainer: '#new-reporting-task-property-container', descriptorDeferred: getReportingTaskPropertyDescriptor, controllerServiceCreatedDeferred: function (response) { - return controllerServices.loadControllerServices(controllerServicesUri, $('#controller-services-table')); + return nfControllerServices.loadControllerServices(controllerServicesUri, $('#controller-services-table')); }, goToServiceDeferred: goToServiceFromProperty }); @@ -433,7 +435,7 @@ dialogContainer: '#new-reporting-task-property-container', descriptorDeferred: getReportingTaskPropertyDescriptor, controllerServiceCreatedDeferred: function (response) { - return controllerServices.loadControllerServices(controllerServicesUri, $('#controller-services-table')); + return nfControllerServices.loadControllerServices(controllerServicesUri, $('#controller-services-table')); }, goToServiceDeferred: goToServiceFromProperty }); @@ -475,8 +477,8 @@ } // populate the reporting task settings - common.populateField('reporting-task-id', reportingTask['id']); - common.populateField('reporting-task-type', common.substringAfterLast(reportingTask['type'], '.')); + nfCommon.populateField('reporting-task-id', reportingTask['id']); + nfCommon.populateField('reporting-task-type', nfCommon.substringAfterLast(reportingTask['type'], '.')); $('#reporting-task-name').val(reportingTask['name']); $('#reporting-task-enabled').removeClass('checkbox-unchecked checkbox-checked').addClass(reportingTaskEnableStyle); $('#reporting-task-comments').val(reportingTask['comments']); @@ -533,7 +535,7 @@ // save the reporting task saveReportingTask(reportingTaskEntity).done(function (response) { // reload the reporting task - controllerService.reloadReferencedServices(getControllerServicesTable(), response.component); + nfControllerService.reloadReferencedServices(getControllerServicesTable(), response.component); // close the details panel $('#reporting-task-configuration').modal('hide'); @@ -556,7 +558,7 @@ }]; // determine if we should show the advanced button - if (common.isDefinedAndNotNull(reportingTask.customUiUrl) && reportingTask.customUiUrl !== '') { + if (nfCommon.isDefinedAndNotNull(reportingTask.customUiUrl) && reportingTask.customUiUrl !== '') { buttons.push({ buttonText: 'Advanced', clazz: 'fa fa-cog button-icon', @@ -575,10 +577,10 @@ $('#shell-close-button').click(); // show the custom ui - customUi.showCustomUi(reportingTaskEntity, reportingTask.customUiUrl, true).done(function () { + nfCustomUi.showCustomUi(reportingTaskEntity, reportingTask.customUiUrl, true).done(function () { // once the custom ui is closed, reload the reporting task nfReportingTask.reload(reportingTaskEntity.id).done(function (response) { - controllerService.reloadReferencedServices(getControllerServicesTable(), response.reportingTask); + nfControllerService.reloadReferencedServices(getControllerServicesTable(), response.reportingTask); }); // show the settings @@ -592,7 +594,7 @@ // determine if changes have been made if (isSaveRequired()) { // see if those changes should be saved - dialog.showYesNoDialog({ + nfDialog.showYesNoDialog({ headerText: 'Save', dialogContent: 'Save changes before opening the advanced configuration?', noHandler: openCustomUi, @@ -624,7 +626,7 @@ $('#reporting-task-configuration').modal('show'); $('#reporting-task-properties').propertytable('resetTableSize'); - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); }, /** @@ -673,10 +675,10 @@ var reportingTaskHistory = historyResponse[0].componentHistory; // populate the reporting task settings - common.populateField('reporting-task-id', reportingTask['id']); - common.populateField('reporting-task-type', common.substringAfterLast(reportingTask['type'], '.')); - common.populateField('read-only-reporting-task-name', reportingTask['name']); - common.populateField('read-only-reporting-task-comments', reportingTask['comments']); + nfCommon.populateField('reporting-task-id', reportingTask['id']); + nfCommon.populateField('reporting-task-type', nfCommon.substringAfterLast(reportingTask['type'], '.')); + nfCommon.populateField('read-only-reporting-task-name', reportingTask['name']); + nfCommon.populateField('read-only-reporting-task-comments', reportingTask['comments']); // make the scheduling strategy human readable var schedulingStrategy = reportingTask['schedulingStrategy']; @@ -685,8 +687,8 @@ } else { schedulingStrategy = "Timer driven"; } - common.populateField('read-only-reporting-task-scheduling-strategy', schedulingStrategy); - common.populateField('read-only-reporting-task-scheduling-period', reportingTask['schedulingPeriod']); + nfCommon.populateField('read-only-reporting-task-scheduling-strategy', schedulingStrategy); + nfCommon.populateField('read-only-reporting-task-scheduling-period', reportingTask['schedulingPeriod']); var buttons = [{ buttonText: 'Ok', @@ -704,7 +706,7 @@ }]; // determine if we should show the advanced button - if (common.isDefinedAndNotNull(customUi) && common.isDefinedAndNotNull(reportingTask.customUiUrl) && reportingTask.customUiUrl !== '') { + if (nfCommon.isDefinedAndNotNull(nfCustomUi) && nfCommon.isDefinedAndNotNull(reportingTask.customUiUrl) && reportingTask.customUiUrl !== '') { buttons.push({ buttonText: 'Advanced', clazz: 'fa fa-cog button-icon', @@ -722,7 +724,7 @@ $('#shell-close-button').click(); // show the custom ui - customUi.showCustomUi(reportingTaskEntity, reportingTask.customUiUrl, false).done(function () { + nfCustomUi.showCustomUi(reportingTaskEntity, reportingTask.customUiUrl, false).done(function () { nfSettings.showSettings(); }); } @@ -777,7 +779,7 @@ dataType: 'json' }).done(function (response) { renderReportingTask(response); - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); }, /** @@ -787,9 +789,9 @@ */ promptToDeleteReportingTask: function (reportingTaskEntity) { // prompt for deletion - dialog.showYesNoDialog({ + nfDialog.showYesNoDialog({ headerText: 'Delete Reporting Task', - dialogContent: 'Delete reporting task \'' + common.escapeHtml(reportingTaskEntity.component.name) + '\'?', + dialogContent: 'Delete reporting task \'' + nfCommon.escapeHtml(reportingTaskEntity.component.name) + '\'?', yesHandler: function () { nfReportingTask.remove(reportingTaskEntity); } @@ -804,7 +806,7 @@ remove: function (reportingTaskEntity) { // prompt for removal? - var revision = client.getRevision(reportingTaskEntity); + var revision = nfClient.getRevision(reportingTaskEntity); $.ajax({ type: 'DELETE', url: reportingTaskEntity.uri + '?' + $.param({ @@ -817,7 +819,7 @@ var reportingTaskGrid = $('#reporting-tasks-table').data('gridInstance'); var reportingTaskData = reportingTaskGrid.getData(); reportingTaskData.deleteItem(reportingTaskEntity.id); - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); } }; diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-selectable.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-selectable.js index d418b01f14..c8b51792b3 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-selectable.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-selectable.js @@ -22,8 +22,8 @@ define(['d3', 'nf.ng.Bridge', 'nf.ContextMenu'], - function (d3, angularBridge, contextMenu) { - return (nf.Selectable = factory(d3, angularBridge, contextMenu)); + function (d3, nfNgBridge, nfContextMenu) { + return (nf.Selectable = factory(d3, nfNgBridge, nfContextMenu)); }); } else if (typeof exports === 'object' && typeof module === 'object') { module.exports = (nf.Selectable = @@ -35,14 +35,14 @@ root.nf.ng.Bridge, root.nf.ContextMenu); } -}(this, function (d3, angularBridge, contextMenu) { +}(this, function (d3, nfNgBridge, nfContextMenu) { 'use strict'; var nfSelectable = { select: function (g) { // hide any context menus as necessary - contextMenu.hide(); + nfContextMenu.hide(); // only need to update selection if necessary if (!g.classed('selected')) { @@ -62,7 +62,7 @@ // inform Angular app that values have changed since the // enabled operate palette buttons are based off of the selection - angularBridge.digest(); + nfNgBridge.digest(); // stop propagation d3.event.stopPropagation(); diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-settings.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-settings.js index d2566e1b0f..e214ca8e3f 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-settings.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-settings.js @@ -32,8 +32,8 @@ 'nf.Shell', 'nf.ComponentState', 'nf.PolicyManagement'], - function ($, Slick, d3, client, dialog, common, canvasUtils, controllerServices, errorHandler, reportingTask, shell, componentState, policyManagement) { - return (nf.Settings = factory($, Slick, d3, client, dialog, common, canvasUtils, controllerServices, errorHandler, reportingTask, shell, componentState, policyManagement)); + function ($, Slick, d3, nfClient, nfDialog, nfCommon, nfCanvasUtils, nfControllerServices, nfErrorHandler, nfReportingTask, nfShell, nfComponentState, nfPolicyManagement) { + return (nf.Settings = factory($, Slick, d3, nfClient, nfDialog, nfCommon, nfCanvasUtils, nfControllerServices, nfErrorHandler, nfReportingTask, nfShell, nfComponentState, nfPolicyManagement)); }); } else if (typeof exports === 'object' && typeof module === 'object') { module.exports = (nf.Settings = @@ -65,7 +65,7 @@ root.nf.ComponentState, root.nf.PolicyManagement); } -}(this, function ($, Slick, d3, client, dialog, common, canvasUtils, controllerServices, errorHandler, reportingTask, shell, componentState, policyManagement) { +}(this, function ($, Slick, d3, nfClient, nfDialog, nfCommon, nfCanvasUtils, nfControllerServices, nfErrorHandler, nfReportingTask, nfShell, nfComponentState, nfPolicyManagement) { 'use strict'; @@ -107,7 +107,7 @@ // marshal the configuration details var configuration = marshalConfiguration(); var entity = { - 'revision': client.getRevision({ + 'revision': nfClient.getRevision({ 'revision': { 'version': version } @@ -124,7 +124,7 @@ contentType: 'application/json' }).done(function (response) { // close the settings dialog - dialog.showOkDialog({ + nfDialog.showOkDialog({ headerText: 'Settings', dialogContent: 'Settings successfully applied.' }); @@ -133,7 +133,7 @@ $('#settings-save').off('click').on('click', function () { saveSettings(response.revision.version); }); - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); } /** @@ -211,7 +211,7 @@ * @param item reporting task type */ var isSelectable = function (item) { - return common.isBlank(item.usageRestriction) || common.canAccessRestrictedComponents(); + return nfCommon.isBlank(item.usageRestriction) || nfCommon.canAccessRestrictedComponents(); }; /** @@ -247,7 +247,7 @@ return ''; } - return common.substringAfterLast(dataContext.component.type, '.'); + return nfCommon.substringAfterLast(dataContext.component.type, '.'); }; /** @@ -262,31 +262,31 @@ if (a.permissions.canRead && b.permissions.canRead) { if (sortDetails.columnId === 'moreDetails') { var aBulletins = 0; - if (!common.isEmpty(a.bulletins)) { + if (!nfCommon.isEmpty(a.bulletins)) { aBulletins = a.bulletins.length; } var bBulletins = 0; - if (!common.isEmpty(b.bulletins)) { + if (!nfCommon.isEmpty(b.bulletins)) { bBulletins = b.bulletins.length; } return aBulletins - bBulletins; } else if (sortDetails.columnId === 'type') { - var aType = common.isDefinedAndNotNull(a.component[sortDetails.columnId]) ? common.substringAfterLast(a.component[sortDetails.columnId], '.') : ''; - var bType = common.isDefinedAndNotNull(b.component[sortDetails.columnId]) ? common.substringAfterLast(b.component[sortDetails.columnId], '.') : ''; + var aType = nfCommon.isDefinedAndNotNull(a.component[sortDetails.columnId]) ? nfCommon.substringAfterLast(a.component[sortDetails.columnId], '.') : ''; + var bType = nfCommon.isDefinedAndNotNull(b.component[sortDetails.columnId]) ? nfCommon.substringAfterLast(b.component[sortDetails.columnId], '.') : ''; return aType === bType ? 0 : aType > bType ? 1 : -1; } else if (sortDetails.columnId === 'state') { var aState = 'Invalid'; - if (common.isEmpty(a.component.validationErrors)) { - aState = common.isDefinedAndNotNull(a.component[sortDetails.columnId]) ? a.component[sortDetails.columnId] : ''; + if (nfCommon.isEmpty(a.component.validationErrors)) { + aState = nfCommon.isDefinedAndNotNull(a.component[sortDetails.columnId]) ? a.component[sortDetails.columnId] : ''; } var bState = 'Invalid'; - if (common.isEmpty(b.component.validationErrors)) { - bState = common.isDefinedAndNotNull(b.component[sortDetails.columnId]) ? b.component[sortDetails.columnId] : ''; + if (nfCommon.isEmpty(b.component.validationErrors)) { + bState = nfCommon.isDefinedAndNotNull(b.component[sortDetails.columnId]) ? b.component[sortDetails.columnId] : ''; } return aState === bState ? 0 : aState > bState ? 1 : -1; } else { - var aString = common.isDefinedAndNotNull(a.component[sortDetails.columnId]) ? a.component[sortDetails.columnId] : ''; - var bString = common.isDefinedAndNotNull(b.component[sortDetails.columnId]) ? b.component[sortDetails.columnId] : ''; + var aString = nfCommon.isDefinedAndNotNull(a.component[sortDetails.columnId]) ? a.component[sortDetails.columnId] : ''; + var bString = nfCommon.isDefinedAndNotNull(b.component[sortDetails.columnId]) ? b.component[sortDetails.columnId] : ''; return aString === bString ? 0 : aString > bString ? 1 : -1; } } else { @@ -322,7 +322,7 @@ var reportingTaskTypesGrid = $('#reporting-task-types-table').data('gridInstance'); // ensure the grid has been initialized - if (common.isDefinedAndNotNull(reportingTaskTypesGrid)) { + if (nfCommon.isDefinedAndNotNull(reportingTaskTypesGrid)) { var reportingTaskTypesData = reportingTaskTypesGrid.getData(); // update the search criteria @@ -404,7 +404,7 @@ // ensure something was selected if (selectedTaskType === '') { - dialog.showOkDialog({ + nfDialog.showOkDialog({ headerText: 'Settings', dialogContent: 'The type of reporting task to create must be selected.' }); @@ -421,7 +421,7 @@ var addReportingTask = function (reportingTaskType) { // build the reporting task entity var reportingTaskEntity = { - 'revision': client.getRevision({ + 'revision': nfClient.getRevision({ 'revision': { 'version': 0 } @@ -452,7 +452,7 @@ var row = reportingTaskData.getRowById(reportingTaskEntity.id); reportingTaskGrid.setSelectedRows([row]); reportingTaskGrid.scrollRowIntoView(row); - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); // hide the dialog $('#new-reporting-task-dialog').modal('hide'); @@ -490,7 +490,7 @@ id: 'type', name: 'Type', field: 'label', - formatter: common.typeFormatter, + formatter: nfCommon.typeFormatter, sortable: false, resizable: true }, @@ -524,11 +524,11 @@ var reportingTaskType = reportingTaskTypesGrid.getDataItem(reportingTaskTypeIndex); // set the reporting task type description - if (common.isDefinedAndNotNull(reportingTaskType)) { + if (nfCommon.isDefinedAndNotNull(reportingTaskType)) { // show the selected reporting task $('#reporting-task-description-container').show(); - if (common.isBlank(reportingTaskType.description)) { + if (nfCommon.isBlank(reportingTaskType.description)) { $('#reporting-task-type-description') .attr('title', '') .html('No description specified'); @@ -557,7 +557,7 @@ } }); reportingTaskTypesGrid.onViewportChanged.subscribe(function (e, args) { - common.cleanUpTooltips($('#reporting-task-types-table'), 'div.view-usage-restriction'); + nfCommon.cleanUpTooltips($('#reporting-task-types-table'), 'div.view-usage-restriction'); }); // wire up the dataview to the grid @@ -584,8 +584,8 @@ var item = reportingTaskTypesData.getItemById(rowId); // show the tooltip - if (common.isDefinedAndNotNull(item.usageRestriction)) { - usageRestriction.qtip($.extend({}, common.config.tooltipConfig, { + if (nfCommon.isDefinedAndNotNull(item.usageRestriction)) { + usageRestriction.qtip($.extend({}, nfCommon.config.tooltipConfig, { content: item.usageRestriction, position: { container: $('#summary'), @@ -618,10 +618,10 @@ // add the documented type reportingTaskTypesData.addItem({ id: id++, - label: common.substringAfterLast(documentedType.type, '.'), + label: nfCommon.substringAfterLast(documentedType.type, '.'), type: documentedType.type, - description: common.escapeHtml(documentedType.description), - usageRestriction: common.escapeHtml(documentedType.usageRestriction), + description: nfCommon.escapeHtml(documentedType.description), + usageRestriction: nfCommon.escapeHtml(documentedType.usageRestriction), tags: documentedType.tags.join(', ') }); @@ -643,7 +643,7 @@ select: applyReportingTaskTypeFilter, remove: applyReportingTaskTypeFilter }); - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); // initialize the reporting task dialog $('#new-reporting-task-dialog').modal({ @@ -732,8 +732,8 @@ // always include a button to view the usage markup += '
'; - var hasErrors = !common.isEmpty(dataContext.component.validationErrors); - var hasBulletins = !common.isEmpty(dataContext.bulletins); + var hasErrors = !nfCommon.isEmpty(dataContext.component.validationErrors); + var hasBulletins = !nfCommon.isEmpty(dataContext.bulletins); if (hasErrors) { markup += '
'; @@ -744,7 +744,7 @@ } if (hasErrors || hasBulletins) { - markup += ''; + markup += ''; } return markup; @@ -757,7 +757,7 @@ // determine the appropriate label var icon = '', label = ''; - if (!common.isEmpty(dataContext.component.validationErrors)) { + if (!nfCommon.isEmpty(dataContext.component.validationErrors)) { label = 'Invalid'; icon = 'invalid fa fa-warning'; } else { @@ -775,13 +775,13 @@ // include the active thread count if appropriate var activeThreadCount = ''; - if (common.isDefinedAndNotNull(dataContext.component.activeThreadCount) && dataContext.component.activeThreadCount > 0) { + if (nfCommon.isDefinedAndNotNull(dataContext.component.activeThreadCount) && dataContext.component.activeThreadCount > 0) { activeThreadCount = '(' + dataContext.component.activeThreadCount + ')'; } // format the markup var formattedValue = '
'; - return formattedValue + '
' + common.escapeHtml(label) + '
' + common.escapeHtml(activeThreadCount) + '
'; + return formattedValue + '
' + nfCommon.escapeHtml(label) + '
' + nfCommon.escapeHtml(activeThreadCount) + '
'; }; var reportingTaskActionFormatter = function (row, cell, value, columnDef, dataContext) { @@ -794,7 +794,7 @@ markup += '
'; // support starting when stopped and no validation errors - if (dataContext.component.state === 'STOPPED' && common.isEmpty(dataContext.component.validationErrors)) { + if (dataContext.component.state === 'STOPPED' && nfCommon.isEmpty(dataContext.component.validationErrors)) { markup += '
'; } } @@ -804,12 +804,12 @@ } } - if (dataContext.permissions.canWrite && common.canModifyController()) { + if (dataContext.permissions.canWrite && nfCommon.canModifyController()) { markup += '
'; } // allow policy configuration conditionally - if (canvasUtils.isConfigurableAuthorizer() && common.canAccessTenants()) { + if (nfCanvasUtils.isConfigurableAuthorizer() && nfCommon.canAccessTenants()) { markup += '
'; } @@ -884,33 +884,33 @@ // determine the desired action if (reportingTasksGrid.getColumns()[args.cell].id === 'actions') { if (target.hasClass('edit-reporting-task')) { - reportingTask.showConfiguration(reportingTaskEntity); + nfReportingTask.showConfiguration(reportingTaskEntity); } else if (target.hasClass('start-reporting-task')) { - reportingTask.start(reportingTaskEntity); + nfReportingTask.start(reportingTaskEntity); } else if (target.hasClass('stop-reporting-task')) { - reportingTask.stop(reportingTaskEntity); + nfReportingTask.stop(reportingTaskEntity); } else if (target.hasClass('delete-reporting-task')) { - reportingTask.promptToDeleteReportingTask(reportingTaskEntity); + nfReportingTask.promptToDeleteReportingTask(reportingTaskEntity); } else if (target.hasClass('view-state-reporting-task')) { var canClear = reportingTaskEntity.component.state === 'STOPPED' && reportingTaskEntity.component.activeThreadCount === 0; - componentState.showState(reportingTaskEntity, canClear); + nfComponentState.showState(reportingTaskEntity, canClear); } else if (target.hasClass('edit-access-policies')) { // show the policies for this service - policyManagement.showReportingTaskPolicy(reportingTaskEntity); + nfPolicyManagement.showReportingTaskPolicy(reportingTaskEntity); // close the settings dialog $('#shell-close-button').click(); } } else if (reportingTasksGrid.getColumns()[args.cell].id === 'moreDetails') { if (target.hasClass('view-reporting-task')) { - reportingTask.showDetails(reportingTaskEntity); + nfReportingTask.showDetails(reportingTaskEntity); } else if (target.hasClass('reporting-task-usage')) { // close the settings dialog $('#shell-close-button').click(); // open the documentation for this reporting task - shell.showPage('../nifi-docs/documentation?' + $.param({ - select: common.substringAfterLast(reportingTaskEntity.component.type, '.') + nfShell.showPage('../nifi-docs/documentation?' + $.param({ + select: nfCommon.substringAfterLast(reportingTaskEntity.component.type, '.') })).done(function () { nfSettings.showSettings(); }); @@ -939,12 +939,12 @@ var reportingTaskEntity = reportingTasksData.getItemById(taskId); // format the errors - var tooltip = common.formatUnorderedList(reportingTaskEntity.component.validationErrors); + var tooltip = nfCommon.formatUnorderedList(reportingTaskEntity.component.validationErrors); // show the tooltip - if (common.isDefinedAndNotNull(tooltip)) { + if (nfCommon.isDefinedAndNotNull(tooltip)) { errorIcon.qtip($.extend({}, - common.config.tooltipConfig, + nfCommon.config.tooltipConfig, { content: tooltip, position: { @@ -968,13 +968,13 @@ var reportingTaskEntity = reportingTasksData.getItemById(taskId); // format the tooltip - var bulletins = common.getFormattedBulletins(reportingTaskEntity.bulletins); - var tooltip = common.formatUnorderedList(bulletins); + var bulletins = nfCommon.getFormattedBulletins(reportingTaskEntity.bulletins); + var tooltip = nfCommon.formatUnorderedList(bulletins); // show the tooltip - if (common.isDefinedAndNotNull(tooltip)) { + if (nfCommon.isDefinedAndNotNull(tooltip)) { bulletinIcon.qtip($.extend({}, - common.config.tooltipConfig, + nfCommon.config.tooltipConfig, { content: tooltip, position: { @@ -1055,7 +1055,7 @@ // load the controller services var controllerServicesUri = config.urls.api + '/flow/controller/controller-services'; - var controllerServicesXhr = controllerServices.loadControllerServices(controllerServicesUri, getControllerServicesTable()); + var controllerServicesXhr = nfControllerServices.loadControllerServices(controllerServicesUri, getControllerServicesTable()); // load the reporting tasks var reportingTasks = loadReportingTasks(); @@ -1066,7 +1066,7 @@ // update the current time $('#settings-last-refreshed').text(controllerServicesResponse.currentTime); - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); }; /** @@ -1086,8 +1086,8 @@ }); var reportingTasksElement = $('#reporting-tasks-table'); - common.cleanUpTooltips(reportingTasksElement, 'div.has-errors'); - common.cleanUpTooltips(reportingTasksElement, 'div.has-bulletins'); + nfCommon.cleanUpTooltips(reportingTasksElement, 'div.has-errors'); + nfCommon.cleanUpTooltips(reportingTasksElement, 'div.has-bulletins'); var reportingTasksGrid = reportingTasksElement.data('gridInstance'); var reportingTasksData = reportingTasksGrid.getData(); @@ -1104,7 +1104,7 @@ */ var showSettings = function () { // show the settings dialog - shell.showContent('#settings').done(function () { + nfShell.showContent('#settings').done(function () { reset(); }); @@ -1150,9 +1150,9 @@ $('#settings-save').show(); } else { var canModifyController = false; - if (common.isDefinedAndNotNull(common.currentUser)) { + if (nfCommon.isDefinedAndNotNull(nfCommon.currentUser)) { // only consider write permissions for creating new controller services/reporting tasks - canModifyController = common.currentUser.controllerPermissions.canWrite === true; + canModifyController = nfCommon.currentUser.controllerPermissions.canWrite === true; } if (canModifyController) { @@ -1190,13 +1190,13 @@ var selectedTab = $('#settings-tabs li.selected-tab').text(); if (selectedTab === 'Controller Services') { var controllerServicesUri = config.urls.api + '/controller/controller-services'; - controllerServices.promptNewControllerService(controllerServicesUri, getControllerServicesTable()); + nfControllerServices.promptNewControllerService(controllerServicesUri, getControllerServicesTable()); } else if (selectedTab === 'Reporting Tasks') { $('#new-reporting-task-dialog').modal('show'); // reset the canvas size after the dialog is shown var reportingTaskTypesGrid = $('#reporting-task-types-table').data('gridInstance'); - if (common.isDefinedAndNotNull(reportingTaskTypesGrid)) { + if (nfCommon.isDefinedAndNotNull(reportingTaskTypesGrid)) { reportingTaskTypesGrid.setSelectedRows([0]); reportingTaskTypesGrid.resizeCanvas(); } @@ -1208,7 +1208,7 @@ // initialize each tab initGeneral(); - controllerServices.init(getControllerServicesTable(), nfSettings.showSettings); + nfControllerServices.init(getControllerServicesTable(), nfSettings.showSettings); initReportingTasks(); }, @@ -1216,10 +1216,10 @@ * Update the size of the grid based on its container's current size. */ resetTableSize: function () { - controllerServices.resetTableSize(getControllerServicesTable()); + nfControllerServices.resetTableSize(getControllerServicesTable()); var reportingTasksGrid = $('#reporting-tasks-table').data('gridInstance'); - if (common.isDefinedAndNotNull(reportingTasksGrid)) { + if (nfCommon.isDefinedAndNotNull(reportingTasksGrid)) { reportingTasksGrid.resizeCanvas(); } }, @@ -1264,7 +1264,7 @@ */ setBulletins: function (controllerServiceBulletins, reportingTaskBulletins) { if ($('#controller-services-table').data('gridInstance')) { - controllerServices.setBulletins(getControllerServicesTable(), controllerServiceBulletins); + nfControllerServices.setBulletins(getControllerServicesTable(), controllerServiceBulletins); } // reporting tasks @@ -1273,7 +1273,7 @@ reportingTasksData.beginUpdate(); // if there are some bulletins process them - if (!common.isEmpty(reportingTaskBulletins)) { + if (!nfCommon.isEmpty(reportingTaskBulletins)) { var reportingTaskBulletinsBySource = d3.nest() .key(function (d) { return d.sourceId; @@ -1282,7 +1282,7 @@ reportingTaskBulletinsBySource.forEach(function (sourceId, sourceBulletins) { var reportingTask = reportingTasksData.getItemById(sourceId); - if (common.isDefinedAndNotNull(reportingTask)) { + if (nfCommon.isDefinedAndNotNull(reportingTask)) { reportingTasksData.updateItem(sourceId, $.extend(reportingTask, { bulletins: sourceBulletins })); diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-snippet.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-snippet.js index f8c6f83e6d..159c2d3d0a 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-snippet.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-snippet.js @@ -23,8 +23,8 @@ 'd3', 'nf.CanvasUtils', 'nf.Client'], - function ($, d3, canvasUtils, client) { - return (nf.Snippet = factory($, d3, canvasUtils, client)); + function ($, d3, nfCanvasUtils, nfClient) { + return (nf.Snippet = factory($, d3, nfCanvasUtils, nfClient)); }); } else if (typeof exports === 'object' && typeof module === 'object') { module.exports = (nf.Snippet = @@ -38,7 +38,7 @@ root.nf.CanvasUtils, root.nf.Client); } -}(this, function ($, d3, canvasUtils, client) { +}(this, function ($, d3, nfCanvasUtils, nfClient) { 'use strict'; var config = { @@ -57,7 +57,7 @@ */ marshal: function (selection) { var snippet = { - parentGroupId: canvasUtils.getGroupId(), + parentGroupId: nfCanvasUtils.getGroupId(), processors: {}, funnels: {}, inputPorts: {}, @@ -72,22 +72,22 @@ selection.each(function (d) { var selected = d3.select(this); - if (canvasUtils.isProcessor(selected)) { - snippet.processors[d.id] = client.getRevision(selected.datum()); - } else if (canvasUtils.isFunnel(selected)) { - snippet.funnels[d.id] = client.getRevision(selected.datum()); - } else if (canvasUtils.isLabel(selected)) { - snippet.labels[d.id] = client.getRevision(selected.datum()); - } else if (canvasUtils.isInputPort(selected)) { - snippet.inputPorts[d.id] = client.getRevision(selected.datum()); - } else if (canvasUtils.isOutputPort(selected)) { - snippet.outputPorts[d.id] = client.getRevision(selected.datum()); - } else if (canvasUtils.isProcessGroup(selected)) { - snippet.processGroups[d.id] = client.getRevision(selected.datum()); - } else if (canvasUtils.isRemoteProcessGroup(selected)) { - snippet.remoteProcessGroups[d.id] = client.getRevision(selected.datum()); - } else if (canvasUtils.isConnection(selected)) { - snippet.connections[d.id] = client.getRevision(selected.datum()); + if (nfCanvasUtils.isProcessor(selected)) { + snippet.processors[d.id] = nfClient.getRevision(selected.datum()); + } else if (nfCanvasUtils.isFunnel(selected)) { + snippet.funnels[d.id] = nfClient.getRevision(selected.datum()); + } else if (nfCanvasUtils.isLabel(selected)) { + snippet.labels[d.id] = nfClient.getRevision(selected.datum()); + } else if (nfCanvasUtils.isInputPort(selected)) { + snippet.inputPorts[d.id] = nfClient.getRevision(selected.datum()); + } else if (nfCanvasUtils.isOutputPort(selected)) { + snippet.outputPorts[d.id] = nfClient.getRevision(selected.datum()); + } else if (nfCanvasUtils.isProcessGroup(selected)) { + snippet.processGroups[d.id] = nfClient.getRevision(selected.datum()); + } else if (nfCanvasUtils.isRemoteProcessGroup(selected)) { + snippet.remoteProcessGroups[d.id] = nfClient.getRevision(selected.datum()); + } else if (nfCanvasUtils.isConnection(selected)) { + snippet.connections[d.id] = nfClient.getRevision(selected.datum()); } }); @@ -128,7 +128,7 @@ return $.ajax({ type: 'POST', - url: config.urls.processGroups + '/' + encodeURIComponent(canvasUtils.getGroupId()) + '/snippet-instance', + url: config.urls.processGroups + '/' + encodeURIComponent(nfCanvasUtils.getGroupId()) + '/snippet-instance', data: JSON.stringify(copySnippetRequestEntity), dataType: 'json', contentType: 'application/json' diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/cluster/nf-cluster-table.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/cluster/nf-cluster-table.js index 6bb0d4a74a..c29f387391 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/cluster/nf-cluster-table.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/cluster/nf-cluster-table.js @@ -24,8 +24,8 @@ 'nf.Common', 'nf.Dialog', 'nf.ErrorHandler'], - function ($, Slick, common, dialog, errorHandler) { - return (nf.ClusterTable = factory($, Slick, common, dialog, errorHandler)); + function ($, Slick, nfCommon, nfDialog, nfErrorHandler) { + return (nf.ClusterTable = factory($, Slick, nfCommon, nfDialog, nfErrorHandler)); }); } else if (typeof exports === 'object' && typeof module === 'object') { module.exports = (nf.ClusterTable = @@ -41,7 +41,7 @@ root.nf.Dialog, root.nf.ErrorHandler); } -}(this, function ($, Slick, common, dialog, errorHandler) { +}(this, function ($, Slick, nfCommon, nfDialog, nfErrorHandler) { 'use strict'; /** @@ -58,11 +58,11 @@ data: [{ name: 'cluster', update: refreshClusterData, - isAuthorized: common.canAccessController + isAuthorized: nfCommon.canAccessController }, { name: 'systemDiagnostics', update: refreshSystemDiagnosticsData, - isAuthorized: common.canAccessSystem + isAuthorized: nfCommon.canAccessSystem } ] }; @@ -452,7 +452,7 @@ // function for formatting the last accessed time var valueFormatter = function (row, cell, value, columnDef, dataContext) { - return common.formatValue(value); + return nfCommon.formatValue(value); }; // define a custom formatter for the status column @@ -523,7 +523,7 @@ ]; // only allow the admin to modify the cluster - if (common.canModifyController()) { + if (nfCommon.canModifyController()) { var actionFormatter = function (row, cell, value, columnDef, dataContext) { var canDisconnect = false; var canConnect = false; @@ -571,8 +571,8 @@ // defines a function for sorting var comparer = function (a, b) { if (sortDetails.columnId === 'heartbeat' || sortDetails.columnId === 'uptime') { - var aDate = common.parseDateTime(a[sortDetails.columnId]); - var bDate = common.parseDateTime(b[sortDetails.columnId]); + var aDate = nfCommon.parseDateTime(a[sortDetails.columnId]); + var bDate = nfCommon.parseDateTime(b[sortDetails.columnId]); return aDate.getTime() - bDate.getTime(); } else if (sortDetails.columnId === 'queued') { var aSplit = a[sortDetails.columnId].split(/ \/ /); @@ -580,13 +580,13 @@ var mod = count % 4; if (mod < 2) { $('#cluster-nodes-table span.queued-title').addClass('sorted'); - var aCount = common.parseCount(aSplit[0]); - var bCount = common.parseCount(bSplit[0]); + var aCount = nfCommon.parseCount(aSplit[0]); + var bCount = nfCommon.parseCount(bSplit[0]); return aCount - bCount; } else { $('#cluster-nodes-table span.queued-size-title').addClass('sorted'); - var aSize = common.parseSize(aSplit[1]); - var bSize = common.parseSize(bSplit[1]); + var aSize = nfCommon.parseSize(aSplit[1]); + var bSize = nfCommon.parseSize(bSplit[1]); return aSize - bSize; } } else if (sortDetails.columnId === 'maxHeap' || sortDetails.columnId === 'totalHeap' || sortDetails.columnId === 'usedHeap' @@ -594,19 +594,19 @@ || sortDetails.columnId === 'ffRepoTotal' || sortDetails.columnId === 'ffRepoUsed' || sortDetails.columnId === 'ffRepoFree' || sortDetails.columnId === 'contentRepoTotal' || sortDetails.columnId === 'contentRepoUsed' || sortDetails.columnId === 'contentRepoFree') { - 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]); return aSize - bSize; } else if (sortDetails.columnId === 'totalThreads' || sortDetails.columnId === 'daemonThreads' || sortDetails.columnId === 'processors') { - var aCount = common.parseCount(a[sortDetails.columnId]); - var bCount = common.parseCount(b[sortDetails.columnId]); + var aCount = nfCommon.parseCount(a[sortDetails.columnId]); + var bCount = nfCommon.parseCount(b[sortDetails.columnId]); return aCount - bCount; } else if (sortDetails.columnId === 'gcOldGen' || sortDetails.columnId === 'gcNewGen') { var aSplit = a[sortDetails.columnId].split(/ /); var bSplit = b[sortDetails.columnId].split(/ /); - var aCount = common.parseCount(aSplit[0]); - var bCount = common.parseCount(bSplit[0]); + var aCount = nfCommon.parseCount(aSplit[0]); + var bCount = nfCommon.parseCount(bSplit[0]); return aCount - bCount; } else if (sortDetails.columnId === 'status') { var aStatus = formatNodeStatus(a); @@ -617,8 +617,8 @@ var bNode = formatNodeAddress(b); return aNode === bNode ? 0 : aNode > bNode ? 1 : -1; } 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] : ''; return aString === bString ? 0 : aString > bString ? 1 : -1; } }; @@ -648,7 +648,7 @@ * @returns {string} */ var formatNodeAddress = function (node) { - return common.escapeHtml(node.address) + ':' + common.escapeHtml(node.apiPort); + return nfCommon.escapeHtml(node.address) + ':' + nfCommon.escapeHtml(node.apiPort); }; /** @@ -675,7 +675,7 @@ */ var promptForConnect = function (node) { // prompt to connect - dialog.showYesNoDialog({ + nfDialog.showYesNoDialog({ headerText: 'Connect Node', dialogContent: 'Connect \'' + formatNodeAddress(node) + '\' to this cluster?', yesHandler: function () { @@ -709,7 +709,7 @@ var clusterGrid = $('#cluster-nodes-table').data('gridInstance'); var clusterData = clusterGrid.getData(); clusterData.updateItem(node.nodeId, node); - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); }; /** @@ -719,7 +719,7 @@ */ var promptForDisconnect = function (node) { // prompt for disconnect - dialog.showYesNoDialog({ + nfDialog.showYesNoDialog({ headerText: 'Disconnect Node', dialogContent: 'Disconnect \'' + formatNodeAddress(node) + '\' from the cluster?', yesHandler: function () { @@ -754,7 +754,7 @@ var clusterGrid = $('#cluster-nodes-table').data('gridInstance'); var clusterData = clusterGrid.getData(); clusterData.updateItem(node.nodeId, node); - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); }; /** @@ -764,7 +764,7 @@ */ var promptForRemoval = function (node) { // prompt for disconnect - dialog.showYesNoDialog({ + nfDialog.showYesNoDialog({ headerText: 'Remove Node', dialogContent: 'Remove \'' + formatNodeAddress(node) + '\' from the cluster?', yesHandler: function () { @@ -788,7 +788,7 @@ var clusterGrid = $('#cluster-nodes-table').data('gridInstance'); var clusterData = clusterGrid.getData(); clusterData.deleteItem(nodeId); - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); }; /** @@ -812,7 +812,7 @@ var grid = visibleTab.grid; // ensure the grid has been initialized - if (common.isDefinedAndNotNull(grid)) { + if (nfCommon.isDefinedAndNotNull(grid)) { var gridData = grid.getData(); // update the search criteria @@ -912,22 +912,22 @@ $.each(node.events, function (i, event) { eventMessages.push(event.timestamp + ": " + event.message); }); - $('
').append(common.formatUnorderedList(eventMessages)).appendTo(events); + $('
').append(nfCommon.formatUnorderedList(eventMessages)).appendTo(events); } else { events.append('
None
'); } // show the dialog $('#node-details-dialog').modal('show'); - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); }; /** * Applies system diagnostics data to the JVM tab. */ function updateJvmTableData(systemDiagnosticsResponse) { - if (common.isDefinedAndNotNull(systemDiagnosticsResponse.systemDiagnostics) - && common.isDefinedAndNotNull(systemDiagnosticsResponse.systemDiagnostics.nodeSnapshots)) { + if (nfCommon.isDefinedAndNotNull(systemDiagnosticsResponse.systemDiagnostics) + && nfCommon.isDefinedAndNotNull(systemDiagnosticsResponse.systemDiagnostics.nodeSnapshots)) { var jvmTableRows = []; systemDiagnosticsResponse.systemDiagnostics.nodeSnapshots.forEach(function (nodeSnapshot) { @@ -970,8 +970,8 @@ * Applies system diagnostics data to the System tab. */ function updateSystemTableData(systemDiagnosticsResponse) { - if (common.isDefinedAndNotNull(systemDiagnosticsResponse.systemDiagnostics) - && common.isDefinedAndNotNull(systemDiagnosticsResponse.systemDiagnostics.nodeSnapshots)) { + if (nfCommon.isDefinedAndNotNull(systemDiagnosticsResponse.systemDiagnostics) + && nfCommon.isDefinedAndNotNull(systemDiagnosticsResponse.systemDiagnostics.nodeSnapshots)) { var systemTableRows = []; systemDiagnosticsResponse.systemDiagnostics.nodeSnapshots.forEach(function (nodeSnapshot) { @@ -999,8 +999,8 @@ * Applies system diagnostics data to the FlowFile Storage tab. */ function updateFlowFileTableData(systemDiagnosticsResponse) { - if (common.isDefinedAndNotNull(systemDiagnosticsResponse.systemDiagnostics) - && common.isDefinedAndNotNull(systemDiagnosticsResponse.systemDiagnostics.nodeSnapshots)) { + if (nfCommon.isDefinedAndNotNull(systemDiagnosticsResponse.systemDiagnostics) + && nfCommon.isDefinedAndNotNull(systemDiagnosticsResponse.systemDiagnostics.nodeSnapshots)) { var flowFileTableRows = []; systemDiagnosticsResponse.systemDiagnostics.nodeSnapshots.forEach(function (nodeSnapshot) { @@ -1028,8 +1028,8 @@ * Applies system diagnostics data to the Content Storage tab. */ function updateContentTableData(systemDiagnosticsResponse) { - if (common.isDefinedAndNotNull(systemDiagnosticsResponse.systemDiagnostics) - && common.isDefinedAndNotNull(systemDiagnosticsResponse.systemDiagnostics.nodeSnapshots)) { + if (nfCommon.isDefinedAndNotNull(systemDiagnosticsResponse.systemDiagnostics) + && nfCommon.isDefinedAndNotNull(systemDiagnosticsResponse.systemDiagnostics.nodeSnapshots)) { var contentStorageTableRows = []; systemDiagnosticsResponse.systemDiagnostics.nodeSnapshots.forEach(function (nodeSnapshot) { @@ -1061,8 +1061,8 @@ * Applies system diagnostics data to the Versions tab. */ function updateVersionTableData(systemDiagnosticsResponse) { - if (common.isDefinedAndNotNull(systemDiagnosticsResponse.systemDiagnostics) - && common.isDefinedAndNotNull(systemDiagnosticsResponse.systemDiagnostics.nodeSnapshots)) { + if (nfCommon.isDefinedAndNotNull(systemDiagnosticsResponse.systemDiagnostics) + && nfCommon.isDefinedAndNotNull(systemDiagnosticsResponse.systemDiagnostics.nodeSnapshots)) { var versionTableRows = []; systemDiagnosticsResponse.systemDiagnostics.nodeSnapshots.forEach(function (nodeSnapshot) { @@ -1103,7 +1103,7 @@ handlers.forEach(function (handler) { handler(systemDiagnosticsResponse); }); - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); return loadPromise; }; @@ -1176,7 +1176,7 @@ var cluster = clusterResponse.cluster; // ensure there are groups specified - if (common.isDefinedAndNotNull(cluster.nodes)) { + if (nfCommon.isDefinedAndNotNull(cluster.nodes)) { var clusterGrid = nodesTab.grid; var clusterData = clusterGrid.getData(); @@ -1206,7 +1206,7 @@ handlers.forEach(function (handler) { handler(response); }); - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); return clusterNodesDataPromise; } @@ -1216,7 +1216,7 @@ function onSelectTab(tab) { // Resize table var tabGrid = tab.grid; - if (common.isDefinedAndNotNull(tabGrid)) { + if (nfCommon.isDefinedAndNotNull(tabGrid)) { tabGrid.resizeCanvas(); } diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/cluster/nf-cluster.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/cluster/nf-cluster.js index 543c8dc4c6..69e0d3ef25 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/cluster/nf-cluster.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/cluster/nf-cluster.js @@ -24,8 +24,8 @@ 'nf.ClusterTable', 'nf.ErrorHandler', 'nf.Storage'], - function ($, common, clusterTable, errorHandler, storage) { - return (nf.Cluster = factory($, common, clusterTable, errorHandler, storage)); + function ($, nfCommon, nfClusterTable, nfErrorHandler, nfStorage) { + return (nf.Cluster = factory($, nfCommon, nfClusterTable, nfErrorHandler, nfStorage)); }); } else if (typeof exports === 'object' && typeof module === 'object') { module.exports = (nf.Cluster = @@ -41,7 +41,7 @@ root.nf.ErrorHandler, root.nf.Storage); } -}(this, function ($, common, clusterTable, errorHandler, storage) { +}(this, function ($, nfCommon, nfClusterTable, nfErrorHandler, nfStorage) { 'use strict'; $(document).ready(function () { @@ -69,8 +69,8 @@ url: config.urls.currentUser, dataType: 'json' }).done(function (currentUser) { - common.setCurrentUser(currentUser); - }).fail(errorHandler.handleAjaxError); + nfCommon.setCurrentUser(currentUser); + }).fail(nfErrorHandler.handleAjaxError); }; /** @@ -79,7 +79,7 @@ var initializeClusterPage = function () { // define mouse over event for the refresh button $('#refresh-button').click(function () { - clusterTable.loadClusterTable(); + nfClusterTable.loadClusterTable(); }); // return a deferred for page initialization @@ -92,8 +92,8 @@ dataType: 'json' }).done(function (bannerResponse) { // ensure the banners response is specified - if (common.isDefinedAndNotNull(bannerResponse.banners)) { - if (common.isDefinedAndNotNull(bannerResponse.banners.headerText) && bannerResponse.banners.headerText !== '') { + if (nfCommon.isDefinedAndNotNull(bannerResponse.banners)) { + if (nfCommon.isDefinedAndNotNull(bannerResponse.banners.headerText) && bannerResponse.banners.headerText !== '') { // update the header text var bannerHeader = $('#banner-header').text(bannerResponse.banners.headerText).show(); @@ -107,7 +107,7 @@ updateTop('counters'); } - if (common.isDefinedAndNotNull(bannerResponse.banners.footerText) && bannerResponse.banners.footerText !== '') { + if (nfCommon.isDefinedAndNotNull(bannerResponse.banners.footerText) && bannerResponse.banners.footerText !== '') { // update the footer text and show it var bannerFooter = $('#banner-footer').text(bannerResponse.banners.footerText).show(); @@ -123,7 +123,7 @@ deferred.resolve(); }).fail(function (xhr, status, error) { - errorHandler.handleAjaxError(xhr, status, error); + nfErrorHandler.handleAjaxError(xhr, status, error); deferred.reject(); }); } else { @@ -137,7 +137,7 @@ * Initializes the counters page. */ init: function () { - storage.init(); + nfStorage.init(); // load the current user loadCurrentUser().done(function () { @@ -159,13 +159,13 @@ setBodySize(); // create the cluster table - clusterTable.init(); + nfClusterTable.init(); // resize to fit - clusterTable.resetTableSize(); + nfClusterTable.resetTableSize(); // load the table - clusterTable.loadClusterTable().done(function () { + nfClusterTable.loadClusterTable().done(function () { // once the table is initialized, finish initializing the page initializeClusterPage().done(function () { @@ -181,7 +181,7 @@ // set the document title and the about title document.title = countersTitle; $('#counters-header-text').text(countersTitle); - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); $(window).on('resize', function (e) { setBodySize(); @@ -214,7 +214,7 @@ } } $.each(tabsContents, function (index, tabsContent) { - common.toggleScrollable(tabsContent.get(0)); + nfCommon.toggleScrollable(tabsContent.get(0)); }); }); }); diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/counters/nf-counters-table.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/counters/nf-counters-table.js index 95942479d0..8cd04c7c62 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/counters/nf-counters-table.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/counters/nf-counters-table.js @@ -23,8 +23,8 @@ 'Slick', 'nf.Common', 'nf.ErrorHandler'], - function ($, Slick, common, errorHandler) { - return (nf.CountersTable = factory($, Slick, common, errorHandler)); + function ($, Slick, nfCommon, nfErrorHandler) { + return (nf.CountersTable = factory($, Slick, nfCommon, nfErrorHandler)); }); } else if (typeof exports === 'object' && typeof module === 'object') { module.exports = (nf.CountersTable = @@ -38,7 +38,7 @@ root.nf.Common, root.nf.ErrorHandler); } -}(this, function ($, Slick, common, errorHandler) { +}(this, function ($, Slick, nfCommon, nfErrorHandler) { 'use strict'; /** @@ -60,12 +60,12 @@ // defines a function for sorting var comparer = function (a, b) { if (sortDetails.columnId === 'value') { - var aCount = common.parseCount(a[sortDetails.columnId]); - var bCount = common.parseCount(b[sortDetails.columnId]); + var aCount = nfCommon.parseCount(a[sortDetails.columnId]); + var bCount = nfCommon.parseCount(b[sortDetails.columnId]); return aCount - bCount; } 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] : ''; return aString === bString ? 0 : aString > bString ? 1 : -1; } }; @@ -91,7 +91,7 @@ var countersGrid = $('#counters-table').data('gridInstance'); // ensure the grid has been initialized - if (common.isDefinedAndNotNull(countersGrid)) { + if (nfCommon.isDefinedAndNotNull(countersGrid)) { var countersData = countersGrid.getData(); // update the search criteria @@ -144,7 +144,7 @@ var countersGrid = $('#counters-table').data('gridInstance'); var countersData = countersGrid.getData(); countersData.updateItem(counter.id, counter); - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); }; return { @@ -198,7 +198,7 @@ ]; // only allow dfm's to reset counters - if (common.canModifyCounters()) { + if (nfCommon.canModifyCounters()) { // function for formatting the actions column var actionFormatter = function (row, cell, value, columnDef, dataContext) { return '
'; @@ -294,7 +294,7 @@ */ resetTableSize: function () { var countersGrid = $('#counters-table').data('gridInstance'); - if (common.isDefinedAndNotNull(countersGrid)) { + if (nfCommon.isDefinedAndNotNull(countersGrid)) { countersGrid.resizeCanvas(); } }, @@ -312,7 +312,7 @@ var aggregateSnapshot = report.aggregateSnapshot; // ensure there are groups specified - if (common.isDefinedAndNotNull(aggregateSnapshot.counters)) { + if (nfCommon.isDefinedAndNotNull(aggregateSnapshot.counters)) { var countersGrid = $('#counters-table').data('gridInstance'); var countersData = countersGrid.getData(); @@ -329,7 +329,7 @@ } else { $('#total-counters').text('0'); } - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); } }; })); \ No newline at end of file diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/counters/nf-counters.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/counters/nf-counters.js index 0a16013925..22c587ee07 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/counters/nf-counters.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/counters/nf-counters.js @@ -24,8 +24,8 @@ 'nf.CountersTable', 'nf.ErrorHandler', 'nf.Storage'], - function ($, common, countersTable, errorHandler, storage) { - return (nf.Counters = factory($, common, countersTable, errorHandler, storage)); + function ($, nfCommon, nfCountersTable, nfErrorHandler, nfStorage) { + return (nf.Counters = factory($, nfCommon, nfCountersTable, nfErrorHandler, nfStorage)); }); } else if (typeof exports === 'object' && typeof module === 'object') { module.exports = (nf.Counters = @@ -41,7 +41,7 @@ root.nf.ErrorHandler, root.nf.Storage); } -}(this, function ($, common, countersTable, errorHandler, storage) { +}(this, function ($, nfCommon, nfCountersTable, nfErrorHandler, nfStorage) { 'use strict'; $(document).ready(function () { @@ -69,9 +69,9 @@ url: config.urls.currentUser, dataType: 'json' }).done(function (currentUser) { - common.setCurrentUser(currentUser); + nfCommon.setCurrentUser(currentUser); - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); }; /** @@ -80,7 +80,7 @@ var initializeCountersPage = function () { // define mouse over event for the refresh button $('#refresh-button').click(function () { - countersTable.loadCountersTable(); + nfCountersTable.loadCountersTable(); }); // return a deferred for page initialization @@ -93,8 +93,8 @@ dataType: 'json' }).done(function (response) { // ensure the banners response is specified - if (common.isDefinedAndNotNull(response.banners)) { - if (common.isDefinedAndNotNull(response.banners.headerText) && response.banners.headerText !== '') { + if (nfCommon.isDefinedAndNotNull(response.banners)) { + if (nfCommon.isDefinedAndNotNull(response.banners.headerText) && response.banners.headerText !== '') { // update the header text var bannerHeader = $('#banner-header').text(response.banners.headerText).show(); @@ -108,7 +108,7 @@ updateTop('counters'); } - if (common.isDefinedAndNotNull(response.banners.footerText) && response.banners.footerText !== '') { + if (nfCommon.isDefinedAndNotNull(response.banners.footerText) && response.banners.footerText !== '') { // update the footer text and show it var bannerFooter = $('#banner-footer').text(response.banners.footerText).show(); @@ -124,7 +124,7 @@ deferred.resolve(); }).fail(function (xhr, status, error) { - errorHandler.handleAjaxError(xhr, status, error); + nfErrorHandler.handleAjaxError(xhr, status, error); deferred.reject(); }); } else { @@ -138,15 +138,15 @@ * Initializes the counters page. */ init: function () { - storage.init(); + nfStorage.init(); // load the current user loadCurrentUser().done(function () { // create the counters table - countersTable.init(); + nfCountersTable.init(); // load the table - countersTable.loadCountersTable().done(function () { + nfCountersTable.loadCountersTable().done(function () { // once the table is initialized, finish initializing the page initializeCountersPage().done(function () { var setBodySize = function () { @@ -163,7 +163,7 @@ } // configure the initial grid height - countersTable.resetTableSize(); + nfCountersTable.resetTableSize(); }; // get the about details @@ -181,7 +181,7 @@ // set the initial size setBodySize(); - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); $(window).on('resize', function (e) { setBodySize(); @@ -214,7 +214,7 @@ } } $.each(tabsContents, function (index, tabsContent) { - common.toggleScrollable(tabsContent.get(0)); + nfCommon.toggleScrollable(tabsContent.get(0)); }); }); }); diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/history/nf-history-model.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/history/nf-history-model.js index bf1e34a591..43613fd1a3 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/history/nf-history-model.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/history/nf-history-model.js @@ -23,8 +23,8 @@ 'Slick', 'nf.Common', 'nf.ErrorHandler'], - function ($, Slick, common, errorHandler) { - return (nf.HistoryModel = factory($, Slick, common, errorHandler)); + function ($, Slick, nfCommon, nfErrorHandler) { + return (nf.HistoryModel = factory($, Slick, nfCommon, nfErrorHandler)); }); } else if (typeof exports === 'object' && typeof module === 'object') { module.exports = (nf.HistoryModel = @@ -38,7 +38,7 @@ root.nf.Common, root.nf.ErrorHandler); } -}(this, function ($, Slick, common, errorHandler) { +}(this, function ($, Slick, nfCommon, nfErrorHandler) { 'use strict'; // private @@ -164,7 +164,7 @@ $('#history-last-refreshed').text(history.lastRefreshed); // set the timezone for the start and end time - $('.timezone').text(common.substringAfterLast(history.lastRefreshed, ' ')); + $('.timezone').text(nfCommon.substringAfterLast(history.lastRefreshed, ' ')); // show the filter message if applicable if (query['sourceId'] || query['userIdentity'] || query['startDate'] || query['endDate']) { @@ -181,7 +181,7 @@ from: from, to: to }); - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); xhr.fromPage = fromPage; xhr.toPage = toPage; diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/history/nf-history-table.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/history/nf-history-table.js index 16b0007bb4..64bcab0ba1 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/history/nf-history-table.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/history/nf-history-table.js @@ -25,8 +25,8 @@ 'nf.Dialog', 'nf.ErrorHandler', 'nf.HistoryModel'], - function ($, Slick, common, dialog, errorHandler, HistoryModel) { - return (nf.HistoryTable = factory($, Slick, common, dialog, errorHandler, HistoryModel)); + function ($, Slick, nfCommon, nfDialog, nfErrorHandler, nfHistoryModel) { + return (nf.HistoryTable = factory($, Slick, nfCommon, nfDialog, nfErrorHandler, nfHistoryModel)); }); } else if (typeof exports === 'object' && typeof module === 'object') { module.exports = (nf.HistoryTable = @@ -44,7 +44,7 @@ root.nf.ErrorHandler, root.nf.HistoryModel); } -}(this, function ($, Slick, common, dialog, errorHandler, HistoryModel) { +}(this, function ($, Slick, nfCommon, nfDialog, nfErrorHandler, nfHistoryModel) { 'use strict'; /** @@ -240,15 +240,15 @@ } var endDateTime = endDate + ' ' + endTime; var timezone = $('.timezone:first').text(); - dialog.showYesNoDialog({ + nfDialog.showYesNoDialog({ headerText: 'History', - dialogContent: "Are you sure you want to delete all history before '" + common.escapeHtml(endDateTime) + " " + common.escapeHtml(timezone) + "'?", + dialogContent: "Are you sure you want to delete all history before '" + nfCommon.escapeHtml(endDateTime) + " " + nfCommon.escapeHtml(timezone) + "'?", yesHandler: function () { purgeHistory(endDateTime); } }); } else { - dialog.showOkDialog({ + nfDialog.showOkDialog({ headerText: 'History', dialogContent: 'The end date must be specified.' }); @@ -311,7 +311,7 @@ if (dataContext.canRead !== true) { return 'Not authorized'; } - return common.formatValue(dataContext.action[columnDef.field]); + return nfCommon.formatValue(dataContext.action[columnDef.field]); }; // initialize the templates table @@ -377,7 +377,7 @@ }; // create the remote model - var historyModel = new HistoryModel(); + var historyModel = new nfHistoryModel(); // initialize the grid var historyGrid = new Slick.Grid('#history-table', historyModel, historyColumns, historyOptions); @@ -429,7 +429,7 @@ $('#history-table').data('gridInstance', historyGrid); // add the purge button if appropriate - if (common.canModifyController()) { + if (nfCommon.canModifyController()) { $('#history-purge-button').on('click', function () { $('#history-purge-dialog').modal('show'); }).show(); @@ -450,7 +450,7 @@ dataType: 'json' }).done(function () { nfHistoryTable.loadHistoryTable(); - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); }; /** @@ -461,19 +461,19 @@ var showActionDetails = function (action) { // create the markup for the dialog var detailsMarkup = $('
').append( - $('
Id
' + common.escapeHtml(action.sourceId) + '
')); + $('
Id
' + nfCommon.escapeHtml(action.sourceId) + '
')); // get any component details var componentDetails = action.componentDetails; // inspect the operation to determine if there are any component details - if (common.isDefinedAndNotNull(componentDetails)) { + if (nfCommon.isDefinedAndNotNull(componentDetails)) { if (action.sourceType === 'Processor' || action.sourceType === 'ControllerService' || action.sourceType === 'ReportingTask') { detailsMarkup.append( - $('
Type
' + common.escapeHtml(componentDetails.type) + '
')); + $('
Type
' + nfCommon.escapeHtml(componentDetails.type) + '
')); } else if (action.sourceType === 'RemoteProcessGroup') { detailsMarkup.append( - $('
Uri
' + common.formatValue(componentDetails.uri) + '
')); + $('
Uri
' + nfCommon.formatValue(componentDetails.uri) + '
')); } } @@ -481,30 +481,30 @@ var actionDetails = action.actionDetails; // inspect the operation to determine if there are any action details - if (common.isDefinedAndNotNull(actionDetails)) { + if (nfCommon.isDefinedAndNotNull(actionDetails)) { if (action.operation === 'Configure') { detailsMarkup.append( - $('
Name
' + common.formatValue(actionDetails.name) + '
')).append( - $('
Value
' + common.formatValue(actionDetails.value) + '
')).append( - $('
Previous Value
' + common.formatValue(actionDetails.previousValue) + '
')); + $('
Name
' + nfCommon.formatValue(actionDetails.name) + '
')).append( + $('
Value
' + nfCommon.formatValue(actionDetails.value) + '
')).append( + $('
Previous Value
' + nfCommon.formatValue(actionDetails.previousValue) + '
')); } else if (action.operation === 'Connect' || action.operation === 'Disconnect') { detailsMarkup.append( - $('
Source Id
' + common.escapeHtml(actionDetails.sourceId) + '
')).append( - $('
Source Name
' + common.formatValue(actionDetails.sourceName) + '
')).append( - $('
Source Type
' + common.escapeHtml(actionDetails.sourceType) + '
')).append( - $('
Relationship(s)
' + common.formatValue(actionDetails.relationship) + '
')).append( - $('
Destination Id
' + common.escapeHtml(actionDetails.destinationId) + '
')).append( - $('
Destination Name
' + common.formatValue(actionDetails.destinationName) + '
')).append( - $('
Destination Type
' + common.escapeHtml(actionDetails.destinationType) + '
')); + $('
Source Id
' + nfCommon.escapeHtml(actionDetails.sourceId) + '
')).append( + $('
Source Name
' + nfCommon.formatValue(actionDetails.sourceName) + '
')).append( + $('
Source Type
' + nfCommon.escapeHtml(actionDetails.sourceType) + '
')).append( + $('
Relationship(s)
' + nfCommon.formatValue(actionDetails.relationship) + '
')).append( + $('
Destination Id
' + nfCommon.escapeHtml(actionDetails.destinationId) + '
')).append( + $('
Destination Name
' + nfCommon.formatValue(actionDetails.destinationName) + '
')).append( + $('
Destination Type
' + nfCommon.escapeHtml(actionDetails.destinationType) + '
')); } else if (action.operation === 'Move') { detailsMarkup.append( - $('
Group
' + common.formatValue(actionDetails.group) + '
')).append( - $('
Group Id
' + common.escapeHtml(actionDetails.groupId) + '
')).append( - $('
Previous Group
' + common.formatValue(actionDetails.previousGroup) + '
')).append( - $('
Previous Group Id
' + common.escapeHtml(actionDetails.previousGroupId) + '
')); + $('
Group
' + nfCommon.formatValue(actionDetails.group) + '
')).append( + $('
Group Id
' + nfCommon.escapeHtml(actionDetails.groupId) + '
')).append( + $('
Previous Group
' + nfCommon.formatValue(actionDetails.previousGroup) + '
')).append( + $('
Previous Group Id
' + nfCommon.escapeHtml(actionDetails.previousGroupId) + '
')); } else if (action.operation === 'Purge') { detailsMarkup.append( - $('
End Date
' + common.escapeHtml(actionDetails.endDate) + '
')); + $('
End Date
' + nfCommon.escapeHtml(actionDetails.endDate) + '
')); } } @@ -528,7 +528,7 @@ */ resetTableSize: function () { var historyGrid = $('#history-table').data('gridInstance'); - if (common.isDefinedAndNotNull(historyGrid)) { + if (nfCommon.isDefinedAndNotNull(historyGrid)) { historyGrid.resizeCanvas(); } }, diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/history/nf-history.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/history/nf-history.js index 9370c7aae9..85b21222ae 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/history/nf-history.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/history/nf-history.js @@ -25,8 +25,8 @@ 'nf.ErrorHandler', 'nf.Storage', 'nf.ClusterSummary'], - function ($, common, historyTable, errorHandler, storage, clusterSummary) { - return (nf.History = factory($, common, historyTable, errorHandler, storage, clusterSummary)); + function ($, nfCommon, nfHistoryTable, nfErrorHandler, nfStorage, nfClusterSummary) { + return (nf.History = factory($, nfCommon, nfHistoryTable, nfErrorHandler, nfStorage, nfClusterSummary)); }); } else if (typeof exports === 'object' && typeof module === 'object') { module.exports = (nf.History = @@ -44,7 +44,7 @@ root.nf.Storage, root.nf.ClusterSummary); } -}(this, function ($, common, historyTable, errorHandler, storage, clusterSummary) { +}(this, function ($, nfCommon, nfHistoryTable, nfErrorHandler, nfStorage, nfClusterSummary) { 'use strict'; $(document).ready(function () { @@ -72,8 +72,8 @@ url: config.urls.currentUser, dataType: 'json' }).done(function (currentUser) { - common.setCurrentUser(currentUser); - }).fail(errorHandler.handleAjaxError); + nfCommon.setCurrentUser(currentUser); + }).fail(nfErrorHandler.handleAjaxError); }; /** @@ -82,7 +82,7 @@ var initializeHistoryPage = function () { // define mouse over event for the refresh button $('#refresh-button').click(function () { - historyTable.loadHistoryTable(); + nfHistoryTable.loadHistoryTable(); }); // return a deferred for page initialization @@ -95,8 +95,8 @@ dataType: 'json' }).done(function (response) { // ensure the banners response is specified - if (common.isDefinedAndNotNull(response.banners)) { - if (common.isDefinedAndNotNull(response.banners.headerText) && response.banners.headerText !== '') { + if (nfCommon.isDefinedAndNotNull(response.banners)) { + if (nfCommon.isDefinedAndNotNull(response.banners.headerText) && response.banners.headerText !== '') { // update the header text var bannerHeader = $('#banner-header').text(response.banners.headerText).show(); @@ -110,7 +110,7 @@ updateTop('history'); } - if (common.isDefinedAndNotNull(response.banners.footerText) && response.banners.footerText !== '') { + if (nfCommon.isDefinedAndNotNull(response.banners.footerText) && response.banners.footerText !== '') { // update the footer text and show it var bannerFooter = $('#banner-footer').text(response.banners.footerText).show(); @@ -126,7 +126,7 @@ deferred.resolve(); }).fail(function (xhr, status, error) { - errorHandler.handleAjaxError(xhr, status, error); + nfErrorHandler.handleAjaxError(xhr, status, error); deferred.reject(); }); } else { @@ -143,20 +143,20 @@ // load the current user var currentUser = loadCurrentUser() - storage.init(); + nfStorage.init(); // ensure the config requests are loaded $.when(currentUser).done(function (currentUserResult) { // if clustered, show message to indicate location of actions - if (clusterSummary.isClustered() === true) { + if (nfClusterSummary.isClustered() === true) { $('#cluster-history-message').show(); } // create the history table - historyTable.init(); + nfHistoryTable.init(); // load the history table - historyTable.loadHistoryTable(); + nfHistoryTable.loadHistoryTable(); // once the table is initialized, finish initializing the page initializeHistoryPage().done(function () { @@ -173,7 +173,7 @@ } // configure the initial grid height - historyTable.resetTableSize(); + nfHistoryTable.resetTableSize(); }; // get the about details @@ -191,7 +191,7 @@ // set the initial size setBodySize(); - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); $(window).on('resize', function (e) { setBodySize(); @@ -224,7 +224,7 @@ } } $.each(tabsContents, function (index, tabsContent) { - common.toggleScrollable(tabsContent.get(0)); + nfCommon.toggleScrollable(tabsContent.get(0)); }); }); }); diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/login/nf-login.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/login/nf-login.js index 1cdab114e3..3c1b95f350 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/login/nf-login.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/login/nf-login.js @@ -23,8 +23,8 @@ 'nf.Common', 'nf.Dialog', 'nf.Storage'], - function ($, common, dialog, storage) { - return (nf.Login = factory($, common, dialog, storage)); + function ($, nfCommon, nfDialog, nfStorage) { + return (nf.Login = factory($, nfCommon, nfDialog, nfStorage)); }); } else if (typeof exports === 'object' && typeof module === 'object') { module.exports = (nf.Login = @@ -38,7 +38,7 @@ root.nf.Dialog, root.nf.Storage); } -}(this, function ($, common, dialog, storage) { +}(this, function ($, nfCommon, nfDialog, nfStorage) { 'use strict'; $(document).ready(function () { @@ -100,9 +100,9 @@ } }).done(function (jwt) { // get the payload and store the token with the appropirate expiration - var token = common.getJwtPayload(jwt); - var expiration = parseInt(token['exp'], 10) * common.MILLIS_PER_SECOND; - storage.setItem('jwt', jwt, expiration); + var token = nfCommon.getJwtPayload(jwt); + var expiration = parseInt(token['exp'], 10) * nfCommon.MILLIS_PER_SECOND; + nfStorage.setItem('jwt', jwt, expiration); // check to see if they actually have access now $.ajax({ @@ -144,9 +144,9 @@ $('#login-message-container').show(); }); }).fail(function (xhr, status, error) { - dialog.showOkDialog({ + nfDialog.showOkDialog({ headerText: 'Login', - dialogContent: common.escapeHtml(xhr.responseText) + dialogContent: nfCommon.escapeHtml(xhr.responseText) }); // update the form visibility @@ -156,7 +156,7 @@ }; var showLogoutLink = function () { - common.showLogoutLink(); + nfCommon.showLogoutLink(); }; var nfLogin = { @@ -164,9 +164,9 @@ * Initializes the login page. */ init: function () { - storage.init(); + nfStorage.init(); - if (storage.getItem('jwt') !== null) { + if (nfStorage.getItem('jwt') !== null) { showLogoutLink(); } diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-ajax-setup.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-ajax-setup.js index 16c20e3587..ac5bc1c2df 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-ajax-setup.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-ajax-setup.js @@ -21,8 +21,8 @@ if (typeof define === 'function' && define.amd) { define(['jquery', 'nf.Storage'], - function ($, storage) { - return (nf.AjaxSetup = factory($, storage)); + function ($, nfStorage) { + return (nf.AjaxSetup = factory($, nfStorage)); }); } else if (typeof exports === 'object' && typeof module === 'object') { module.exports = (nf.AjaxSetup = factory(require('jquery'), @@ -31,7 +31,7 @@ nf.AjaxSetup = factory(root.$, root.nf.Storage); } -}(this, function ($, storage) { +}(this, function ($, nfStorage) { /** * Performs ajax setup for use within NiFi. */ @@ -39,10 +39,10 @@ // include jwt when possible $.ajaxSetup({ 'beforeSend': function (xhr) { - var hadToken = storage.hasItem('jwt'); + var hadToken = nfStorage.hasItem('jwt'); // get the token to include in all requests - var token = storage.getItem('jwt'); + var token = nfStorage.getItem('jwt'); if (token !== null) { xhr.setRequestHeader('Authorization', 'Bearer ' + token); } else { 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 812f20a527..cd6521d2ed 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; 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 58e5b639d0..2b2677a250 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 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 d06d8a321a..a6538a905c 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 = $('
').text(processor.name).addClass('ellipsis').attr('title', processor.name); - var processorType = $('
').text(common.substringAfterLast(processor.type, '.')).addClass('ellipsis').attr('title', common.substringAfterLast(processor.type, '.')); + var processorType = $('
').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 = $('
').text(processor.name).addClass('ellipsis').attr('title', processor.name); - var processorType = $('
').text(common.substringAfterLast(processor.type, '.')).addClass('ellipsis').attr('title', common.substringAfterLast(processor.type, '.')); + var processorType = $('
').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 = $('
    ').css('list-style', 'decimal inside none'); $.each(connection.prioritizers, function (i, type) { - prioritizerList.append($('
  1. ').text(common.substringAfterLast(type, '.'))); + prioritizerList.append($('
  2. ').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 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 0929b76128..f7a538fc5d 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') { 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 fb89f09e27..5e7b267a84 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 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 3130c8618e..1b6b28a363 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 = $('
    ').append(relationshipLabel).appendTo('#read-only-auto-terminate-relationship-names'); - if (!common.isBlank(relationship.description)) { + if (!nfCommon.isBlank(relationship.description)) { var relationshipDescription = $('
    ').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); } }); } 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 98605725c3..9296f217b4 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(); } 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 26243197dc..ab3cb85ac2 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 @@ $('
    ').text(label).appendTo(detailContainer); var detailElement = $('
    ').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); } }; 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 f46d287a60..28ef92f703 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(); 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 5bbaa09888..1ae4c1d01c 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 += '
    '; } // 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 += '
    '; } @@ -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 = $('
    ').text(value + '%'); - (angularBridge.injector.get('$compile')($(''))(angularBridge.rootScope)).appendTo(progressBar); + (nfNgBridge.injector.get('$compile')($(''))(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('No value set'); @@ -1330,7 +1330,7 @@ var formatEventDetail = function (label, value) { $('
    ').append( $('
    ').text(label)).append( - $('
    ' + common.formatValue(value) + '
    ').ellipsis()).append( + $('
    ' + nfCommon.formatValue(value) + '
    ').ellipsis()).append( $('
    ')).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('No parents'); } 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('No children'); } else { @@ -1402,23 +1402,23 @@ $.each(event.attributes, function (_, attribute) { // create the attribute record var attributeRecord = $('
    ') - .append($('
    ' + common.formatValue(attribute.name) + '
    ').ellipsis()) + .append($('
    ' + nfCommon.formatValue(attribute.name) + '
    ').ellipsis()) .appendTo(attributesContainer); // add the current value attributeRecord - .append($('
    ' + common.formatValue(attribute.value) + '
    ').ellipsis()) + .append($('
    ' + nfCommon.formatValue(attribute.value) + '
    ').ellipsis()) .append('
    '); // 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($('
    ' + common.formatValue(attribute.previousValue) + ' (previous)
    ').ellipsis()) + .append($('
    ' + nfCommon.formatValue(attribute.previousValue) + ' (previous)
    ').ellipsis()) .append('
    '); } else { attributeRecord - .append($('
    ' + common.formatValue(attribute.previousValue) + '
    ').ellipsis()) + .append($('
    ' + nfCommon.formatValue(attribute.previousValue) + '
    ').ellipsis()) .append('
    '); } } 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(); diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance.js index fd8f7dbf05..5dc2a2d8d8 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance.js @@ -31,25 +31,25 @@ 'nf.Storage'], function ($, angular, - common, + nfCommon, appConfig, appCtrl, provenanceLineage, provenanceTable, - angularBridge, - errorHandler, - storage) { + nfNgBridge, + nfErrorHandler, + nfStorage) { return (nf.ng.Provenance = factory($, angular, - common, + nfCommon, appConfig, appCtrl, provenanceLineage, provenanceTable, - angularBridge, - errorHandler, - storage)); + nfNgBridge, + nfErrorHandler, + nfStorage)); }); } else if (typeof exports === 'object' && typeof module === 'object') { module.exports = (nf.ng.Provenance = @@ -75,7 +75,7 @@ root.nf.ErrorHandler, root.nf.Storage); } -}(this, function ($, angular, common, appConfig, appCtrl, provenanceLineage, provenanceTable, angularBridge, errorHandler, storage) { +}(this, function ($, angular, nfCommon, appConfig, appCtrl, provenanceLineage, provenanceTable, nfNgBridge, nfErrorHandler, nfStorage) { 'use strict'; $(document).ready(function () { @@ -101,10 +101,10 @@ app.service('provenanceTableCtrl', provenanceTable); //Manually Boostrap Angular App - angularBridge.injector = angular.bootstrap($('body'), ['ngProvenanceApp'], {strictDi: true}); + nfNgBridge.injector = angular.bootstrap($('body'), ['ngProvenanceApp'], {strictDi: true}); // initialize the status page - angularBridge.injector.get('provenanceCtrl').init(); + nfNgBridge.injector.get('provenanceCtrl').init(); }); var nfProvenance = function (provenanceTableCtrl) { @@ -135,7 +135,7 @@ url: config.urls.clusterSummary }).done(function (response) { isClustered = response.clusterSummary.connectedToCluster; - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); }; /** @@ -158,14 +158,14 @@ $('.timezone').text(aboutDetails.timezone); // store the content viewer url if available - if (!common.isBlank(aboutDetails.contentViewerUrl)) { + if (!nfCommon.isBlank(aboutDetails.contentViewerUrl)) { $('#nifi-content-viewer-url').text(aboutDetails.contentViewerUrl); } // set the document title and the about title document.title = provenanceTitle; $('#provenance-header-text').text(provenanceTitle); - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); }; /** @@ -177,8 +177,8 @@ url: config.urls.currentUser, dataType: 'json' }).done(function (currentUser) { - common.setCurrentUser(currentUser); - }).fail(errorHandler.handleAjaxError); + nfCommon.setCurrentUser(currentUser); + }).fail(nfErrorHandler.handleAjaxError); }; /** @@ -200,8 +200,8 @@ dataType: 'json' }).done(function (response) { // ensure the banners response is specified - if (common.isDefinedAndNotNull(response.banners)) { - if (common.isDefinedAndNotNull(response.banners.headerText) && response.banners.headerText !== '') { + if (nfCommon.isDefinedAndNotNull(response.banners)) { + if (nfCommon.isDefinedAndNotNull(response.banners.headerText) && response.banners.headerText !== '') { // update the header text var bannerHeader = $('#banner-header').text(response.banners.headerText).show(); @@ -215,7 +215,7 @@ updateTop('provenance'); } - if (common.isDefinedAndNotNull(response.banners.footerText) && response.banners.footerText !== '') { + if (nfCommon.isDefinedAndNotNull(response.banners.footerText) && response.banners.footerText !== '') { // update the footer text and show it var bannerFooter = $('#banner-footer').text(response.banners.footerText).show(); @@ -231,7 +231,7 @@ deferred.resolve(); }).fail(function (xhr, status, error) { - errorHandler.handleAjaxError(xhr, status, error); + nfErrorHandler.handleAjaxError(xhr, status, error); deferred.reject(); }); } else { @@ -250,7 +250,7 @@ * Initializes the status page. */ init: function () { - storage.init(); + nfStorage.init(); // load the user and detect if the NiFi is clustered $.when(loadAbout(), loadCurrentUser(), detectedCluster()).done(function () { @@ -346,7 +346,7 @@ } } $.each(tabsContents, function (index, tabsContent) { - common.toggleScrollable(tabsContent.get(0)); + nfCommon.toggleScrollable(tabsContent.get(0)); }); }); }); diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-cluster-search.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-cluster-search.js index b9eeb70139..b6ec30ef0e 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-cluster-search.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-cluster-search.js @@ -23,8 +23,8 @@ 'nf.Common', 'nf.Dialog', 'nf.SummaryTable'], - function ($, common, dialog, summaryTable) { - return (nf.ClusterSearch = factory($, common, dialog, summaryTable)); + function ($, nfCommon, nfDialog, nfSummaryTable) { + return (nf.ClusterSearch = factory($, nfCommon, nfDialog, nfSummaryTable)); }); } else if (typeof exports === 'object' && typeof module === 'object') { module.exports = (nf.ClusterSearch = @@ -38,7 +38,7 @@ root.nf.Dialog, root.nf.SummaryTable); } -}(this, function ($, common, dialog, summaryTable) { +}(this, function ($, nfCommon, nfDialog, nfSummaryTable) { 'use strict'; /** @@ -85,10 +85,10 @@ // selects the specified node var selectNode = function (node) { // update the urls to point to this specific node of the cluster - summaryTable.setClusterNodeId(node.id); + nfSummaryTable.setClusterNodeId(node.id); // load the summary for the selected node - summaryTable.loadSummaryTable(); + nfSummaryTable.loadSummaryTable(); // update the header $('#summary-header-text').text(node.address + ' Summary'); @@ -96,9 +96,9 @@ // ensure the search found some results if (!$.isArray(searchResults) || searchResults.length === 0) { - dialog.showOkDialog({ + nfDialog.showOkDialog({ headerText: 'Cluster Search', - dialogContent: 'No nodes match \'' + common.escapeHtml(clusterSearchTerm) + '\'.' + dialogContent: 'No nodes match \'' + nfCommon.escapeHtml(clusterSearchTerm) + '\'.' }); } else if (searchResults.length > 1) { var exactMatch = false; @@ -117,9 +117,9 @@ // close the dialog $('#view-single-node-dialog').modal('hide'); } else { - dialog.showOkDialog({ + nfDialog.showOkDialog({ headerText: 'Cluster Search', - dialogContent: 'More than one node matches \'' + common.escapeHtml(clusterSearchTerm) + '\'.' + dialogContent: 'More than one node matches \'' + nfCommon.escapeHtml(clusterSearchTerm) + '\'.' }); } } else if (searchResults.length === 1) { @@ -234,8 +234,8 @@ // handle the view cluster click event $('#view-cluster-link').click(function () { // reset the urls and refresh the table - summaryTable.setClusterNodeId(null); - summaryTable.loadSummaryTable(); + nfSummaryTable.setClusterNodeId(null); + nfSummaryTable.loadSummaryTable(); // update the header $('#summary-header-text').text('NiFi Summary'); diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-summary-table.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-summary-table.js index 700e666f0a..4f83691efb 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-summary-table.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-summary-table.js @@ -26,8 +26,8 @@ 'nf.ProcessorDetails', 'nf.ConnectionDetails', 'nf.ng.Bridge'], - function ($, Slick, common, errorHandler, statusHistory, processorDetails, connectionDetails, angularBridge) { - return (nf.SummaryTable = factory($, Slick, common, errorHandler, statusHistory, processorDetails, connectionDetails, angularBridge)); + function ($, Slick, nfCommon, nfErrorHandler, nfStatusHistory, nfProcessorDetails, nfConnectionDetails, nfNgBridge) { + return (nf.SummaryTable = factory($, Slick, nfCommon, nfErrorHandler, nfStatusHistory, nfProcessorDetails, nfConnectionDetails, nfNgBridge)); }); } else if (typeof exports === 'object' && typeof module === 'object') { module.exports = (nf.SummaryTable = @@ -49,7 +49,7 @@ root.nf.ConnectionDetails, root.nf.ng.Bridge); } -}(this, function ($, Slick, common, errorHandler, statusHistory, processorDetails, connectionDetails, angularBridge) { +}(this, function ($, Slick, nfCommon, nfErrorHandler, nfStatusHistory, nfProcessorDetails, nfConnectionDetails, nfNgBridge) { 'use strict'; /** @@ -74,7 +74,7 @@ // 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(groupId, componentId); parent.$('#shell-close-button').click(); } @@ -121,12 +121,12 @@ if (tab === 'Processors') { // ensure the processor table is sized properly var processorsGrid = $('#processor-summary-table').data('gridInstance'); - if (common.isDefinedAndNotNull(processorsGrid)) { + if (nfCommon.isDefinedAndNotNull(processorsGrid)) { processorsGrid.resizeCanvas(); // update the total number of processors - $('#displayed-items').text(common.formatInteger(processorsGrid.getData().getLength())); - $('#total-items').text(common.formatInteger(processorsGrid.getData().getLength())); + $('#displayed-items').text(nfCommon.formatInteger(processorsGrid.getData().getLength())); + $('#total-items').text(nfCommon.formatInteger(processorsGrid.getData().getLength())); } // update the combo for processors @@ -145,12 +145,12 @@ } else if (tab === 'Connections') { // ensure the connection table is size properly var connectionsGrid = $('#connection-summary-table').data('gridInstance'); - if (common.isDefinedAndNotNull(connectionsGrid)) { + if (nfCommon.isDefinedAndNotNull(connectionsGrid)) { connectionsGrid.resizeCanvas(); // update the total number of connections - $('#displayed-items').text(common.formatInteger(connectionsGrid.getData().getLength())); - $('#total-items').text(common.formatInteger(connectionsGrid.getData().getLength())); + $('#displayed-items').text(nfCommon.formatInteger(connectionsGrid.getData().getLength())); + $('#total-items').text(nfCommon.formatInteger(connectionsGrid.getData().getLength())); } // update the combo for connections @@ -172,12 +172,12 @@ } else if (tab === 'Input Ports') { // ensure the connection table is size properly var inputPortsGrid = $('#input-port-summary-table').data('gridInstance'); - if (common.isDefinedAndNotNull(inputPortsGrid)) { + if (nfCommon.isDefinedAndNotNull(inputPortsGrid)) { inputPortsGrid.resizeCanvas(); // update the total number of input ports - $('#displayed-items').text(common.formatInteger(inputPortsGrid.getData().getLength())); - $('#total-items').text(common.formatInteger(inputPortsGrid.getData().getLength())); + $('#displayed-items').text(nfCommon.formatInteger(inputPortsGrid.getData().getLength())); + $('#total-items').text(nfCommon.formatInteger(inputPortsGrid.getData().getLength())); } // update the combo for input ports @@ -193,12 +193,12 @@ } else if (tab === 'Output Ports') { // ensure the connection table is size properly var outputPortsGrid = $('#output-port-summary-table').data('gridInstance'); - if (common.isDefinedAndNotNull(outputPortsGrid)) { + if (nfCommon.isDefinedAndNotNull(outputPortsGrid)) { outputPortsGrid.resizeCanvas(); // update the total number of output ports - $('#displayed-items').text(common.formatInteger(outputPortsGrid.getData().getLength())); - $('#total-items').text(common.formatInteger(outputPortsGrid.getData().getLength())); + $('#displayed-items').text(nfCommon.formatInteger(outputPortsGrid.getData().getLength())); + $('#total-items').text(nfCommon.formatInteger(outputPortsGrid.getData().getLength())); } // update the combo for output ports @@ -214,12 +214,12 @@ } else if (tab === 'Remote Process Groups') { // ensure the connection table is size properly var remoteProcessGroupsGrid = $('#remote-process-group-summary-table').data('gridInstance'); - if (common.isDefinedAndNotNull(remoteProcessGroupsGrid)) { + if (nfCommon.isDefinedAndNotNull(remoteProcessGroupsGrid)) { remoteProcessGroupsGrid.resizeCanvas(); // update the total number of remote process groups - $('#displayed-items').text(common.formatInteger(remoteProcessGroupsGrid.getData().getLength())); - $('#total-items').text(common.formatInteger(remoteProcessGroupsGrid.getData().getLength())); + $('#displayed-items').text(nfCommon.formatInteger(remoteProcessGroupsGrid.getData().getLength())); + $('#total-items').text(nfCommon.formatInteger(remoteProcessGroupsGrid.getData().getLength())); } // update the combo for remote process groups @@ -238,12 +238,12 @@ } else { // ensure the connection table is size properly var processGroupGrid = $('#process-group-summary-table').data('gridInstance'); - if (common.isDefinedAndNotNull(processGroupGrid)) { + if (nfCommon.isDefinedAndNotNull(processGroupGrid)) { processGroupGrid.resizeCanvas(); // update the total number of process groups - $('#displayed-items').text(common.formatInteger(processGroupGrid.getData().getLength())); - $('#total-items').text(common.formatInteger(processGroupGrid.getData().getLength())); + $('#displayed-items').text(nfCommon.formatInteger(processGroupGrid.getData().getLength())); + $('#total-items').text(nfCommon.formatInteger(processGroupGrid.getData().getLength())); } // update the combo for process groups @@ -269,8 +269,8 @@ var markup = '
    '; // if there are bulletins, render them on the graph - if (!common.isEmpty(dataContext.bulletins)) { - markup += '
    '; + if (!nfCommon.isEmpty(dataContext.bulletins)) { + markup += '
    '; } return markup; @@ -283,22 +283,22 @@ // formatter for tasks var taskTimeFormatter = function (row, cell, value, columnDef, dataContext) { - return common.formatInteger(dataContext.tasks) + ' / ' + dataContext.tasksDuration; + return nfCommon.formatInteger(dataContext.tasks) + ' / ' + dataContext.tasksDuration; }; // function for formatting the last accessed time var valueFormatter = function (row, cell, value, columnDef, dataContext) { - return common.formatValue(value); + return nfCommon.formatValue(value); }; // define a custom formatter for the run status column var runStatusFormatter = function (row, cell, value, columnDef, dataContext) { var activeThreadCount = ''; - if (common.isDefinedAndNotNull(dataContext.activeThreadCount) && dataContext.activeThreadCount > 0) { + if (nfCommon.isDefinedAndNotNull(dataContext.activeThreadCount) && dataContext.activeThreadCount > 0) { activeThreadCount = '(' + dataContext.activeThreadCount + ')'; } - var classes = common.escapeHtml(value.toLowerCase()); - switch (common.escapeHtml(value.toLowerCase())) { + var classes = nfCommon.escapeHtml(value.toLowerCase()); + switch (nfCommon.escapeHtml(value.toLowerCase())) { case 'running': classes += ' fa fa-play running'; break; @@ -318,7 +318,7 @@ classes += ''; } var formattedValue = '
    '; - return formattedValue + '
    ' + common.escapeHtml(value) + '
    ' + common.escapeHtml(activeThreadCount) + '
    '; + return formattedValue + '
    ' + nfCommon.escapeHtml(value) + '
    ' + nfCommon.escapeHtml(activeThreadCount) + '
    '; }; // define the input, read, written, and output columns (reused between both tables) @@ -395,7 +395,7 @@ var isInShell = (top !== window); // add an action column if appropriate - if (isClustered || isInShell || common.SUPPORTS_SVG) { + if (isClustered || isInShell || nfCommon.SUPPORTS_SVG) { // define how the column is formatted var processorActionFormatter = function (row, cell, value, columnDef, dataContext) { var markup = ''; @@ -404,7 +404,7 @@ markup += '
    '; } - if (common.SUPPORTS_SVG) { + if (nfCommon.SUPPORTS_SVG) { markup += '
    '; } @@ -479,7 +479,7 @@ if (target.hasClass('go-to')) { goTo(item.groupId, item.id); } else if (target.hasClass('show-processor-status-history')) { - statusHistory.showProcessorChart(item.groupId, item.id); + nfStatusHistory.showProcessorChart(item.groupId, item.id); } else if (target.hasClass('show-cluster-processor-summary')) { // load the cluster processor summary loadClusterProcessorSummary(item.groupId, item.id); @@ -495,7 +495,7 @@ } } else if (processorsGrid.getColumns()[args.cell].id === 'moreDetails') { if (target.hasClass('show-processor-details')) { - processorDetails.showDetails(item.groupId, item.id); + nfProcessorDetails.showDetails(item.groupId, item.id); } } }); @@ -507,7 +507,7 @@ // update the total number of displayed processors if necessary if ($('#processor-summary-table').is(':visible')) { - $('#displayed-items').text(common.formatInteger(args.current)); + $('#displayed-items').text(nfCommon.formatInteger(args.current)); } }); processorsData.onRowsChanged.subscribe(function (e, args) { @@ -525,12 +525,12 @@ var item = processorsData.getItemById(processorId); // format the tooltip - var bulletins = common.getFormattedBulletins(item.bulletins); - var tooltip = common.formatUnorderedList(bulletins); + var bulletins = nfCommon.getFormattedBulletins(item.bulletins); + var tooltip = nfCommon.formatUnorderedList(bulletins); // show the tooltip - if (common.isDefinedAndNotNull(tooltip)) { - bulletinIcon.qtip($.extend({}, common.config.tooltipConfig, { + if (nfCommon.isDefinedAndNotNull(tooltip)) { + bulletinIcon.qtip($.extend({}, nfCommon.config.tooltipConfig, { content: tooltip, position: { container: $('#summary'), @@ -646,11 +646,11 @@ var backpressureFormatter = function (row, cell, value, columnDef, dataContext) { var percentUseCount = 'NA'; - if (common.isDefinedAndNotNull(dataContext.percentUseCount)) { + if (nfCommon.isDefinedAndNotNull(dataContext.percentUseCount)) { percentUseCount = dataContext.percentUseCount + '%'; } var percentUseBytes = 'NA'; - if (common.isDefinedAndNotNull(dataContext.percentUseBytes)) { + if (nfCommon.isDefinedAndNotNull(dataContext.percentUseBytes)) { percentUseBytes = dataContext.percentUseBytes + '%'; } return percentUseCount + ' / ' + percentUseBytes; @@ -704,7 +704,7 @@ ]; // add an action column if appropriate - if (isClustered || isInShell || common.SUPPORTS_SVG) { + if (isClustered || isInShell || nfCommon.SUPPORTS_SVG) { // define how the column is formatted var connectionActionFormatter = function (row, cell, value, columnDef, dataContext) { var markup = ''; @@ -713,7 +713,7 @@ markup += '
    '; } - if (common.SUPPORTS_SVG) { + if (nfCommon.SUPPORTS_SVG) { markup += '
    '; } @@ -788,7 +788,7 @@ if (target.hasClass('go-to')) { goTo(item.groupId, item.id); } else if (target.hasClass('show-connection-status-history')) { - statusHistory.showConnectionChart(item.groupId, item.id); + nfStatusHistory.showConnectionChart(item.groupId, item.id); } else if (target.hasClass('show-cluster-connection-summary')) { // load the cluster processor summary loadClusterConnectionSummary(item.groupId, item.id); @@ -804,7 +804,7 @@ } } else if (connectionsGrid.getColumns()[args.cell].id === 'moreDetails') { if (target.hasClass('show-connection-details')) { - connectionDetails.showDetails(item.groupId, item.id); + nfConnectionDetails.showDetails(item.groupId, item.id); } } }); @@ -816,7 +816,7 @@ // update the total number of displayed processors, if necessary if ($('#connection-summary-table').is(':visible')) { - $('#displayed-items').text(common.formatInteger(args.current)); + $('#displayed-items').text(nfCommon.formatInteger(args.current)); } }); connectionsData.onRowsChanged.subscribe(function (e, args) { @@ -924,8 +924,8 @@ var markup = ''; // if there are bulletins, render them on the graph - if (!common.isEmpty(dataContext.bulletins)) { - markup += '
    '; + if (!nfCommon.isEmpty(dataContext.bulletins)) { + markup += '
    '; } return markup; @@ -983,7 +983,7 @@ ]; // add an action column if appropriate - if (isClustered || isInShell || common.SUPPORTS_SVG) { + if (isClustered || isInShell || nfCommon.SUPPORTS_SVG) { // define how the column is formatted var processGroupActionFormatter = function (row, cell, value, columnDef, dataContext) { var markup = ''; @@ -992,7 +992,7 @@ markup += '
    '; } - if (common.SUPPORTS_SVG) { + if (nfCommon.SUPPORTS_SVG) { markup += '
    '; } @@ -1065,12 +1065,12 @@ // determine the desired action if (processGroupsGrid.getColumns()[args.cell].id === 'actions') { if (target.hasClass('go-to')) { - if (common.isDefinedAndNotNull(parent.nf) && common.isDefinedAndNotNull(parent.nf.ProcessGroup) && common.isDefinedAndNotNull(parent.nf.Shell)) { + if (nfCommon.isDefinedAndNotNull(parent.nf) && nfCommon.isDefinedAndNotNull(parent.nf.ProcessGroup) && nfCommon.isDefinedAndNotNull(parent.nf.Shell)) { parent.nf.ProcessGroup.enterGroup(item.id); parent.$('#shell-close-button').click(); } } else if (target.hasClass('show-process-group-status-history')) { - statusHistory.showProcessGroupChart(item.groupId, item.id); + nfStatusHistory.showProcessGroupChart(item.groupId, item.id); } else if (target.hasClass('show-cluster-process-group-summary')) { // load the cluster processor summary loadClusterProcessGroupSummary(item.id); @@ -1094,7 +1094,7 @@ // update the total number of displayed process groups if necessary if ($('#process-group-summary-table').is(':visible')) { - $('#displayed-items').text(common.formatInteger(args.current)); + $('#displayed-items').text(nfCommon.formatInteger(args.current)); } }); processGroupsData.onRowsChanged.subscribe(function (e, args) { @@ -1112,12 +1112,12 @@ var item = processGroupsData.getItemById(processGroupId); // format the tooltip - var bulletins = common.getFormattedBulletins(item.bulletins); - var tooltip = common.formatUnorderedList(bulletins); + var bulletins = nfCommon.getFormattedBulletins(item.bulletins); + var tooltip = nfCommon.formatUnorderedList(bulletins); // show the tooltip - if (common.isDefinedAndNotNull(tooltip)) { - bulletinIcon.qtip($.extend({}, common.config.tooltipConfig, { + if (nfCommon.isDefinedAndNotNull(tooltip)) { + bulletinIcon.qtip($.extend({}, nfCommon.config.tooltipConfig, { content: tooltip, position: { container: $('#summary'), @@ -1338,7 +1338,7 @@ // update the total number of displayed processors, if necessary if ($('#input-port-summary-table').is(':visible')) { - $('#display-items').text(common.formatInteger(args.current)); + $('#display-items').text(nfCommon.formatInteger(args.current)); } }); inputPortsData.onRowsChanged.subscribe(function (e, args) { @@ -1356,12 +1356,12 @@ var item = inputPortsData.getItemById(portId); // format the tooltip - var bulletins = common.getFormattedBulletins(item.bulletins); - var tooltip = common.formatUnorderedList(bulletins); + var bulletins = nfCommon.getFormattedBulletins(item.bulletins); + var tooltip = nfCommon.formatUnorderedList(bulletins); // show the tooltip - if (common.isDefinedAndNotNull(tooltip)) { - bulletinIcon.qtip($.extend({}, common.config.tooltipConfig, { + if (nfCommon.isDefinedAndNotNull(tooltip)) { + bulletinIcon.qtip($.extend({}, nfCommon.config.tooltipConfig, { content: tooltip, position: { container: $('#summary'), @@ -1578,7 +1578,7 @@ // update the total number of displayed processors, if necessary if ($('#output-port-summary-table').is(':visible')) { - $('#display-items').text(common.formatInteger(args.current)); + $('#display-items').text(nfCommon.formatInteger(args.current)); } }); outputPortsData.onRowsChanged.subscribe(function (e, args) { @@ -1596,12 +1596,12 @@ var item = outputPortsData.getItemById(portId); // format the tooltip - var bulletins = common.getFormattedBulletins(item.bulletins); - var tooltip = common.formatUnorderedList(bulletins); + var bulletins = nfCommon.getFormattedBulletins(item.bulletins); + var tooltip = nfCommon.formatUnorderedList(bulletins); // show the tooltip - if (common.isDefinedAndNotNull(tooltip)) { - bulletinIcon.qtip($.extend({}, common.config.tooltipConfig, { + if (nfCommon.isDefinedAndNotNull(tooltip)) { + bulletinIcon.qtip($.extend({}, nfCommon.config.tooltipConfig, { content: tooltip, position: { container: $('#summary'), @@ -1710,7 +1710,7 @@ // define a custom formatter for the run status column var transmissionStatusFormatter = function (row, cell, value, columnDef, dataContext) { var activeThreadCount = ''; - if (common.isDefinedAndNotNull(dataContext.activeThreadCount) && dataContext.activeThreadCount > 0) { + if (nfCommon.isDefinedAndNotNull(dataContext.activeThreadCount) && dataContext.activeThreadCount > 0) { activeThreadCount = '(' + dataContext.activeThreadCount + ')'; } @@ -1727,7 +1727,7 @@ // generate the mark up var formattedValue = '
    '; - return formattedValue + '
    ' + transmissionLabel + '
    ' + common.escapeHtml(activeThreadCount) + '
    '; + return formattedValue + '
    ' + transmissionLabel + '
    ' + nfCommon.escapeHtml(activeThreadCount) + '
    '; }; var transmissionStatusColumn = { @@ -1767,7 +1767,7 @@ ]; // add an action column if appropriate - if (isClustered || isInShell || common.SUPPORTS_SVG) { + if (isClustered || isInShell || nfCommon.SUPPORTS_SVG) { // define how the column is formatted var remoteProcessGroupActionFormatter = function (row, cell, value, columnDef, dataContext) { var markup = ''; @@ -1776,7 +1776,7 @@ markup += '
    '; } - if (common.SUPPORTS_SVG) { + if (nfCommon.SUPPORTS_SVG) { markup += '
    '; } @@ -1851,7 +1851,7 @@ if (target.hasClass('go-to')) { goTo(item.groupId, item.id); } else if (target.hasClass('show-remote-process-group-status-history')) { - statusHistory.showRemoteProcessGroupChart(item.groupId, item.id); + nfStatusHistory.showRemoteProcessGroupChart(item.groupId, item.id); } else if (target.hasClass('show-cluster-remote-process-group-summary')) { // load the cluster processor summary loadClusterRemoteProcessGroupSummary(item.groupId, item.id); @@ -1875,7 +1875,7 @@ // update the total number of displayed processors, if necessary if ($('#remote-process-group-summary-table').is(':visible')) { - $('#displayed-items').text(common.formatInteger(args.current)); + $('#displayed-items').text(nfCommon.formatInteger(args.current)); } }); remoteProcessGroupsData.onRowsChanged.subscribe(function (e, args) { @@ -1893,12 +1893,12 @@ var item = remoteProcessGroupsData.getItemById(remoteProcessGroupId); // format the tooltip - var bulletins = common.getFormattedBulletins(item.bulletins); - var tooltip = common.formatUnorderedList(bulletins); + var bulletins = nfCommon.getFormattedBulletins(item.bulletins); + var tooltip = nfCommon.formatUnorderedList(bulletins); // show the tooltip - if (common.isDefinedAndNotNull(tooltip)) { - bulletinIcon.qtip($.extend({}, common.config.tooltipConfig, { + if (nfCommon.isDefinedAndNotNull(tooltip)) { + bulletinIcon.qtip($.extend({}, nfCommon.config.tooltipConfig, { content: tooltip, position: { container: $('#summary'), @@ -2056,7 +2056,7 @@ $('#summary-loading-container').show(); }, open: function () { - common.toggleScrollable($('#' + this.find('.tab-container').attr('id') + '-content').get(0)); + nfCommon.toggleScrollable($('#' + this.find('.tab-container').attr('id') + '-content').get(0)); } } }); @@ -2081,7 +2081,7 @@ */ var sort = function (tableId, sortDetails, data) { // ensure there is a state object for this table - if (common.isUndefined(sortState[tableId])) { + if (nfCommon.isUndefined(sortState[tableId])) { sortState[tableId] = {}; } @@ -2089,17 +2089,17 @@ var comparer = function (a, b) { if (sortDetails.columnId === 'moreDetails') { var aBulletins = 0; - if (!common.isEmpty(a.bulletins)) { + if (!nfCommon.isEmpty(a.bulletins)) { aBulletins = a.bulletins.length; } var bBulletins = 0; - if (!common.isEmpty(b.bulletins)) { + if (!nfCommon.isEmpty(b.bulletins)) { bBulletins = b.bulletins.length; } return aBulletins - bBulletins; } else if (sortDetails.columnId === 'runStatus' || sortDetails.columnId === 'transmissionStatus') { - 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.activeThreadCount - b.activeThreadCount; } else { @@ -2109,26 +2109,26 @@ var mod = sortState[tableId].count % 4; if (mod < 2) { $('#' + tableId + ' span.queued-title').addClass('sorted'); - var aQueueCount = common.parseCount(a['queuedCount']); - var bQueueCount = common.parseCount(b['queuedCount']); + var aQueueCount = nfCommon.parseCount(a['queuedCount']); + var bQueueCount = nfCommon.parseCount(b['queuedCount']); return aQueueCount - bQueueCount; } else { $('#' + tableId + ' span.queued-size-title').addClass('sorted'); - var aQueueSize = common.parseSize(a['queuedSize']); - var bQueueSize = common.parseSize(b['queuedSize']); + var aQueueSize = nfCommon.parseSize(a['queuedSize']); + var bQueueSize = nfCommon.parseSize(b['queuedSize']); return aQueueSize - bQueueSize; } } else if (sortDetails.columnId === 'backpressure') { var mod = sortState[tableId].count % 4; if (mod < 2) { $('#' + tableId + ' span.backpressure-object-title').addClass('sorted'); - var aPercentUseObject = common.isDefinedAndNotNull(a['percentUseCount']) ? a['percentUseCount'] : -1; - var bPercentUseObject = common.isDefinedAndNotNull(b['percentUseCount']) ? b['percentUseCount'] : -1; + var aPercentUseObject = nfCommon.isDefinedAndNotNull(a['percentUseCount']) ? a['percentUseCount'] : -1; + var bPercentUseObject = nfCommon.isDefinedAndNotNull(b['percentUseCount']) ? b['percentUseCount'] : -1; return aPercentUseObject - bPercentUseObject; } else { $('#' + tableId + ' span.backpressure-data-size-title').addClass('sorted'); - var aPercentUseDataSize = common.isDefinedAndNotNull(a['percentUseBytes']) ? a['percentUseBytes'] : -1; - var bPercentUseDataSize = common.isDefinedAndNotNull(b['percentUseBytes']) ? b['percentUseBytes'] : -1; + var aPercentUseDataSize = nfCommon.isDefinedAndNotNull(a['percentUseBytes']) ? a['percentUseBytes'] : -1; + var bPercentUseDataSize = nfCommon.isDefinedAndNotNull(b['percentUseBytes']) ? b['percentUseBytes'] : -1; return aPercentUseDataSize - bPercentUseDataSize; } } else if (sortDetails.columnId === 'sent' || sortDetails.columnId === 'received' || sortDetails.columnId === 'input' || sortDetails.columnId === 'output' || sortDetails.columnId === 'transferred') { @@ -2137,44 +2137,44 @@ var mod = sortState[tableId].count % 4; if (mod < 2) { $('#' + tableId + ' span.' + sortDetails.columnId + '-title').addClass('sorted'); - var aCount = common.parseCount(aSplit[0]); - var bCount = common.parseCount(bSplit[0]); + var aCount = nfCommon.parseCount(aSplit[0]); + var bCount = nfCommon.parseCount(bSplit[0]); return aCount - bCount; } else { $('#' + tableId + ' span.' + sortDetails.columnId + '-size-title').addClass('sorted'); - var aSize = common.parseSize(aSplit[1]); - var bSize = common.parseSize(bSplit[1]); + var aSize = nfCommon.parseSize(aSplit[1]); + var bSize = nfCommon.parseSize(bSplit[1]); return aSize - bSize; } } else if (sortDetails.columnId === 'io') { var mod = sortState[tableId].count % 4; if (mod < 2) { $('#' + tableId + ' span.read-title').addClass('sorted'); - var aReadSize = common.parseSize(a['read']); - var bReadSize = common.parseSize(b['read']); + var aReadSize = nfCommon.parseSize(a['read']); + var bReadSize = nfCommon.parseSize(b['read']); return aReadSize - bReadSize; } else { $('#' + tableId + ' span.written-title').addClass('sorted'); - var aWriteSize = common.parseSize(a['written']); - var bWriteSize = common.parseSize(b['written']); + var aWriteSize = nfCommon.parseSize(a['written']); + var bWriteSize = nfCommon.parseSize(b['written']); return aWriteSize - bWriteSize; } } else if (sortDetails.columnId === 'tasks') { var mod = sortState[tableId].count % 4; if (mod < 2) { $('#' + tableId + ' span.tasks-title').addClass('sorted'); - var aTasks = common.parseCount(a['tasks']); - var bTasks = common.parseCount(b['tasks']); + var aTasks = nfCommon.parseCount(a['tasks']); + var bTasks = nfCommon.parseCount(b['tasks']); return aTasks - bTasks; } else { $('#' + tableId + ' span.time-title').addClass('sorted'); - var aDuration = common.parseDuration(a['tasksDuration']); - var bDuration = common.parseDuration(b['tasksDuration']); + var aDuration = nfCommon.parseDuration(a['tasksDuration']); + var bDuration = nfCommon.parseDuration(b['tasksDuration']); return aDuration - bDuration; } } 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] : ''; return aString === bString ? 0 : aString > bString ? 1 : -1; } }; @@ -2244,7 +2244,7 @@ // add the parameter if appropriate var parameters = {}; - if (!common.isNull(clusterNodeId)) { + if (!nfCommon.isNull(clusterNodeId)) { parameters['clusterNodeId'] = clusterNodeId; } @@ -2268,7 +2268,7 @@ $('#free-heap').text(aggregateSnapshot.freeHeap); // ensure the heap utilization could be calculated - if (common.isDefinedAndNotNull(aggregateSnapshot.heapUtilization)) { + if (nfCommon.isDefinedAndNotNull(aggregateSnapshot.heapUtilization)) { $('#utilization-heap').text('(' + aggregateSnapshot.heapUtilization + ')'); } else { $('#utilization-heap').text(''); @@ -2281,7 +2281,7 @@ $('#free-non-heap').text(aggregateSnapshot.freeNonHeap); // enure the non heap utilization could be calculated - if (common.isDefinedAndNotNull(aggregateSnapshot.nonHeapUtilization)) { + if (nfCommon.isDefinedAndNotNull(aggregateSnapshot.nonHeapUtilization)) { $('#utilization-non-heap').text('(' + aggregateSnapshot.nonHeapUtilization + ')'); } else { $('#utilization-non-heap').text(''); @@ -2289,7 +2289,7 @@ // garbage collection var garbageCollectionContainer = $('#garbage-collection-table tbody').empty(); - if (common.isDefinedAndNotNull(aggregateSnapshot.garbageCollection)) { + if (nfCommon.isDefinedAndNotNull(aggregateSnapshot.garbageCollection)) { // sort the garbage collections var sortedGarbageCollection = aggregateSnapshot.garbageCollection.sort(function (a, b) { return a.name === b.name ? 0 : a.name > b.name ? 1 : -1; @@ -2307,10 +2307,10 @@ $('#available-processors').text(aggregateSnapshot.availableProcessors); // load - if (common.isDefinedAndNotNull(aggregateSnapshot.processorLoadAverage)) { - $('#processor-load-average').text(common.formatFloat(aggregateSnapshot.processorLoadAverage)); + if (nfCommon.isDefinedAndNotNull(aggregateSnapshot.processorLoadAverage)) { + $('#processor-load-average').text(nfCommon.formatFloat(aggregateSnapshot.processorLoadAverage)); } else { - $('#processor-load-average').html(common.formatValue(aggregateSnapshot.processorLoadAverage)); + $('#processor-load-average').html(nfCommon.formatValue(aggregateSnapshot.processorLoadAverage)); } // flow file storage usage @@ -2319,7 +2319,7 @@ // content repo storage usage var contentRepositoryUsageContainer = $('#content-repository-storage-usage-container').empty(); - if (common.isDefinedAndNotNull(aggregateSnapshot.contentRepositoryStorageUsage)) { + if (nfCommon.isDefinedAndNotNull(aggregateSnapshot.contentRepositoryStorageUsage)) { // sort the content repos var sortedContentRepositoryStorageUsage = aggregateSnapshot.contentRepositoryStorageUsage.sort(function (a, b) { return a.identifier === b.identifier ? 0 : a.identifier > b.identifier ? 1 : -1; @@ -2354,7 +2354,7 @@ // update the stats last refreshed timestamp $('#system-diagnostics-last-refreshed').text(aggregateSnapshot.statsLastRefreshed); - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); }; /** @@ -2383,12 +2383,12 @@ var storage = $('
    '); storage.text('Usage:'); - if (common.isDefinedAndNotNull(storageUsage.identifier)) { + if (nfCommon.isDefinedAndNotNull(storageUsage.identifier)) { storage.text('Usage for ' + storageUsage.identifier + ':'); } storage.appendTo(storageUsageContainer); - (angularBridge.injector.get('$compile')($(''))(angularBridge.rootScope)).appendTo(storageUsageContainer); + (nfNgBridge.injector.get('$compile')($(''))(nfNgBridge.rootScope)).appendTo(storageUsageContainer); var usageDetails = $('
    ').text(' (' + storageUsage.usedSpace + ' of ' + storageUsage.totalSpace + ')').prepend($('').text(Math.round((used / total) * 100) + '%')); $('
    ').append(usageDetails).append('
    ').appendTo(storageUsageContainer); @@ -2469,7 +2469,7 @@ } // ensure the grid has been initialized - if (common.isDefinedAndNotNull(grid)) { + if (nfCommon.isDefinedAndNotNull(grid)) { var data = grid.getData(); // update the search criteria @@ -2497,7 +2497,7 @@ }, dataType: 'json' }).done(function (response) { - if (common.isDefinedAndNotNull(response.processorStatus)) { + if (nfCommon.isDefinedAndNotNull(response.processorStatus)) { var processorStatus = response.processorStatus; var clusterProcessorsGrid = $('#cluster-processor-summary-table').data('gridInstance'); @@ -2536,7 +2536,7 @@ // update the stats last refreshed timestamp $('#cluster-processor-summary-last-refreshed').text(processorStatus.statsLastRefreshed); } - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); }; /** @@ -2555,7 +2555,7 @@ }, dataType: 'json' }).done(function (response) { - if (common.isDefinedAndNotNull(response.connectionStatus)) { + if (nfCommon.isDefinedAndNotNull(response.connectionStatus)) { var connectionStatus = response.connectionStatus; var clusterConnectionsGrid = $('#cluster-connection-summary-table').data('gridInstance'); @@ -2593,7 +2593,7 @@ // update the stats last refreshed timestamp $('#cluster-connection-summary-last-refreshed').text(connectionStatus.statsLastRefreshed); } - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); }; /** @@ -2612,7 +2612,7 @@ }, dataType: 'json' }).done(function (response) { - if (common.isDefinedAndNotNull(response.processGroupStatus)) { + if (nfCommon.isDefinedAndNotNull(response.processGroupStatus)) { var processGroupStatus = response.processGroupStatus; var clusterProcessGroupsGrid = $('#cluster-process-group-summary-table').data('gridInstance'); @@ -2653,7 +2653,7 @@ // update the stats last refreshed timestamp $('#cluster-process-group-summary-last-refreshed').text(processGroupStatus.statsLastRefreshed); } - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); }; /** @@ -2672,7 +2672,7 @@ }, dataType: 'json' }).done(function (response) { - if (common.isDefinedAndNotNull(response.portStatus)) { + if (nfCommon.isDefinedAndNotNull(response.portStatus)) { var inputPortStatus = response.portStatus; var clusterInputPortsGrid = $('#cluster-input-port-summary-table').data('gridInstance'); @@ -2706,7 +2706,7 @@ // update the stats last refreshed timestamp $('#cluster-input-port-summary-last-refreshed').text(inputPortStatus.statsLastRefreshed); } - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); }; /** @@ -2725,7 +2725,7 @@ }, dataType: 'json' }).done(function (response) { - if (common.isDefinedAndNotNull(response.portStatus)) { + if (nfCommon.isDefinedAndNotNull(response.portStatus)) { var outputPortStatus = response.portStatus; var clusterOutputPortsGrid = $('#cluster-output-port-summary-table').data('gridInstance'); @@ -2759,7 +2759,7 @@ // update the stats last refreshed timestamp $('#cluster-output-port-summary-last-refreshed').text(outputPortStatus.statsLastRefreshed); } - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); }; /** @@ -2778,7 +2778,7 @@ }, dataType: 'json' }).done(function (response) { - if (common.isDefinedAndNotNull(response.remoteProcessGroupStatus)) { + if (nfCommon.isDefinedAndNotNull(response.remoteProcessGroupStatus)) { var remoteProcessGroupStatus = response.remoteProcessGroupStatus; var clusterRemoteProcessGroupsGrid = $('#cluster-remote-process-group-summary-table').data('gridInstance'); @@ -2814,7 +2814,7 @@ // update the stats last refreshed timestamp $('#cluster-remote-process-group-summary-last-refreshed').text(remoteProcessGroupStatus.statsLastRefreshed); } - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); }; var clusterNodeId = null; @@ -2837,11 +2837,11 @@ var configDetails = configResponse.flowConfiguration; // initialize the chart - statusHistory.init(configDetails.timeOffset); + nfStatusHistory.init(configDetails.timeOffset); // initialize the processor/connection details dialog - processorDetails.init(false); - connectionDetails.init(); + nfProcessorDetails.init(false); + nfConnectionDetails.init(); initSummaryTable(isClustered); deferred.resolve(); @@ -2867,7 +2867,7 @@ var processorsTable = $('#processor-summary-table'); if (processorsTable.is(':visible')) { var processorsGrid = processorsTable.data('gridInstance'); - if (common.isDefinedAndNotNull(processorsGrid)) { + if (nfCommon.isDefinedAndNotNull(processorsGrid)) { processorsGrid.resizeCanvas(); } } @@ -2875,7 +2875,7 @@ var connectionsTable = $('#connection-summary-table'); if (connectionsTable.is(':visible')) { var connectionsGrid = connectionsTable.data('gridInstance'); - if (common.isDefinedAndNotNull(connectionsGrid)) { + if (nfCommon.isDefinedAndNotNull(connectionsGrid)) { connectionsGrid.resizeCanvas(); } } @@ -2883,7 +2883,7 @@ var processGroupsTable = $('#process-group-summary-table'); if (processGroupsTable.is(':visible')) { var processGroupsGrid = processGroupsTable.data('gridInstance'); - if (common.isDefinedAndNotNull(processGroupsGrid)) { + if (nfCommon.isDefinedAndNotNull(processGroupsGrid)) { processGroupsGrid.resizeCanvas(); } } @@ -2891,7 +2891,7 @@ var inputPortsTable = $('#input-port-summary-table'); if (inputPortsTable.is(':visible')) { var inputPortGrid = inputPortsTable.data('gridInstance'); - if (common.isDefinedAndNotNull(inputPortGrid)) { + if (nfCommon.isDefinedAndNotNull(inputPortGrid)) { inputPortGrid.resizeCanvas(); } } @@ -2899,7 +2899,7 @@ var outputPortsTable = $('#output-port-summary-table'); if (outputPortsTable.is(':visible')) { var outputPortGrid = outputPortsTable.data('gridInstance'); - if (common.isDefinedAndNotNull(outputPortGrid)) { + if (nfCommon.isDefinedAndNotNull(outputPortGrid)) { outputPortGrid.resizeCanvas(); } } @@ -2907,7 +2907,7 @@ var remoteProcessGroupsTable = $('#remote-process-group-summary-table'); if (remoteProcessGroupsTable.is(':visible')) { var remoteProcessGroupGrid = remoteProcessGroupsTable.data('gridInstance'); - if (common.isDefinedAndNotNull(remoteProcessGroupGrid)) { + if (nfCommon.isDefinedAndNotNull(remoteProcessGroupGrid)) { remoteProcessGroupGrid.resizeCanvas(); } } @@ -2921,7 +2921,7 @@ // add the parameter if appropriate var parameters = {}; - if (!common.isNull(clusterNodeId)) { + if (!nfCommon.isNull(clusterNodeId)) { parameters['clusterNodeId'] = clusterNodeId; } @@ -2941,10 +2941,10 @@ var processGroupStatus = response.processGroupStatus; var aggregateSnapshot = processGroupStatus.aggregateSnapshot; - if (common.isDefinedAndNotNull(aggregateSnapshot)) { + if (nfCommon.isDefinedAndNotNull(aggregateSnapshot)) { // remove any tooltips from the processor table var processorsGridElement = $('#processor-summary-table'); - common.cleanUpTooltips(processorsGridElement, 'div.has-bulletins'); + nfCommon.cleanUpTooltips(processorsGridElement, 'div.has-bulletins'); // get the processor grid/data var processorsGrid = processorsGridElement.data('gridInstance'); @@ -2956,7 +2956,7 @@ // remove any tooltips from the process group table var processGroupGridElement = $('#process-group-summary-table'); - common.cleanUpTooltips(processGroupGridElement, 'div.has-bulletins'); + nfCommon.cleanUpTooltips(processGroupGridElement, 'div.has-bulletins'); // get the process group grid/data var processGroupGrid = processGroupGridElement.data('gridInstance'); @@ -2964,7 +2964,7 @@ // remove any tooltips from the input port table var inputPortsGridElement = $('#input-port-summary-table'); - common.cleanUpTooltips(inputPortsGridElement, 'div.has-bulletins'); + nfCommon.cleanUpTooltips(inputPortsGridElement, 'div.has-bulletins'); // get the input ports grid/data var inputPortsGrid = inputPortsGridElement.data('gridInstance'); @@ -2972,7 +2972,7 @@ // remove any tooltips from the output port table var outputPortsGridElement = $('#output-port-summary-table'); - common.cleanUpTooltips(outputPortsGridElement, 'div.has-bulletins'); + nfCommon.cleanUpTooltips(outputPortsGridElement, 'div.has-bulletins'); // get the output ports grid/data var outputPortsGrid = outputPortsGridElement.data('gridInstance'); @@ -2980,7 +2980,7 @@ // remove any tooltips from the remote process group table var remoteProcessGroupsGridElement = $('#remote-process-group-summary-table'); - common.cleanUpTooltips(remoteProcessGroupsGridElement, 'div.has-bulletins'); + nfCommon.cleanUpTooltips(remoteProcessGroupsGridElement, 'div.has-bulletins'); // get the remote process groups grid var remoteProcessGroupsGrid = remoteProcessGroupsGridElement.data('gridInstance'); @@ -3031,22 +3031,22 @@ // update the total number of processors if ($('#processor-summary-table').is(':visible')) { - $('#total-items').text(common.formatInteger(processorItems.length)); + $('#total-items').text(nfCommon.formatInteger(processorItems.length)); } else if ($('#connection-summary-table').is(':visible')) { - $('#total-items').text(common.formatInteger(connectionItems.length)); + $('#total-items').text(nfCommon.formatInteger(connectionItems.length)); } else if ($('#input-port-summary-table').is(':visible')) { - $('#total-items').text(common.formatInteger(inputPortItems.length)); + $('#total-items').text(nfCommon.formatInteger(inputPortItems.length)); } else if ($('#output-port-summary-table').is(':visible')) { - $('#total-items').text(common.formatInteger(outputPortItems.length)); + $('#total-items').text(nfCommon.formatInteger(outputPortItems.length)); } else if ($('#process-group-summary-table').is(':visible')) { - $('#total-items').text(common.formatInteger(processGroupItems.length)); + $('#total-items').text(nfCommon.formatInteger(processGroupItems.length)); } else { - $('#total-items').text(common.formatInteger(remoteProcessGroupItems.length)); + $('#total-items').text(nfCommon.formatInteger(remoteProcessGroupItems.length)); } } else { $('#total-items').text('0'); } - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); } }; })); \ No newline at end of file diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-summary.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-summary.js index f8686634dc..1726f2127f 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-summary.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-summary.js @@ -33,30 +33,30 @@ 'nf.SummaryTable'], function ($, angular, - common, - clusterSummary, - clusterSearch, + nfCommon, + nfClusterSummary, + nfClusterSearch, appConfig, appCtrl, serviceProvider, provenanceTable, - angularBridge, - errorHandler, - storage, - summaryTable) { + nfNgBridge, + nfErrorHandler, + nfStorage, + nfSummaryTable) { return (nf.Summary = factory($, angular, - common, - clusterSummary, - clusterSearch, + nfCommon, + nfClusterSummary, + nfClusterSearch, appConfig, appCtrl, serviceProvider, - angularBridge, - errorHandler, - storage, - summaryTable)); + nfNgBridge, + nfErrorHandler, + nfStorage, + nfSummaryTable)); }); } else if (typeof exports === 'object' && typeof module === 'object') { module.exports = (nf.Summary = @@ -86,7 +86,7 @@ root.nf.Storage, root.nf.SummaryTable); } -}(this, function ($, angular, common, clusterSummary, clusterSearch, appConfig, appCtrl, serviceProvider, angularBridge, errorHandler, storage, summaryTable) { +}(this, function ($, angular, nfCommon, nfClusterSummary, nfClusterSearch, appConfig, appCtrl, serviceProvider, nfNgBridge, nfErrorHandler, nfStorage, nfSummaryTable) { 'use strict'; $(document).ready(function () { @@ -108,10 +108,10 @@ app.service('serviceProvider', serviceProvider); //Manually Boostrap Angular App - angularBridge.injector = angular.bootstrap($('body'), ['ngSummaryApp'], {strictDi: true}); + nfNgBridge.injector = angular.bootstrap($('body'), ['ngSummaryApp'], {strictDi: true}); // initialize the summary page - clusterSummary.loadClusterSummary().done(function () { + nfClusterSummary.loadClusterSummary().done(function () { nfSummary.init(); }); }); @@ -136,16 +136,16 @@ type: 'GET', url: config.urls.clusterSummary }).done(function (response) { - summaryTable.init(response.clusterSummary.connectedToCluster).done(function () { + nfSummaryTable.init(response.clusterSummary.connectedToCluster).done(function () { // initialize the search field if applicable if (response.clusterSummary.connectedToCluster) { - clusterSearch.init(); + nfClusterSearch.init(); } deferred.resolve(); }).fail(function () { deferred.reject(); }); - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); }).promise(); }; @@ -155,8 +155,8 @@ var initializeSummaryPage = function () { // define mouse over event for the refresh buttons $('#refresh-button').click(function () { - clusterSummary.loadClusterSummary().done(function () { - summaryTable.loadSummaryTable(); + nfClusterSummary.loadClusterSummary().done(function () { + nfSummaryTable.loadSummaryTable(); }); }); @@ -170,8 +170,8 @@ dataType: 'json' }).done(function (response) { // ensure the banners response is specified - if (common.isDefinedAndNotNull(response.banners)) { - if (common.isDefinedAndNotNull(response.banners.headerText) && response.banners.headerText !== '') { + if (nfCommon.isDefinedAndNotNull(response.banners)) { + if (nfCommon.isDefinedAndNotNull(response.banners.headerText) && response.banners.headerText !== '') { // update the header text var bannerHeader = $('#banner-header').text(response.banners.headerText).show(); @@ -185,7 +185,7 @@ updateTop('summary'); } - if (common.isDefinedAndNotNull(response.banners.footerText) && response.banners.footerText !== '') { + if (nfCommon.isDefinedAndNotNull(response.banners.footerText) && response.banners.footerText !== '') { // update the footer text and show it var bannerFooter = $('#banner-footer').text(response.banners.footerText).show(); @@ -201,7 +201,7 @@ deferred.resolve(); }).fail(function (xhr, status, error) { - errorHandler.handleAjaxError(xhr, status, error); + nfErrorHandler.handleAjaxError(xhr, status, error); deferred.reject(); }); } else { @@ -215,12 +215,12 @@ * Initializes the status page. */ init: function () { - storage.init(); + nfStorage.init(); // intialize the summary table initializeSummaryTable().done(function () { // load the table - summaryTable.loadSummaryTable().done(function () { + nfSummaryTable.loadSummaryTable().done(function () { // once the table is initialized, finish initializing the page initializeSummaryPage().done(function () { @@ -241,7 +241,7 @@ }); } - summaryTable.resetTableSize(); + nfSummaryTable.resetTableSize(); }; // get the about details @@ -259,7 +259,7 @@ // set the initial size setBodySize(); - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); $(window).on('resize', function (e) { setBodySize(); @@ -292,7 +292,7 @@ } } $.each(tabsContents, function (index, tabsContent) { - common.toggleScrollable(tabsContent.get(0)); + nfCommon.toggleScrollable(tabsContent.get(0)); }); }); }); diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/templates/nf-templates-table.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/templates/nf-templates-table.js index 65d9ada2d7..8c5e4debfd 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/templates/nf-templates-table.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/templates/nf-templates-table.js @@ -24,8 +24,8 @@ 'nf.Common', 'nf.Dialog', 'nf.ErrorHandler'], - function ($, Slick, common, dialog, errorHandler) { - return (nf.TemplatesTable = factory($, Slick, common, dialog, errorHandler)); + function ($, Slick, nfCommon, nfDialog, nfErrorHandler) { + return (nf.TemplatesTable = factory($, Slick, nfCommon, nfDialog, nfErrorHandler)); }); } else if (typeof exports === 'object' && typeof module === 'object') { module.exports = (nf.TemplatesTable = @@ -41,7 +41,7 @@ root.nf.Dialog, root.nf.ErrorHandler); } -}(this, function ($, Slick, common, dialog, errorHandler) { +}(this, function ($, Slick, nfCommon, nfDialog, nfErrorHandler) { 'use strict'; /** @@ -65,12 +65,12 @@ var comparer = function (a, b) { if (a.permissions.canRead && b.permissions.canRead) { if (sortDetails.columnId === 'timestamp') { - var aDate = common.parseDateTime(a.template[sortDetails.columnId]); - var bDate = common.parseDateTime(b.template[sortDetails.columnId]); + var aDate = nfCommon.parseDateTime(a.template[sortDetails.columnId]); + var bDate = nfCommon.parseDateTime(b.template[sortDetails.columnId]); return aDate.getTime() - bDate.getTime(); } else { - var aString = common.isDefinedAndNotNull(a.template[sortDetails.columnId]) ? a.template[sortDetails.columnId] : ''; - var bString = common.isDefinedAndNotNull(b.template[sortDetails.columnId]) ? b.template[sortDetails.columnId] : ''; + var aString = nfCommon.isDefinedAndNotNull(a.template[sortDetails.columnId]) ? a.template[sortDetails.columnId] : ''; + var bString = nfCommon.isDefinedAndNotNull(b.template[sortDetails.columnId]) ? b.template[sortDetails.columnId] : ''; return aString === bString ? 0 : aString > bString ? 1 : -1; } } else { @@ -96,9 +96,9 @@ */ var promptToDeleteTemplate = function (templateEntity) { // prompt for deletion - dialog.showYesNoDialog({ + nfDialog.showYesNoDialog({ headerText: 'Delete Template', - dialogContent: 'Delete template \'' + common.escapeHtml(templateEntity.template.name) + '\'?', + dialogContent: 'Delete template \'' + nfCommon.escapeHtml(templateEntity.template.name) + '\'?', yesHandler: function () { deleteTemplate(templateEntity); } @@ -114,7 +114,7 @@ // 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.PolicyManagement) && common.isDefinedAndNotNull(parent.nf.Shell)) { + if (nfCommon.isDefinedAndNotNull(parent.nf) && nfCommon.isDefinedAndNotNull(parent.nf.PolicyManagement) && nfCommon.isDefinedAndNotNull(parent.nf.Shell)) { parent.nf.PolicyManagement.showTemplatePolicy(templateEntity); parent.$('#shell-close-button').click(); } @@ -138,7 +138,7 @@ // update the total number of templates $('#total-templates').text(templatesData.getItems().length); - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); }; /** @@ -158,7 +158,7 @@ var templatesGrid = $('#templates-table').data('gridInstance'); // ensure the grid has been initialized - if (common.isDefinedAndNotNull(templatesGrid)) { + if (nfCommon.isDefinedAndNotNull(templatesGrid)) { var templatesData = templatesGrid.getData(); // update the search criteria @@ -200,11 +200,11 @@ * @param {object} templateEntity The template */ var downloadTemplate = function (templateEntity) { - common.getAccessToken(config.urls.downloadToken).done(function (downloadToken) { + nfCommon.getAccessToken(config.urls.downloadToken).done(function (downloadToken) { var parameters = {}; // conditionally include the download token - if (!common.isBlank(downloadToken)) { + if (!nfCommon.isBlank(downloadToken)) { parameters['access_token'] = downloadToken; } @@ -215,7 +215,7 @@ window.open(templateEntity.template.uri + '/download' + '?' + $.param(parameters)); } }).fail(function () { - dialog.showOkDialog({ + nfDialog.showOkDialog({ headerText: 'Download Template', dialogContent: 'Unable to generate access token for downloading content.' }); @@ -267,7 +267,7 @@ return ''; } - return common.formatValue(dataContext.template.description); + return nfCommon.formatValue(dataContext.template.description); }; var groupIdFormatter = function (row, cell, value, columnDef, dataContext) { @@ -292,8 +292,8 @@ } // allow policy configuration conditionally if embedded in - if (top !== window && common.canAccessTenants()) { - if (common.isDefinedAndNotNull(parent.nf) && common.isDefinedAndNotNull(parent.nf.CanvasUtils) && parent.nf.CanvasUtils.isConfigurableAuthorizer()) { + if (top !== window && nfCommon.canAccessTenants()) { + if (nfCommon.isDefinedAndNotNull(parent.nf) && nfCommon.isDefinedAndNotNull(parent.nf.CanvasUtils) && parent.nf.CanvasUtils.isConfigurableAuthorizer()) { markup += '
    '; } } @@ -427,7 +427,7 @@ */ resetTableSize: function () { var templateGrid = $('#templates-table').data('gridInstance'); - if (common.isDefinedAndNotNull(templateGrid)) { + if (nfCommon.isDefinedAndNotNull(templateGrid)) { templateGrid.resizeCanvas(); } }, @@ -442,7 +442,7 @@ dataType: 'json' }).done(function (response) { // ensure there are groups specified - if (common.isDefinedAndNotNull(response.templates)) { + if (nfCommon.isDefinedAndNotNull(response.templates)) { var templatesGrid = $('#templates-table').data('gridInstance'); var templatesData = templatesGrid.getData(); @@ -459,7 +459,7 @@ } else { $('#total-templates').text('0'); } - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); } }; })); \ No newline at end of file diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/templates/nf-templates.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/templates/nf-templates.js index a54e3c2b0f..59f9a7d426 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/templates/nf-templates.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/templates/nf-templates.js @@ -24,8 +24,8 @@ 'nf.TemplatesTable', 'nf.ErrorHandler', 'nf.Storage'], - function ($, common, templatesTable, errorHandler, storage) { - return (nf.Templates = factory($, common, templatesTable, errorHandler, storage)); + function ($, nfCommon, nfTemplatesTable, nfErrorHandler, nfStorage) { + return (nf.Templates = factory($, nfCommon, nfTemplatesTable, nfErrorHandler, nfStorage)); }); } else if (typeof exports === 'object' && typeof module === 'object') { module.exports = (nf.Templates = @@ -41,7 +41,7 @@ root.nf.ErrorHandler, root.nf.Storage); } -}(this, function ($, common, templatesTable, errorHandler, storage) { +}(this, function ($, nfCommon, nfTemplatesTable, nfErrorHandler, nfStorage) { 'use strict'; $(document).ready(function () { @@ -69,8 +69,8 @@ url: config.urls.currentUser, dataType: 'json' }).done(function (currentUser) { - common.setCurrentUser(currentUser); - }).fail(errorHandler.handleAjaxError); + nfCommon.setCurrentUser(currentUser); + }).fail(nfErrorHandler.handleAjaxError); }; /** @@ -79,7 +79,7 @@ var initializeTemplatesPage = function () { // define mouse over event for the refresh button $('#refresh-button').click(function () { - templatesTable.loadTemplatesTable(); + nfTemplatesTable.loadTemplatesTable(); }); // get the banners if we're not in the shell @@ -91,8 +91,8 @@ dataType: 'json' }).done(function (response) { // ensure the banners response is specified - if (common.isDefinedAndNotNull(response.banners)) { - if (common.isDefinedAndNotNull(response.banners.headerText) && response.banners.headerText !== '') { + if (nfCommon.isDefinedAndNotNull(response.banners)) { + if (nfCommon.isDefinedAndNotNull(response.banners.headerText) && response.banners.headerText !== '') { // update the header text var bannerHeader = $('#banner-header').text(response.banners.headerText).show(); @@ -106,7 +106,7 @@ updateTop('templates'); } - if (common.isDefinedAndNotNull(response.banners.footerText) && response.banners.footerText !== '') { + if (nfCommon.isDefinedAndNotNull(response.banners.footerText) && response.banners.footerText !== '') { // update the footer text and show it var bannerFooter = $('#banner-footer').text(response.banners.footerText).show(); @@ -122,7 +122,7 @@ deferred.resolve(); }).fail(function (xhr, status, error) { - errorHandler.handleAjaxError(xhr, status, error); + nfErrorHandler.handleAjaxError(xhr, status, error); deferred.reject(); }); } else { @@ -136,16 +136,16 @@ * Initializes the templates page. */ init: function () { - storage.init(); + nfStorage.init(); // load the current user loadCurrentUser().done(function () { // create the templates table - templatesTable.init(); + nfTemplatesTable.init(); // load the table - templatesTable.loadTemplatesTable().done(function () { + nfTemplatesTable.loadTemplatesTable().done(function () { // once the table is initialized, finish initializing the page initializeTemplatesPage().done(function () { var setBodySize = function () { @@ -162,7 +162,7 @@ } // configure the initial grid height - templatesTable.resetTableSize(); + nfTemplatesTable.resetTableSize(); }; // get the about details @@ -180,7 +180,7 @@ // set the initial size setBodySize(); - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); $(window).on('resize', function (e) { setBodySize(); @@ -213,7 +213,7 @@ } } $.each(tabsContents, function (index, tabsContent) { - common.toggleScrollable(tabsContent.get(0)); + nfCommon.toggleScrollable(tabsContent.get(0)); }); }); }); diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/users/nf-users-table.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/users/nf-users-table.js index e2d00b013a..975dd1a1fc 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/users/nf-users-table.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/users/nf-users-table.js @@ -24,8 +24,8 @@ 'nf.Common', 'nf.Client', 'nf.ErrorHandler'], - function ($, Slick, common, client, errorHandler) { - return (nf.UsersTable = factory($, Slick, common, client, errorHandler)); + function ($, Slick, nfCommon, nfClient, nfErrorHandler) { + return (nf.UsersTable = factory($, Slick, nfCommon, nfClient, nfErrorHandler)); }); } else if (typeof exports === 'object' && typeof module === 'object') { module.exports = (nf.UsersTable = @@ -41,7 +41,7 @@ root.nf.Client, root.nf.ErrorHandler); } -}(this, function ($, Slick, common, client, errorHandler) { +}(this, function ($, Slick, nfCommon, nfClient, nfErrorHandler) { 'use strict'; /** @@ -76,11 +76,11 @@ // update the user $.ajax({ type: 'DELETE', - url: user.uri + '?' + $.param(client.getRevision(user)), + url: user.uri + '?' + $.param(nfClient.getRevision(user)), dataType: 'json' }).done(function () { nfUsersTable.loadUsersTable(); - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); // hide the dialog $('#user-delete-dialog').modal('hide'); @@ -169,7 +169,7 @@ // build the request entity var updatedGroupEntity = { - 'revision': client.getRevision(groupEntity), + 'revision': nfClient.getRevision(groupEntity), 'component': $.extend({}, groupEntity.component, { 'users': groupMembers }) @@ -207,7 +207,7 @@ // build the request entity var updatedGroupEntity = { - 'revision': client.getRevision(groupEntity), + 'revision': nfClient.getRevision(groupEntity), 'component': $.extend({}, groupEntity.component, { 'users': groupMembers }) @@ -258,8 +258,8 @@ usersGrid.setSelectedRows([row]); usersGrid.scrollRowIntoView(row); }); - }).fail(errorHandler.handleAjaxError); - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); }; /** @@ -276,7 +276,7 @@ var userEntity = usersData.getItemById(userId); var updatedUserEntity = { - 'revision': client.getRevision(userEntity), + 'revision': nfClient.getRevision(userEntity), 'component': { 'id': userId, 'identity': userIdentity @@ -331,8 +331,8 @@ $.when.apply(window, xhrs).always(function () { nfUsersTable.loadUsersTable(); - }).fail(errorHandler.handleAjaxError); - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); }; /** @@ -359,7 +359,7 @@ usersGrid.setSelectedRows([row]); usersGrid.scrollRowIntoView(row); }); - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); }; var updateGroup = function (groupId, groupIdentity, selectedUsers) { @@ -369,7 +369,7 @@ var groupEntity = usersData.getItemById(groupId); var updatedGroupoEntity = { - 'revision': client.getRevision(groupEntity), + 'revision': nfClient.getRevision(groupEntity), 'component': { 'id': groupId, 'identity': groupIdentity, @@ -386,7 +386,7 @@ contentType: 'application/json' }).done(function (groupEntity) { nfUsersTable.loadUsersTable(); - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); }; /** @@ -410,7 +410,7 @@ // see if we should create or update this user if ($.trim(userId) === '') { var tenantEntity = { - 'revision': client.getRevision({ + 'revision': nfClient.getRevision({ 'revision': { 'version': 0 } @@ -524,7 +524,7 @@ */ var globalResourceParser = function (dataContext) { return 'Global policy to ' + - common.getPolicyTypeListing(common.substringAfterFirst(dataContext.component.resource, '/')).text; + nfCommon.getPolicyTypeListing(nfCommon.substringAfterFirst(dataContext.component.resource, '/')).text; }; /** @@ -539,13 +539,13 @@ //determine policy type if (resource.startsWith('/policies')) { - resource = common.substringAfterFirst(resource, '/policies'); + resource = nfCommon.substringAfterFirst(resource, '/policies'); policyLabel += 'Admin policy for '; } else if (resource.startsWith('/data-transfer')) { - resource = common.substringAfterFirst(resource, '/data-transfer'); + resource = nfCommon.substringAfterFirst(resource, '/data-transfer'); policyLabel += 'Site to site policy for '; } else if (resource.startsWith('/data')) { - resource = common.substringAfterFirst(resource, '/data'); + resource = nfCommon.substringAfterFirst(resource, '/data'); policyLabel += 'Data policy for '; } else { policyLabel += 'Component policy for '; @@ -592,7 +592,7 @@ // if the user has permission to the policy if (dataContext.permissions.canRead === true) { // check if Global policy - if (common.isUndefinedOrNull(dataContext.component.componentReference)) { + if (nfCommon.isUndefinedOrNull(dataContext.component.componentReference)) { return globalResourceParser(dataContext); } // not a global policy... check if user has access to the component reference @@ -607,7 +607,7 @@ var markup = ''; if (dataContext.permissions.canRead === true) { - if (common.isDefinedAndNotNull(dataContext.component.componentReference)) { + if (nfCommon.isDefinedAndNotNull(dataContext.component.componentReference)) { if (dataContext.component.resource.indexOf('/processors') >= 0) { markup += '
    '; } else if (dataContext.component.resource.indexOf('/controller-services') >= 0) { @@ -797,12 +797,12 @@ var markup = ''; // ensure user can modify the user - if (common.canModifyTenants()) { + if (nfCommon.canModifyTenants()) { markup += '
    '; markup += '
    '; } - if (!common.isEmpty(dataContext.component.accessPolicies)) { + if (!nfCommon.isEmpty(dataContext.component.accessPolicies)) { markup += '
    '; } @@ -923,8 +923,8 @@ // defines a function for sorting var comparer = function (a, b) { if (a.permissions.canRead && b.permissions.canRead) { - var aString = common.isDefinedAndNotNull(a.component[sortDetails.columnId]) ? a.component[sortDetails.columnId] : ''; - var bString = common.isDefinedAndNotNull(b.component[sortDetails.columnId]) ? b.component[sortDetails.columnId] : ''; + var aString = nfCommon.isDefinedAndNotNull(a.component[sortDetails.columnId]) ? a.component[sortDetails.columnId] : ''; + var bString = nfCommon.isDefinedAndNotNull(b.component[sortDetails.columnId]) ? b.component[sortDetails.columnId] : ''; return aString === bString ? 0 : aString > bString ? 1 : -1; } else { if (!a.permissions.canRead && !b.permissions.canRead) { @@ -953,8 +953,8 @@ var comparer = function (a, b) { if (a.permissions.canRead && b.permissions.canRead) { if (sortDetails.columnId === 'action') { - var aString = common.isDefinedAndNotNull(a.component[sortDetails.columnId]) ? a.component[sortDetails.columnId] : ''; - var bString = common.isDefinedAndNotNull(b.component[sortDetails.columnId]) ? b.component[sortDetails.columnId] : ''; + var aString = nfCommon.isDefinedAndNotNull(a.component[sortDetails.columnId]) ? a.component[sortDetails.columnId] : ''; + var bString = nfCommon.isDefinedAndNotNull(b.component[sortDetails.columnId]) ? b.component[sortDetails.columnId] : ''; return aString === bString ? 0 : aString > bString ? 1 : -1; } else if (sortDetails.columnId === 'policy') { var aString = ''; @@ -963,7 +963,7 @@ // if the user has permission to the policy if (a.permissions.canRead === true) { // check if Global policy - if (common.isUndefinedOrNull(a.component.componentReference)) { + if (nfCommon.isUndefinedOrNull(a.component.componentReference)) { aString = globalResourceParser(a); } else { // not a global policy... check if user has access to the component reference @@ -976,7 +976,7 @@ // if the user has permission to the policy if (b.permissions.canRead === true) { // check if Global policy - if (common.isUndefinedOrNull(b.component.componentReference)) { + if (nfCommon.isUndefinedOrNull(b.component.componentReference)) { bString = globalResourceParser(b); } else { // not a global policy... check if user has access to the component reference @@ -1021,7 +1021,7 @@ var usersGrid = $('#users-table').data('gridInstance'); // ensure the grid has been initialized - if (common.isDefinedAndNotNull(usersGrid)) { + if (nfCommon.isDefinedAndNotNull(usersGrid)) { var usersData = usersGrid.getData(); // update the search criteria @@ -1195,7 +1195,7 @@ userPoliciesData.beginUpdate(); // set the rows - if (common.isDefinedAndNotNull(user.component.accessPolicies)) { + if (nfCommon.isDefinedAndNotNull(user.component.accessPolicies)) { userPoliciesData.setItems(user.component.accessPolicies); } @@ -1222,7 +1222,7 @@ initUserDeleteDialog(); initUsersTable(); - if (common.canModifyTenants()) { + if (nfCommon.canModifyTenants()) { $('#new-user-button').on('click', function () { buildUsersList(); buildGroupsList(); @@ -1247,7 +1247,7 @@ var usersTable = $('#users-table'); if (usersTable.is(':visible')) { var grid = usersTable.data('gridInstance'); - if (common.isDefinedAndNotNull(grid)) { + if (nfCommon.isDefinedAndNotNull(grid)) { grid.resizeCanvas(); } } @@ -1310,7 +1310,7 @@ usersGrid.getSelectionModel().setSelectedRows([]); $('#total-users').text(usersData.getLength()); - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); } }; diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/users/nf-users.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/users/nf-users.js index bdab85ba27..e39e160c08 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/users/nf-users.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/users/nf-users.js @@ -25,8 +25,8 @@ 'nf.ErrorHandler', 'nf.Storage', 'nf.Client'], - function ($, common, usersTable, errorHandler, storage, client) { - return (nf.Users = factory($, common, usersTable, errorHandler, storage, client)); + function ($, nfCommon, nfUsersTable, nfErrorHandler, nfStorage, nfClient) { + return (nf.Users = factory($, nfCommon, nfUsersTable, nfErrorHandler, nfStorage, nfClient)); }); } else if (typeof exports === 'object' && typeof module === 'object') { module.exports = (nf.Users = @@ -45,7 +45,7 @@ root.nf.Storage, root.nf.Client); } -}(this, function ($, common, usersTable, errorHandler, storage, client) { +}(this, function ($, nfCommon, nfUsersTable, nfErrorHandler, nfStorage, nfClient) { 'use strict'; $(document).ready(function () { @@ -79,14 +79,14 @@ url: config.urls.currentUser, dataType: 'json' }).done(function (currentUser) { - common.setCurrentUser(currentUser); - }).fail(errorHandler.handleAjaxError); + nfCommon.setCurrentUser(currentUser); + }).fail(nfErrorHandler.handleAjaxError); }; var initializeUsersPage = function () { // define mouse over event for the refresh button - common.addHoverEffect('#user-refresh-button', 'button-refresh', 'button-refresh-hover').click(function () { - usersTable.loadUsersTable(); + nfCommon.addHoverEffect('#user-refresh-button', 'button-refresh', 'button-refresh-hover').click(function () { + nfUsersTable.loadUsersTable(); }); // get the banners if we're not in the shell @@ -98,8 +98,8 @@ dataType: 'json' }).done(function (bannerResponse) { // ensure the banners response is specified - if (common.isDefinedAndNotNull(bannerResponse.banners)) { - if (common.isDefinedAndNotNull(bannerResponse.banners.headerText) && bannerResponse.banners.headerText !== '') { + if (nfCommon.isDefinedAndNotNull(bannerResponse.banners)) { + if (nfCommon.isDefinedAndNotNull(bannerResponse.banners.headerText) && bannerResponse.banners.headerText !== '') { // update the header text var bannerHeader = $('#banner-header').text(bannerResponse.banners.headerText).show(); @@ -113,7 +113,7 @@ updateTop('users'); } - if (common.isDefinedAndNotNull(bannerResponse.banners.footerText) && bannerResponse.banners.footerText !== '') { + if (nfCommon.isDefinedAndNotNull(bannerResponse.banners.footerText) && bannerResponse.banners.footerText !== '') { // update the footer text and show it var bannerFooter = $('#banner-footer').text(bannerResponse.banners.footerText).show(); @@ -129,7 +129,7 @@ deferred.resolve(); }).fail(function (xhr, status, error) { - errorHandler.handleAjaxError(xhr, status, error); + nfErrorHandler.handleAjaxError(xhr, status, error); deferred.reject(); }); } else { @@ -143,25 +143,25 @@ * Initializes the counters page. */ init: function () { - storage.init(); + nfStorage.init(); // initialize the client - client.init(); + nfClient.init(); // load the users authorities ensureAccess().done(function () { // create the counters table - usersTable.init(); + nfUsersTable.init(); // load the users table - usersTable.loadUsersTable().done(function () { + nfUsersTable.loadUsersTable().done(function () { // finish initializing users page initializeUsersPage().done(function () { // listen for browser resize events to update the page size - $(window).resize(usersTable.resetTableSize); + $(window).resize(nfUsersTable.resetTableSize); // configure the initial grid height - usersTable.resetTableSize(); + nfUsersTable.resetTableSize(); // get the about details $.ajax({ @@ -175,7 +175,7 @@ // set the document title and the about title document.title = countersTitle; $('#users-header-text').text(countersTitle); - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); }); $(window).on('resize', function (e) {