Repository: incubator-nifi Updated Branches: refs/heads/NIFI-250 975db1a7b -> 5db358f4e
NIFI-250: - Populating the reporting task details when modifying a service that it references. Project: http://git-wip-us.apache.org/repos/asf/incubator-nifi/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-nifi/commit/5db358f4 Tree: http://git-wip-us.apache.org/repos/asf/incubator-nifi/tree/5db358f4 Diff: http://git-wip-us.apache.org/repos/asf/incubator-nifi/diff/5db358f4 Branch: refs/heads/NIFI-250 Commit: 5db358f4e580dc5a1129444ffc203a4041720160 Parents: 975db1a Author: Matt Gilman <[email protected]> Authored: Wed Mar 25 15:27:35 2015 -0400 Committer: Matt Gilman <[email protected]> Committed: Wed Mar 25 15:27:35 2015 -0400 ---------------------------------------------------------------------- .../js/nf/canvas/nf-controller-service.js | 34 ++++++++++++++++---- 1 file changed, 28 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/5db358f4/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-service.js ---------------------------------------------------------------------- diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-service.js b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-service.js index b78125b..5a9130b 100644 --- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-service.js +++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-service.js @@ -354,13 +354,13 @@ nf.ControllerService = (function () { var processorType = $('<span class="referencing-component-type"></span>').text(nf.Common.substringAfterLast(referencingComponent.type, '.')); // active thread count - var activeThreadCount = $('<span class="referencing-component-active-thread-count"></span>').addClass(referencingComponent.id + '-active-threads'); + var processorActiveThreadCount = $('<span class="referencing-component-active-thread-count"></span>').addClass(referencingComponent.id + '-active-threads'); if (nf.Common.isDefinedAndNotNull(referencingComponent.activeThreadCount) && referencingComponent.activeThreadCount > 0) { - activeThreadCount.text('(' + referencingComponent.activeThreadCount + ')'); + processorActiveThreadCount.text('(' + referencingComponent.activeThreadCount + ')'); } // processor - var processorItem = $('<li></li>').append(processorState).append(processorLink).append(processorType).append(activeThreadCount); + var processorItem = $('<li></li>').append(processorState).append(processorLink).append(processorType).append(processorActiveThreadCount); processors.append(processorItem); } else if (referencingComponent.referenceType === 'ControllerService') { var serviceLink = $('<span class="referencing-component-name link"></span>').text(referencingComponent.name).on('click', function () { @@ -408,12 +408,34 @@ nf.ControllerService = (function () { services.append(serviceItem); } else if (referencingComponent.referenceType === 'ReportingTask') { - var taskItem = $('<li></li>').text(referencingComponent.name).on('click', function () { + var reportingTaskLink = $('<li></li>').text(referencingComponent.name).on('click', function () { + var reportingTaskGrid = $('#reporting-tasks-table').data('gridInstance'); + var reportingTaskData = reportingTaskGrid.getData(); + + // select the selected row + var row = reportingTaskData.getRowById(referencingComponent.id); + reportingTaskGrid.setSelectedRows([row]); // close the dialog and shell - $('#controller-service-configuration').modal('hide'); + referenceContainer.closest('.dialog').modal('hide'); }); - tasks.append(taskItem); + + // state + var reportingTaskState = $('<div class="referencing-component-state"></div>').addClass(referencingComponent.id + '-state'); + updateReferencingSchedulableComponentState(reportingTaskState, referencingComponent); + + // type + var reportingTaskType = $('<span class="referencing-component-type"></span>').text(nf.Common.substringAfterLast(referencingComponent.type, '.')); + + // active thread count + var reportingTaskActiveThreadCount = $('<span class="referencing-component-active-thread-count"></span>').addClass(referencingComponent.id + '-active-threads'); + if (nf.Common.isDefinedAndNotNull(referencingComponent.activeThreadCount) && referencingComponent.activeThreadCount > 0) { + reportingTaskActiveThreadCount.text('(' + referencingComponent.activeThreadCount + ')'); + } + + // reporting task + var reportingTaskItem = $('<li></li>').append(reportingTaskState).append(reportingTaskLink).append(reportingTaskType).append(reportingTaskActiveThreadCount); + tasks.append(reportingTaskItem); } });
