diff --git a/nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java b/nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java index bb74b25ad8..ea3b9593e8 100644 --- a/nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java +++ b/nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java @@ -186,7 +186,7 @@ public class NiFiProperties extends Properties { // defaults public static final String DEFAULT_TITLE = "NiFi"; public static final Boolean DEFAULT_AUTO_RESUME_STATE = true; - public static final String DEFAULT_AUTHORITY_PROVIDER_CONFIGURATION_FILE = "conf/authority-providers.xml"; + public static final String DEFAULT_AUTHORIZER_CONFIGURATION_FILE = "conf/authorizers.xml"; public static final String DEFAULT_LOGIN_IDENTITY_PROVIDER_CONFIGURATION_FILE = "conf/login-identity-providers.xml"; public static final String DEFAULT_USER_CREDENTIAL_CACHE_DURATION = "24 hours"; public static final Integer DEFAULT_REMOTE_INPUT_PORT = null; @@ -511,7 +511,7 @@ public class NiFiProperties extends Properties { public File getAuthorizerConfiguraitonFile() { final String value = getProperty(AUTHORIZER_CONFIGURATION_FILE); if (StringUtils.isBlank(value)) { - return new File(DEFAULT_AUTHORITY_PROVIDER_CONFIGURATION_FILE); + return new File(DEFAULT_AUTHORIZER_CONFIGURATION_FILE); } else { return new File(value); } diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/RemoteProcessGroupResource.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/RemoteProcessGroupResource.java index 61549c314a..1e9e720d58 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/RemoteProcessGroupResource.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/RemoteProcessGroupResource.java @@ -16,24 +16,12 @@ */ package org.apache.nifi.web.api; -import java.net.URI; -import java.util.Set; - -import javax.servlet.http.HttpServletRequest; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.DefaultValue; -import javax.ws.rs.GET; -import javax.ws.rs.HttpMethod; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - +import com.wordnik.swagger.annotations.Api; +import com.wordnik.swagger.annotations.ApiOperation; +import com.wordnik.swagger.annotations.ApiParam; +import com.wordnik.swagger.annotations.ApiResponse; +import com.wordnik.swagger.annotations.ApiResponses; +import com.wordnik.swagger.annotations.Authorization; import org.apache.commons.lang3.StringUtils; import org.apache.nifi.authorization.Authorizer; import org.apache.nifi.authorization.RequestAction; @@ -49,12 +37,22 @@ import org.apache.nifi.web.api.entity.RemoteProcessGroupPortEntity; import org.apache.nifi.web.api.request.ClientIdParameter; import org.apache.nifi.web.api.request.LongParameter; -import com.wordnik.swagger.annotations.Api; -import com.wordnik.swagger.annotations.ApiOperation; -import com.wordnik.swagger.annotations.ApiParam; -import com.wordnik.swagger.annotations.ApiResponse; -import com.wordnik.swagger.annotations.ApiResponses; -import com.wordnik.swagger.annotations.Authorization; +import javax.servlet.http.HttpServletRequest; +import javax.ws.rs.Consumes; +import javax.ws.rs.DELETE; +import javax.ws.rs.DefaultValue; +import javax.ws.rs.GET; +import javax.ws.rs.HttpMethod; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import java.net.URI; +import java.util.Set; /** * RESTful endpoint for managing a Remote group. @@ -310,11 +308,16 @@ public class RemoteProcessGroupResource extends ApplicationResource { + "remote process group port id of the requested resource (%s).", requestRemoteProcessGroupPort.getId(), portId)); } + // ensure the group ids are the same + if (!id.equals(requestRemoteProcessGroupPort.getGroupId())) { + throw new IllegalArgumentException(String.format("The remote process group id (%s) in the request body does not equal the " + + "remote process group id of the requested resource (%s).", requestRemoteProcessGroupPort.getGroupId(), id)); + } + if (isReplicateRequest()) { return replicate(HttpMethod.PUT, remoteProcessGroupPortEntity); } - // handle expects request (usually from the cluster manager) final Revision revision = getRevision(remoteProcessGroupPortEntity, id); return withWriteLock( serviceFacade, @@ -393,12 +396,18 @@ public class RemoteProcessGroupResource extends ApplicationResource { + "remote process group port id of the requested resource (%s).", requestRemoteProcessGroupPort.getId(), portId)); } + // ensure the group ids are the same + if (!id.equals(requestRemoteProcessGroupPort.getGroupId())) { + throw new IllegalArgumentException(String.format("The remote process group id (%s) in the request body does not equal the " + + "remote process group id of the requested resource (%s).", requestRemoteProcessGroupPort.getGroupId(), id)); + } + if (isReplicateRequest()) { return replicate(HttpMethod.PUT, remoteProcessGroupPortEntity); } // handle expects request (usually from the cluster manager) - final Revision revision = getRevision(remoteProcessGroupPortEntity, portId); + final Revision revision = getRevision(remoteProcessGroupPortEntity, id); return withWriteLock( serviceFacade, revision, diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-graph-controls-controller.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-graph-controls-controller.js index bc6a0dfb96..63cce54f54 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-graph-controls-controller.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-graph-controls-controller.js @@ -112,13 +112,14 @@ nf.ng.Canvas.GraphControlsCtrl = function (serviceProvider, navigateCtrl, operat this.navigateCtrl = navigateCtrl; this.operateCtrl = operateCtrl; } + GraphControlsCtrl.prototype = { constructor: GraphControlsCtrl, /** * Register the header controller. */ - register: function() { + register: function () { if (serviceProvider.graphControlsCtrl === undefined) { serviceProvider.register('graphControlsCtrl', graphControlsCtrl); } @@ -127,7 +128,7 @@ nf.ng.Canvas.GraphControlsCtrl = function (serviceProvider, navigateCtrl, operat /** * Initialize the graph controls. */ - init: function() { + init: function () { this.operateCtrl.init(); // initial the graph control visibility var graphControlVisibility = nf.Storage.getItem('graph-control-visibility'); @@ -144,18 +145,22 @@ nf.ng.Canvas.GraphControlsCtrl = function (serviceProvider, navigateCtrl, operat }); } - // listen for browser resize events to reset the graph control positioning - $(window).resize(positionGraphControls); - // set the initial position positionGraphControls(); }, + /** + * Position the graph controls + */ + positionGraphControls: function () { + positionGraphControls(); + }, + /** * Undock the graph control. * @param {jQuery} $event */ - undock: function($event) { + undock: function ($event) { openGraphControl($($event.target).parent().parent()); }, @@ -163,7 +168,7 @@ nf.ng.Canvas.GraphControlsCtrl = function (serviceProvider, navigateCtrl, operat * Expand the graph control. * @param {jQuery} $event */ - expand: function($event) { + expand: function ($event) { var icon = $($event.target); if (icon.hasClass('fa-plus-square-o')) { openGraphControl(icon.closest('div.graph-control')); diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-actions.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-actions.js index 9c5b0a939c..cb3e7af206 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-actions.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-actions.js @@ -512,33 +512,28 @@ nf.Actions = (function () { componentsToStart.each(function (d) { var selected = d3.select(this); - // processor endpoint does not use running flag... - var component = { - 'id': d.id, - }; - if (nf.CanvasUtils.isProcessor(selected) || nf.CanvasUtils.isInputPort(selected) || nf.CanvasUtils.isOutputPort(selected)) { - component['state'] = 'RUNNING'; + // prepare the request + var uri, entity; + if (nf.CanvasUtils.isProcessGroup(selected)) { + uri = config.urls.api + '/flow/process-groups/' + encodeURIComponent(d.id); + entity = { + 'id': d.id, + 'state': 'RUNNING' + } } else { - component['running'] = true; + uri = d.component.uri; + entity = { + 'revision': nf.Client.getRevision(d), + 'component': { + 'id': d.id, + 'state': 'RUNNING' + } + }; } - // build the entity - var entity = { - 'revision': nf.Client.getRevision(d), - 'component': component - }; - - startRequests.push(updateResource(d.component.uri, entity).done(function (response) { + startRequests.push(updateResource(uri, entity).done(function (response) { if (nf.CanvasUtils.isProcessGroup(selected)) { - nf.ProcessGroup.set(response); - - // reload the group's connections - var connections = nf.Connection.getComponentConnections(response.id); - $.each(connections, function (_, connection) { - if (connection.accessPolicy.canRead) { - nf.Connection.reload(connection.component); - } - }); + nf.ProcessGroup.reload(d.component); } else { nf[d.type].set(response); } @@ -587,33 +582,28 @@ nf.Actions = (function () { componentsToStop.each(function (d) { var selected = d3.select(this); - // processor endpoint does not use running flag... - var component = { - 'id': d.id, - }; - if (nf.CanvasUtils.isProcessor(selected) || nf.CanvasUtils.isInputPort(selected) || nf.CanvasUtils.isOutputPort(selected)) { - component['state'] = 'STOPPED'; + // prepare the request + var uri, entity; + if (nf.CanvasUtils.isProcessGroup(selected)) { + uri = config.urls.api + '/flow/process-groups/' + encodeURIComponent(d.id); + entity = { + 'id': d.id, + 'state': 'STOPPED' + }; } else { - component['running'] = false; + uri = d.component.uri; + entity = { + 'revision': nf.Client.getRevision(d), + 'component': { + 'id': d.id, + 'state': 'STOPPED' + } + }; } - // build the entity - var entity = { - 'revision': nf.Client.getRevision(d), - 'component': component - }; - - stopRequests.push(updateResource(d.component.uri, entity).done(function (response) { + stopRequests.push(updateResource(uri, entity).done(function (response) { if (nf.CanvasUtils.isProcessGroup(selected)) { - nf.ProcessGroup.set(response); - - // reload the group's connections - var connections = nf.Connection.getComponentConnections(response.id); - $.each(connections, function (_, connection) { - if (connection.accessPolicy.canRead) { - nf.Connection.reload(connection.component); - } - }); + nf.ProcessGroup.reload(d.component); } else { nf[d.type].set(response); } diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas.js index 9d9e7c5429..eef9b44341 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas.js @@ -523,6 +523,17 @@ nf.Canvas = (function () { if (e.target === window) { updateGraphSize(); updateFlowStatusContainerSize(); + + nf.ng.Bridge.get('appCtrl.serviceProvider.graphControlsCtrl').positionGraphControls(); + + // resize grids when appropriate + if ($('#process-group-controller-services-table').is(':visible')) { + nf.ProcessGroupConfiguration.resetTableSize(); + } else if ($('#controller-services-table').is(':visible') || $('#reporting-tasks-table').is(':visible')) { + nf.Settings.resetTableSize(); + } else if ($('#queue-listing-table').is(':visible')) { + nf.QueueListing.resetTableSize(); + } } }).on('keydown', function (evt) { // if a dialog is open, disable canvas shortcuts diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-process-group-configuration.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-process-group-configuration.js index 744869ca44..884e017902 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-process-group-configuration.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-process-group-configuration.js @@ -229,11 +229,6 @@ nf.ProcessGroupConfiguration = (function () { // settings refresh button... nf.Common.addHoverEffect('#process-group-configuration-refresh-button', 'button-refresh', 'button-refresh-hover'); - // handle window resizing - $(window).on('resize', function (e) { - nf.ProcessGroupConfiguration.resetTableSize(); - }); - // initialize each tab initGeneral(); nf.ControllerServices.init(getControllerServicesTable()); diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-queue-listing.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-queue-listing.js index 95755ede08..c6dcbb2575 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-queue-listing.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-queue-listing.js @@ -365,7 +365,7 @@ nf.QueueListing = (function () { type: 'GET', url: listingRequest.uri, dataType: 'json' - }).done(function(response) { + }).done(function (response) { listingRequest = response.listingRequest; processListingRequest(nextDelay); }).fail(completeListingRequest).fail(nf.Common.handleAjaxError); @@ -377,7 +377,7 @@ nf.QueueListing = (function () { url: '../nifi-api/flowfile-queues/' + connection.id + '/listing-requests', dataType: 'json', contentType: 'application/json' - }).done(function(response) { + }).done(function (response) { // initialize the progress bar value updateProgress(0); @@ -424,7 +424,7 @@ nf.QueueListing = (function () { url: flowFileSummary.uri, data: params, dataType: 'json' - }).done(function(response) { + }).done(function (response) { var flowFile = response.flowFile; // show the URI to this flowfile @@ -491,26 +491,11 @@ nf.QueueListing = (function () { }).fail(nf.Common.handleAjaxError); }; - /** - * Resets the table size. - */ - var resetTableSize = function () { - var queueListingGrid = $('#queue-listing-table').data('gridInstance'); - if (nf.Common.isDefinedAndNotNull(queueListingGrid)) { - queueListingGrid.resizeCanvas(); - } - }; - return { init: function () { initializeListingRequestStatusDialog(); initFlowFileDetailsDialog(); - // listen for browser resize events to update the page size - $(window).resize(function () { - resetTableSize(); - }); - // define mouse over event for the refresh button nf.Common.addHoverEffect('#queue-listing-refresh-button', 'button-refresh', 'button-refresh-hover').click(function () { var connection = $('#queue-listing-table').data('connection'); @@ -608,8 +593,8 @@ nf.QueueListing = (function () { // open the provenance page with the specified component nf.Shell.showPage('provenance?' + $.param({ - flowFileUuid: item.uuid - })); + flowFileUuid: item.uuid + })); } } }); @@ -634,6 +619,16 @@ nf.QueueListing = (function () { $('#displayed-flowfiles').text('0'); }, + /** + * Update the size of the grid based on its container's current size. + */ + resetTableSize: function () { + var queueListingGrid = $('#queue-listing-table').data('gridInstance'); + if (nf.Common.isDefinedAndNotNull(queueListingGrid)) { + queueListingGrid.resizeCanvas(); + } + }, + /** * Shows the listing of the FlowFiles from a given connection. * @@ -668,7 +663,7 @@ nf.QueueListing = (function () { }); // adjust the table size - resetTableSize(); + nf.QueueListing.resetTableSize(); // store the connection for access later $('#queue-listing-table').data('connection', connection); 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-ports.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-ports.js index baeed4c223..4ab9b1f774 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-ports.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-ports.js @@ -27,99 +27,99 @@ nf.RemoteProcessGroupPorts = (function () { headerText: 'Configure Remote Port', overlayBackground: false, buttons: [{ - buttonText: 'Apply', - handler: { - click: function () { - var remotePortConcurrentTasks = $('#remote-port-concurrent-tasks').val(); + buttonText: 'Apply', + handler: { + click: function () { + var remotePortConcurrentTasks = $('#remote-port-concurrent-tasks').val(); - // ensure the property name and value is specified - if ($.isNumeric(remotePortConcurrentTasks)) { - var remoteProcessGroupId = $('#remote-process-group-ports-id').text(); - var remoteProcessGroupData = d3.select('#id-' + remoteProcessGroupId).datum(); - var remotePortId = $('#remote-port-id').text(); + // ensure the property name and value is specified + if ($.isNumeric(remotePortConcurrentTasks)) { + var remoteProcessGroupId = $('#remote-process-group-ports-id').text(); + var remoteProcessGroupData = d3.select('#id-' + remoteProcessGroupId).datum(); + var remotePortId = $('#remote-port-id').text(); - // create the remote process group details - var remoteProcessGroupPortEntity = { - 'revision': nf.Client.getRevision(remoteProcessGroupData), - 'remoteProcessGroupPort': { - id: remotePortId, - groupId: remoteProcessGroupId, - useCompression: $('#remote-port-use-compression').hasClass('checkbox-checked'), - concurrentlySchedulableTaskCount: remotePortConcurrentTasks - } - }; + // create the remote process group details + var remoteProcessGroupPortEntity = { + 'revision': nf.Client.getRevision(remoteProcessGroupData), + 'remoteProcessGroupPort': { + id: remotePortId, + groupId: remoteProcessGroupId, + useCompression: $('#remote-port-use-compression').hasClass('checkbox-checked'), + concurrentlySchedulableTaskCount: remotePortConcurrentTasks + } + }; - // determine the type of port this is - var portContextPath = '/output-ports/'; - if ($('#remote-port-type').text() === 'input') { - portContextPath = '/input-ports/'; + // determine the type of port this is + var portContextPath = '/output-ports/'; + if ($('#remote-port-type').text() === 'input') { + portContextPath = '/input-ports/'; + } + + // update the selected component + $.ajax({ + type: 'PUT', + data: JSON.stringify(remoteProcessGroupPortEntity), + url: remoteProcessGroupData.component.uri + portContextPath + encodeURIComponent(remotePortId), + dataType: 'json', + contentType: 'application/json' + }).done(function (response) { + // TODO - update the revision + // nf.Client.setRevision(response.revision); + + // get the response + var remotePort = response.remoteProcessGroupPort; + + // determine the compression label + var compressionLabel = 'No'; + if (remotePort.useCompression === true) { + compressionLabel = 'Yes'; } - // update the selected component - $.ajax({ - type: 'PUT', - data: JSON.stringify(remoteProcessGroupPortEntity), - url: remoteProcessGroupData.component.uri + portContextPath + encodeURIComponent(remotePortId), - dataType: 'json', - contentType: 'application/json' - }).done(function (response) { - // TODO - update the revision - // nf.Client.setRevision(response.revision); + // set the new values + $('#' + remotePortId + '-concurrent-tasks').text(remotePort.concurrentlySchedulableTaskCount); + $('#' + remotePortId + '-compression').text(compressionLabel); + }).fail(function (xhr, status, error) { + if (xhr.status === 400) { + var errors = xhr.responseText.split('\n'); - // get the response - var remotePort = response.remoteProcessGroupPort; - - // determine the compression label - var compressionLabel = 'No'; - if (remotePort.useCompression === true) { - compressionLabel = 'Yes'; - } - - // set the new values - $('#' + remotePortId + '-concurrent-tasks').text(remotePort.concurrentlySchedulableTaskCount); - $('#' + remotePortId + '-compression').text(compressionLabel); - }).fail(function (xhr, status, error) { - if (xhr.status === 400) { - var errors = xhr.responseText.split('\n'); - - var content; - if (errors.length === 1) { - content = $('').text(errors[0]); - } else { - content = nf.Common.formatUnorderedList(errors); - } - - nf.Dialog.showOkDialog({ - dialogContent: content, - overlayBackground: false, - headerText: 'Configuration Error' - }); + var content; + if (errors.length === 1) { + content = $('').text(errors[0]); } else { - nf.Common.handleAjaxError(xhr, status, error); + content = nf.Common.formatUnorderedList(errors); } - }).always(function () { - // close the dialog - $('#remote-port-configuration').modal('hide'); - }); - } else { - nf.Dialog.showOkDialog({ - dialogContent: 'Concurrent tasks must be an integer value.', - overlayBackground: false - }); + nf.Dialog.showOkDialog({ + dialogContent: content, + overlayBackground: false, + headerText: 'Configuration Error' + }); + } else { + nf.Common.handleAjaxError(xhr, status, error); + } + }).always(function () { // close the dialog $('#remote-port-configuration').modal('hide'); - } - } - } - }, { - buttonText: 'Cancel', - handler: { - click: function () { + }); + } else { + nf.Dialog.showOkDialog({ + dialogContent: 'Concurrent tasks must be an integer value.', + overlayBackground: false + }); + + // close the dialog $('#remote-port-configuration').modal('hide'); } } - }], + } + }, { + buttonText: 'Cancel', + handler: { + click: function () { + $('#remote-port-configuration').modal('hide'); + } + } + }], handler: { close: function () { // clear the name/value textfields @@ -140,31 +140,31 @@ nf.RemoteProcessGroupPorts = (function () { headerText: 'Remote Process Group Ports', overlayBackground: true, buttons: [{ - buttonText: 'Close', - handler: { - click: function () { - // if this is a DFM, the over status of this node may have changed - if (nf.Common.isDFM()) { - // get the component in question - var remoteProcessGroupId = $('#remote-process-group-ports-id').text(); - var remoteProcessGroupData = d3.select('#id-' + remoteProcessGroupId).datum(); + buttonText: 'Close', + handler: { + click: function () { + // if this is a DFM, the over status of this node may have changed + if (nf.Common.isDFM()) { + // get the component in question + var remoteProcessGroupId = $('#remote-process-group-ports-id').text(); + var remoteProcessGroupData = d3.select('#id-' + remoteProcessGroupId).datum(); - // reload the remote process group - nf.RemoteProcessGroup.reload(remoteProcessGroupData.component); - } - - // hide the dialog - $('#remote-process-group-ports').modal('hide'); + // reload the remote process group + nf.RemoteProcessGroup.reload(remoteProcessGroupData.component); } + + // hide the dialog + $('#remote-process-group-ports').modal('hide'); } - }], + } + }], handler: { close: function () { // clear the remote process group details $('#remote-process-group-ports-id').text(''); $('#remote-process-group-ports-name').text(''); $('#remote-process-group-ports-url').text(''); - + // clear any tooltips var dialog = $('#remote-process-group-ports'); nf.Common.cleanUpTooltips(dialog, 'div.remote-port-removed'); @@ -180,7 +180,7 @@ nf.RemoteProcessGroupPorts = (function () { /** * Creates the markup for configuration concurrent tasks for a port. - * + * * @argument {jQuery} container The container * @argument {object} port The port * @argument {string} portType The type of port @@ -260,6 +260,7 @@ nf.RemoteProcessGroupPorts = (function () { 'revision': nf.Client.getRevision(remoteProcessGroupData), 'remoteProcessGroupPort': { id: port.id, + groupId: remoteProcessGroupId, transmitting: isTransmitting } }; @@ -369,10 +370,10 @@ nf.RemoteProcessGroupPorts = (function () { // add this ports concurrent tasks $('