http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/2965258e/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/nf-common.js ---------------------------------------------------------------------- diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/nf-common.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/nf-common.js index 9e2514c..cdc3ea7 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/nf-common.js +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/nf-common.js @@ -72,14 +72,17 @@ nf.Common = { } } }, + /** * Determines if the current broswer supports SVG. */ SUPPORTS_SVG: !!document.createElementNS && !!document.createElementNS('http://www.w3.org/2000/svg', 'svg').createSVGRect, + /** * The authorities for the current user. */ authorities: undefined, + /** * Sets the authorities for the current user. * @@ -88,6 +91,7 @@ nf.Common = { setAuthorities: function (roles) { nf.Common.authorities = roles; }, + /** * Loads a script at the specified URL. Supports caching the script on the browser. * @@ -100,6 +104,7 @@ nf.Common = { url: url }); }, + /** * Determines whether the current user can access provenance. * @@ -117,6 +122,7 @@ nf.Common = { } return canAccessProvenance; }, + /** * Returns whether or not the current user is a DFM. */ @@ -132,6 +138,7 @@ nf.Common = { } return dfm; }, + /** * Returns whether or not the current user is a DFM. */ @@ -147,6 +154,7 @@ nf.Common = { } return admin; }, + /** * Adds a mouse over effect for the specified selector using * the specified styles. @@ -163,6 +171,7 @@ nf.Common = { }); return $(selector).addClass(normalStyle); }, + /** * Method for handling ajax errors. * @@ -237,6 +246,7 @@ nf.Common = { nf.Common.closeCanvas(); } }, + /** * Closes the canvas by removing the splash screen and stats poller. */ @@ -256,6 +266,7 @@ nf.Common = { nf.Canvas.stopStatusPolling(); } }, + /** * Populates the specified field with the specified value. If the value is * undefined, the field will read 'No value set.' If the value is an empty @@ -273,6 +284,7 @@ nf.Common = { return $('#' + target).text(value); } }, + /** * Clears the specified field. Removes any style that may have been applied * by a preceeding call to populateField. @@ -282,6 +294,7 @@ nf.Common = { clearField: function (target) { return $('#' + target).removeClass('unset blank').text(''); }, + /** * Formats the tooltip for the specified property. * @@ -321,6 +334,7 @@ nf.Common = { return null; } }, + /** * Formats the specified property (name and value) accordingly. * @@ -330,6 +344,7 @@ nf.Common = { formatProperty: function (name, value) { return '<div><span class="label">' + nf.Common.formatValue(name) + ': </span>' + nf.Common.formatValue(value) + '</div>'; }, + /** * Formats the specified value accordingly. * @@ -346,6 +361,7 @@ nf.Common = { return '<span class="unset">No value set</span>'; } }, + /** * HTML escapes the specified string. If the string is null * or undefined, an empty string is returned. @@ -372,6 +388,7 @@ nf.Common = { } }; }()), + /** * Creates a form inline in order to submit the specified params to the specified URL * using the specified method. @@ -407,6 +424,7 @@ nf.Common = { window.onbeforeunload = previousBeforeUnload; } }, + /** * Formats the specified array as an unordered list. If the array is not an * array, null is returned. @@ -429,6 +447,7 @@ nf.Common = { return null; } }, + /** * Extracts the contents of the specified str after the strToFind. If the * strToFind is not found or the last part of the str, an empty string is @@ -448,6 +467,7 @@ nf.Common = { } return result; }, + /** * Updates the mouse pointer. * @@ -461,6 +481,7 @@ nf.Common = { $('#' + domId).removeClass('pointer'); } }, + /** * Constants for time duration formatting. */ @@ -468,6 +489,7 @@ nf.Common = { MILLIS_PER_HOUR: 3600000, MILLIS_PER_MINUTE: 60000, MILLIS_PER_SECOND: 1000, + /** * Formats the specified duration. * @@ -515,6 +537,7 @@ nf.Common = { return time; } }, + /** * Constants for formatting data size. */ @@ -522,6 +545,7 @@ nf.Common = { BYTES_IN_MEGABYTE: 1048576, BYTES_IN_GIGABYTE: 1073741824, BYTES_IN_TERABYTE: 1099511627776, + /** * Formats the specified number of bytes into a human readable string. * @@ -556,6 +580,7 @@ nf.Common = { // default to bytes return parseFloat(dataSize).toFixed(2) + " bytes"; }, + /** * Formats the specified integer as a string (adding commas). At this * point this does not take into account any locales. @@ -570,6 +595,7 @@ nf.Common = { } return string; }, + /** * Formats the specified float using two demical places. * @@ -581,6 +607,7 @@ nf.Common = { } return f.toFixed(2) + ''; }, + /** * Pads the specified value to the specified width with the specified character. * If the specified value is already wider than the specified width, the original @@ -601,6 +628,7 @@ nf.Common = { return s; }, + /** * Formats the specified DateTime. * @@ -622,6 +650,7 @@ nf.Common = { '.' + nf.Common.pad(date.getMilliseconds(), 3, '0'); }, + /** * Parses the specified date time into a Date object. The resulting * object does not account for timezone and should only be used for @@ -667,6 +696,7 @@ nf.Common = { return new Date(parseInt(date[2], 10), parseInt(date[0], 10), parseInt(date[1], 10), parseInt(time[0], 10), parseInt(time[1], 10), parseInt(time[2], 10), 0); } }, + /** * Parses the specified duration and returns the total number of millis. * @@ -689,6 +719,7 @@ nf.Common = { return new Date(1970, 0, 1, parseInt(duration[0], 10), parseInt(duration[1], 10), parseInt(duration[2], 10), 0).getTime(); } }, + /** * Parses the specified size. * @@ -712,6 +743,7 @@ nf.Common = { return size; } }, + /** * Parses the specified count. * @@ -736,6 +768,7 @@ nf.Common = { } return intCount; }, + /** * Determines if the specified object is defined and not null. * @@ -744,6 +777,7 @@ nf.Common = { isDefinedAndNotNull: function (obj) { return !nf.Common.isUndefined(obj) && !nf.Common.isNull(obj); }, + /** * Determines if the specified object is undefined or null. * @@ -752,6 +786,7 @@ nf.Common = { isUndefinedOrNull: function (obj) { return nf.Common.isUndefined(obj) || nf.Common.isNull(obj); }, + /** * Determines if the specified object is undefined. * @@ -760,6 +795,7 @@ nf.Common = { isUndefined: function (obj) { return typeof obj === 'undefined'; }, + /** * Determines whether the specified string is blank (or null or undefined). * @@ -768,6 +804,7 @@ nf.Common = { isBlank: function (str) { return nf.Common.isUndefined(str) || nf.Common.isNull(str) || $.trim(str) === ''; }, + /** * Determines if the specified object is null. * @@ -776,6 +813,7 @@ nf.Common = { isNull: function (obj) { return obj === null; }, + /** * Determines if the specified array is empty. If the specified arg is not an * array, then true is returned. @@ -785,6 +823,7 @@ nf.Common = { isEmpty: function (arr) { return $.isArray(arr) ? arr.length === 0 : true; }, + /** * Determines if these are the same bulletins. If both arguments are not * arrays, false is returned. @@ -809,6 +848,7 @@ nf.Common = { } return false; }, + /** * Formats the specified bulletin list. *
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/2965258e/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/nf-connection-details.js ---------------------------------------------------------------------- diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/nf-connection-details.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/nf-connection-details.js index bffcf5e..4ba2a1d 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/nf-connection-details.js +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/nf-connection-details.js @@ -47,7 +47,7 @@ nf.ConnectionDetails = (function () { type: 'GET', url: '../nifi-api/controller/process-groups/' + encodeURIComponent(groupId) + '/processors/' + encodeURIComponent(source.id), dataType: 'json' - }).then(function (response) { + }).done(function (response) { var processor = response.processor; var processorName = $('<div class="label"></div>').text(processor.name); var processorType = $('<div></div>').text(nf.Common.substringAfterLast(processor.type, '.')); @@ -124,7 +124,7 @@ nf.ConnectionDetails = (function () { verbose: true }, dataType: 'json' - }).then(function (response) { + }).done(function (response) { var processGroup = response.processGroup; // populate source port details @@ -133,7 +133,7 @@ nf.ConnectionDetails = (function () { $('#read-only-connection-source-group-name').text(processGroup.name); deferred.resolve(); - }, function () { + }).fail(function () { deferred.reject(); }); } @@ -172,7 +172,7 @@ nf.ConnectionDetails = (function () { type: 'GET', url: '../nifi-api/controller/process-groups/' + encodeURIComponent(groupId) + '/processors/' + encodeURIComponent(destination.id), dataType: 'json' - }).then(function (response) { + }).done(function (response) { var processor = response.processor; var processorName = $('<div class="label"></div>').text(processor.name); var processorType = $('<div></div>').text(nf.Common.substringAfterLast(processor.type, '.')); @@ -183,7 +183,7 @@ nf.ConnectionDetails = (function () { $('#read-only-connection-target-group-name').text(groupName); deferred.resolve(); - }, function () { + }).fail(function () { deferred.reject(); }); }).promise(); @@ -254,7 +254,7 @@ nf.ConnectionDetails = (function () { verbose: true }, dataType: 'json' - }).then(function (response) { + }).done(function (response) { var processGroup = response.processGroup; // populate destination port details @@ -263,7 +263,7 @@ nf.ConnectionDetails = (function () { $('#read-only-connection-target-group-name').text(processGroup.name); deferred.resolve(); - }, function () { + }).fail(function () { deferred.reject(); }); } @@ -346,6 +346,7 @@ nf.ConnectionDetails = (function () { } }); }, + /** * Shows the details for the specified edge. * @@ -368,7 +369,7 @@ nf.ConnectionDetails = (function () { }); // populate the dialog once get have all necessary details - $.when(groupXhr, connectionXhr).then(function (groupResult, connectionResult) { + $.when(groupXhr, connectionXhr).done(function (groupResult, connectionResult) { var groupResponse = groupResult[0]; var connectionResponse = connectionResult[0]; @@ -453,7 +454,7 @@ nf.ConnectionDetails = (function () { } }); } - }, nf.Common.handleAjaxError); + }).fail(nf.Common.handleAjaxError); } }; }()); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/2965258e/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/nf-dialog.js ---------------------------------------------------------------------- diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/nf-dialog.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/nf-dialog.js index b474f2b..174f8bd 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/nf-dialog.js +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/nf-dialog.js @@ -78,6 +78,7 @@ nf.Dialog = (function () { // show the dialog $('#nf-ok-dialog').modal('setHeaderText', options.headerText).modal('setOverlayBackground', options.overlayBackground).modal('show'); }, + /** * Shows an general dialog with Yes and No buttons populated with the * specified dialog content. http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/2965258e/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/nf-processor-details.js ---------------------------------------------------------------------- diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/nf-processor-details.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/nf-processor-details.js index b4c1da9..480a380 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/nf-processor-details.js +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/nf-processor-details.js @@ -381,6 +381,7 @@ nf.ProcessorDetails = (function () { } }); }, + /** * Shows the details for the specified processor. * @@ -508,7 +509,7 @@ nf.ProcessorDetails = (function () { }); // show the dialog once we have the processor and its history - $.when(getProcessor, getProcessorHistory).then(function (response) { + $.when(getProcessor, getProcessorHistory).done(function (response) { var processorResponse = response[0]; var processor = processorResponse.processor; @@ -549,7 +550,7 @@ nf.ProcessorDetails = (function () { if (processorRelationships.is(':visible') && processorRelationships.get(0).scrollHeight > processorRelationships.innerHeight()) { processorRelationships.css('border-width', '1px'); } - }, function (xhr, status, error) { + }).fail(function (xhr, status, error) { if (xhr.status === 400 || xhr.status === 404 || xhr.status === 409) { nf.Dialog.showOkDialog({ dialogContent: nf.Common.escapeHtml(xhr.responseText), http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/2965258e/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/nf-shell.js ---------------------------------------------------------------------- diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/nf-shell.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/nf-shell.js index 5c52f8f..b0793a9 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/nf-shell.js +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/nf-shell.js @@ -100,6 +100,7 @@ nf.Shell = (function () { }); }).promise(); }, + /** * Shows the specified content in the shell. When the shell is closed, the content * will be hidden and returned to its previous location in the dom. http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/2965258e/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/nf-status-history.js ---------------------------------------------------------------------- diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/nf-status-history.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/nf-status-history.js index 178207e..c75728b 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/nf-status-history.js +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/nf-status-history.js @@ -1175,6 +1175,7 @@ nf.StatusHistory = (function () { instances = null; }); }, + /** * Shows the status history for the specified connection across the cluster. * @@ -1187,10 +1188,11 @@ nf.StatusHistory = (function () { type: 'GET', url: config.urls.clusterConnection + encodeURIComponent(connectionId) + '/status/history', dataType: 'json' - }).then(function (response) { + }).done(function (response) { handleClusteredStatusHistoryResponse(groupId, connectionId, response.clusterStatusHistory, config.type.connection, selectedDescriptor); - }, nf.Common.handleAjaxError); + }).fail(nf.Common.handleAjaxError); }, + /** * Shows the status history for the specified processor across the cluster. * @@ -1203,10 +1205,11 @@ nf.StatusHistory = (function () { type: 'GET', url: config.urls.clusterProcessor + encodeURIComponent(processorId) + '/status/history', dataType: 'json' - }).then(function (response) { + }).done(function (response) { handleClusteredStatusHistoryResponse(groupId, processorId, response.clusterStatusHistory, config.type.processor, selectedDescriptor); - }, nf.Common.handleAjaxError); + }).fail(nf.Common.handleAjaxError); }, + /** * Shows the status history for the specified process group across the cluster. * @@ -1219,10 +1222,11 @@ nf.StatusHistory = (function () { type: 'GET', url: config.urls.clusterProcessGroup + encodeURIComponent(processGroupId) + '/status/history', dataType: 'json' - }).then(function (response) { + }).done(function (response) { handleClusteredStatusHistoryResponse(groupId, processGroupId, response.clusterStatusHistory, config.type.processGroup, selectedDescriptor); - }, nf.Common.handleAjaxError); + }).fail(nf.Common.handleAjaxError); }, + /** * Shows the status history for the specified remote process group across the cluster. * @@ -1235,10 +1239,11 @@ nf.StatusHistory = (function () { type: 'GET', url: config.urls.clusterRemoteProcessGroup + encodeURIComponent(remoteProcessGroupId) + '/status/history', dataType: 'json' - }).then(function (response) { + }).done(function (response) { handleClusteredStatusHistoryResponse(groupId, remoteProcessGroupId, response.clusterStatusHistory, config.type.remoteProcessGroup, selectedDescriptor); - }, nf.Common.handleAjaxError); + }).fail(nf.Common.handleAjaxError); }, + /** * Shows the status history for the specified connection in this instance. * @@ -1251,10 +1256,11 @@ nf.StatusHistory = (function () { type: 'GET', url: config.urls.processGroups + encodeURIComponent(groupId) + '/connections/' + encodeURIComponent(connectionId) + '/status/history', dataType: 'json' - }).then(function (response) { + }).done(function (response) { handleStandaloneStatusHistoryResponse(groupId, connectionId, response.statusHistory, config.type.connection, selectedDescriptor); - }, nf.Common.handleAjaxError); + }).fail(nf.Common.handleAjaxError); }, + /** * Shows the status history for the specified processor in this instance. * @@ -1267,10 +1273,11 @@ nf.StatusHistory = (function () { type: 'GET', url: config.urls.processGroups + encodeURIComponent(groupId) + '/processors/' + encodeURIComponent(processorId) + '/status/history', dataType: 'json' - }).then(function (response) { + }).done(function (response) { handleStandaloneStatusHistoryResponse(groupId, processorId, response.statusHistory, config.type.processor, selectedDescriptor); - }, nf.Common.handleAjaxError); + }).fail(nf.Common.handleAjaxError); }, + /** * Shows the status history for the specified process group in this instance. * @@ -1283,10 +1290,11 @@ nf.StatusHistory = (function () { type: 'GET', url: config.urls.processGroups + encodeURIComponent(processGroupId) + '/status/history', dataType: 'json' - }).then(function (response) { + }).done(function (response) { handleStandaloneStatusHistoryResponse(groupId, processGroupId, response.statusHistory, config.type.processGroup, selectedDescriptor); - }, nf.Common.handleAjaxError); + }).fail(nf.Common.handleAjaxError); }, + /** * Shows the status history for the specified remote process group in this instance. * @@ -1299,9 +1307,9 @@ nf.StatusHistory = (function () { type: 'GET', url: config.urls.processGroups + encodeURIComponent(groupId) + '/remote-process-groups/' + encodeURIComponent(remoteProcessGroupId) + '/status/history', dataType: 'json' - }).then(function (response) { + }).done(function (response) { handleStandaloneStatusHistoryResponse(groupId, remoteProcessGroupId, response.statusHistory, config.type.remoteProcessGroup, selectedDescriptor); - }, nf.Common.handleAjaxError); + }).fail(nf.Common.handleAjaxError); } }; }()); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/2965258e/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance-lineage.js ---------------------------------------------------------------------- diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance-lineage.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance-lineage.js index 1a32514..1f05caa 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance-lineage.js +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance-lineage.js @@ -864,12 +864,12 @@ nf.ProvenanceLineage = (function () { // polls for the event lineage var pollLineage = function (nextDelay) { - getLineage(lineage).then(function (response) { + getLineage(lineage).done(function (response) { lineage = response.lineage; // process the lineage, if its not done computing wait delay seconds before checking again processLineage(nextDelay); - }, closeDialog); + }).fail(closeDialog); }; // processes the event lineage @@ -929,12 +929,12 @@ nf.ProvenanceLineage = (function () { }; // once the query is submitted wait until its finished - submitLineage(lineageRequest).then(function (response) { + submitLineage(lineageRequest).done(function (response) { lineage = response.lineage; // process the lineage, if its not done computing wait 1 second before checking again processLineage(1); - }, closeDialog); + }).fail(closeDialog); }; // handles updating the lineage graph @@ -1284,6 +1284,7 @@ nf.ProvenanceLineage = (function () { initLineageQueryDialog(); }, + /** * Shows the lineage for the specified flowfile uuid. * @@ -1347,12 +1348,12 @@ nf.ProvenanceLineage = (function () { // polls the server for the status of the lineage, if the lineage is not // done wait nextDelay seconds before trying again var pollLineage = function (nextDelay) { - getLineage(lineage).then(function (response) { + getLineage(lineage).done(function (response) { lineage = response.lineage; // process the lineage, if its not done computing wait delay seconds before checking again processLineage(nextDelay); - }, closeDialog); + }).fail(closeDialog); }; var processLineage = function (delay) { @@ -1401,12 +1402,12 @@ nf.ProvenanceLineage = (function () { }; // once the query is submitted wait until its finished - submitLineage(lineageRequest).then(function (response) { + submitLineage(lineageRequest).done(function (response) { lineage = response.lineage; // process the results, if they are not done wait 1 second before trying again processLineage(1); - }, closeDialog); + }).fail(closeDialog); } }; }()); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/2965258e/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance-table.js ---------------------------------------------------------------------- diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance-table.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance-table.js index 9b4dc96..bcd0fce 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance-table.js +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance-table.js @@ -49,15 +49,15 @@ nf.ProvenanceTable = (function () { var loadLineageCapabilities = function () { return $.Deferred(function (deferred) { if (nf.Common.SUPPORTS_SVG) { - nf.Common.cachedScript(config.urls.d3Script).then(function () { - nf.Common.cachedScript(config.urls.lineageScript).then(function () { + nf.Common.cachedScript(config.urls.d3Script).done(function () { + nf.Common.cachedScript(config.urls.lineageScript).done(function () { // initialize the lineage graph nf.ProvenanceLineage.init(); deferred.resolve(); - }, function () { + }).fail(function () { deferred.reject(); }); - }, function () { + }).fail(function () { deferred.reject(); }); } else { @@ -210,12 +210,12 @@ nf.ProvenanceTable = (function () { url: config.urls.replays, data: parameters, dataType: 'json' - }).then(function (response) { + }).done(function (response) { nf.Dialog.showOkDialog({ dialogContent: 'Successfully submitted replay request.', overlayBackground: false }); - }, nf.Common.handleAjaxError); + }).fail(nf.Common.handleAjaxError); $('#event-details-dialog').modal('hide'); }); @@ -294,7 +294,7 @@ nf.ProvenanceTable = (function () { type: 'GET', url: config.urls.cluster, dataType: 'json' - }).then(function (response) { + }).done(function (response) { var cluster = response.cluster; var nodes = cluster.nodes; @@ -323,7 +323,7 @@ nf.ProvenanceTable = (function () { $('#provenance-search-location').combo({ options: searchableOptions }); - }, nf.Common.handleAjaxError); + }).fail(nf.Common.handleAjaxError); // show the node search combo $('#provenance-search-location-container').show(); @@ -888,23 +888,26 @@ nf.ProvenanceTable = (function () { * The max delay between requests. */ MAX_DELAY: 4, + /** * The server time offset */ serverTimeOffset: null, + /** * Initializes the provenance table. Returns a deferred that will indicate when/if the table has initialized successfully. * * @param {boolean} isClustered Whether or not this instance is clustered */ init: function (isClustered) { - return loadLineageCapabilities().then(function () { + return loadLineageCapabilities().done(function () { initDetailsDialog(); initProvenanceQueryDialog(); initSearchDialog(isClustered); initProvenanceTable(isClustered); - }, nf.Common.handleAjaxError); + }).fail(nf.Common.handleAjaxError); }, + /** * Goes to the specified component if possible. * @@ -929,6 +932,7 @@ nf.ProvenanceTable = (function () { } } }, + /** * Update the size of the grid based on its container's current size. */ @@ -938,6 +942,7 @@ nf.ProvenanceTable = (function () { provenanceGrid.resizeCanvas(); } }, + /** * Updates the value of the specified progress bar. * @@ -953,6 +958,7 @@ nf.ProvenanceTable = (function () { var label = $('<div class="progress-label"></div>').text(value + '%'); progressBar.progressbar('value', value).append(label); }, + /** * Loads the provenance table with events according to the specified optional * query. If not query is specified or it is empty, the most recent entries will @@ -1025,13 +1031,13 @@ nf.ProvenanceTable = (function () { // polls the server for the status of the provenance, if the provenance is not // done wait nextDelay seconds before trying again var pollProvenance = function (nextDelay) { - getProvenance(provenance).then(function (response) { + getProvenance(provenance).done(function (response) { // update the provenance provenance = response.provenance; // process the provenance processProvenanceResponse(nextDelay); - }, closeDialog); + }).fail(closeDialog); }; // processes the provenance, if the provenance is not done wait delay @@ -1079,14 +1085,15 @@ nf.ProvenanceTable = (function () { }; // once the query is submitted wait until its finished - submitProvenance(query).then(function (response) { + submitProvenance(query).done(function (response) { // update the provenance provenance = response.provenance; // process the results, if they are not done wait 1 second before trying again processProvenanceResponse(1); - }, closeDialog); + }).fail(closeDialog); }, + /** * Shows the lineage for the event in the specified row. * @@ -1100,6 +1107,7 @@ nf.ProvenanceTable = (function () { nf.ProvenanceLineage.showLineage(item.flowFileUuid, item.eventId.toString(), item.clusterNodeId); } }, + /** * Gets the event details and shows the details dialog. * @@ -1115,6 +1123,7 @@ nf.ProvenanceTable = (function () { nf.ProvenanceTable.showEventDetails(event); } }, + /** * Shows the details for the specified action. * http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/2965258e/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance.js ---------------------------------------------------------------------- diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance.js index 6d61829..33338a5 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance.js +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance.js @@ -47,10 +47,10 @@ nf.Provenance = (function () { $.ajax({ type: 'HEAD', url: config.urls.cluster - }).then(function () { + }).done(function () { isClustered = true; deferred.resolve(); - }, function (xhr, status, error) { + }).fail(function (xhr, status, error) { if (xhr.status === 404) { isClustered = false; deferred.resolve(); @@ -70,7 +70,7 @@ nf.Provenance = (function () { type: 'GET', url: config.urls.config, dataType: 'json' - }).then(function (response) { + }).done(function (response) { var config = response.config; // store the controller name @@ -80,7 +80,7 @@ nf.Provenance = (function () { if (!nf.Common.isBlank(config.contentViewerUrl)) { $('#nifi-content-viewer-url').text(config.contentViewerUrl); } - }, nf.Common.handleAjaxError); + }).fail(nf.Common.handleAjaxError); }; /** @@ -92,7 +92,7 @@ nf.Provenance = (function () { type: 'GET', url: config.urls.authorities, dataType: 'json' - }).then(function (response) { + }).done(function (response) { if (nf.Common.isDefinedAndNotNull(response.authorities)) { // record the users authorities nf.Common.setAuthorities(response.authorities); @@ -100,7 +100,7 @@ nf.Provenance = (function () { } else { deferred.reject(); } - }, function (xhr, status, error) { + }).fail(function (xhr, status, error) { nf.Common.handleAjaxError(xhr, status, error); deferred.reject(); }); @@ -124,7 +124,7 @@ nf.Provenance = (function () { type: 'GET', url: config.urls.banners, dataType: 'json' - }).then(function (response) { + }).done(function (response) { // ensure the banners response is specified if (nf.Common.isDefinedAndNotNull(response.banners)) { if (nf.Common.isDefinedAndNotNull(response.banners.headerText) && response.banners.headerText !== '') { @@ -156,7 +156,7 @@ nf.Provenance = (function () { } deferred.resolve(); - }, function (xhr, status, error) { + }).fail(function (xhr, status, error) { nf.Common.handleAjaxError(xhr, status, error); deferred.reject(); }); @@ -188,14 +188,14 @@ nf.Provenance = (function () { type: 'GET', url: config.urls.controllerAbout, dataType: 'json' - }).then(function (response) { + }).done(function (response) { var aboutDetails = response.about; var provenanceTitle = aboutDetails.title + ' Data Provenance'; // set the document title and the about title document.title = provenanceTitle; $('#provenance-header-text').text(provenanceTitle); - }, nf.Common.handleAjaxError); + }).fail(nf.Common.handleAjaxError); }); }); }); http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/2965258e/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-summary-table.js ---------------------------------------------------------------------- diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-summary-table.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-summary-table.js index c47d790..f3150b0 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-summary-table.js +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-summary-table.js @@ -45,7 +45,7 @@ nf.SummaryTable = (function () { var loadChartCapabilities = function () { return $.Deferred(function (deferred) { if (nf.Common.SUPPORTS_SVG) { - nf.Common.cachedScript(config.urls.d3Script).then(function () { + nf.Common.cachedScript(config.urls.d3Script).done(function () { // get the controller config to get the server offset var configRequest = $.ajax({ type: 'GET', @@ -54,17 +54,17 @@ nf.SummaryTable = (function () { }); // get the config details and load the chart script - $.when(configRequest, nf.Common.cachedScript(config.urls.statusHistory)).then(function (response) { + $.when(configRequest, nf.Common.cachedScript(config.urls.statusHistory)).done(function (response) { var configResponse = response[0]; var configDetails = configResponse.config; // initialize the chart nf.StatusHistory.init(configDetails.timeOffset); deferred.resolve(); - }, function () { + }).fail(function () { deferred.reject(); }); - }, function () { + }).fail(function () { deferred.reject(); }); } else { @@ -1549,7 +1549,7 @@ nf.SummaryTable = (function () { type: 'GET', url: nf.SummaryTable.systemDiagnosticsUrl, dataType: 'json' - }).then(function (response) { + }).done(function (response) { var systemDiagnostics = response.systemDiagnostics; // heap @@ -1588,7 +1588,7 @@ nf.SummaryTable = (function () { // update the stats last refreshed timestamp $('#system-diagnostics-last-refreshed').text(systemDiagnostics.statsLastRefreshed); - }, nf.Common.handleAjaxError); + }).fail(nf.Common.handleAjaxError); }; /** @@ -1717,7 +1717,7 @@ nf.SummaryTable = (function () { verbose: true }, dataType: 'json' - }).then(function (response) { + }).done(function (response) { if (nf.Common.isDefinedAndNotNull(response.clusterProcessorStatus)) { var clusterProcessorStatus = response.clusterProcessorStatus; @@ -1755,7 +1755,7 @@ nf.SummaryTable = (function () { // update the stats last refreshed timestamp $('#cluster-processor-summary-last-refreshed').text(clusterProcessorStatus.statsLastRefreshed); } - }, nf.Common.handleAjaxError); + }).fail(nf.Common.handleAjaxError); }; /** @@ -1772,7 +1772,7 @@ nf.SummaryTable = (function () { verbose: true }, dataType: 'json' - }).then(function (response) { + }).done(function (response) { if (nf.Common.isDefinedAndNotNull(response.clusterConnectionStatus)) { var clusterConnectionStatus = response.clusterConnectionStatus; @@ -1807,7 +1807,7 @@ nf.SummaryTable = (function () { // update the stats last refreshed timestamp $('#cluster-connection-summary-last-refreshed').text(clusterConnectionStatus.statsLastRefreshed); } - }, nf.Common.handleAjaxError); + }).fail(nf.Common.handleAjaxError); }; /** @@ -1824,7 +1824,7 @@ nf.SummaryTable = (function () { verbose: true }, dataType: 'json' - }).then(function (response) { + }).done(function (response) { if (nf.Common.isDefinedAndNotNull(response.clusterPortStatus)) { var clusterInputPortStatus = response.clusterPortStatus; @@ -1856,7 +1856,7 @@ nf.SummaryTable = (function () { // update the stats last refreshed timestamp $('#cluster-input-port-summary-last-refreshed').text(clusterInputPortStatus.statsLastRefreshed); } - }, nf.Common.handleAjaxError); + }).fail(nf.Common.handleAjaxError); }; /** @@ -1873,7 +1873,7 @@ nf.SummaryTable = (function () { verbose: true }, dataType: 'json' - }).then(function (response) { + }).done(function (response) { if (nf.Common.isDefinedAndNotNull(response.clusterPortStatus)) { var clusterOutputPortStatus = response.clusterPortStatus; @@ -1905,7 +1905,7 @@ nf.SummaryTable = (function () { // update the stats last refreshed timestamp $('#cluster-output-port-summary-last-refreshed').text(clusterOutputPortStatus.statsLastRefreshed); } - }, nf.Common.handleAjaxError); + }).fail(nf.Common.handleAjaxError); }; /** @@ -1922,7 +1922,7 @@ nf.SummaryTable = (function () { verbose: true }, dataType: 'json' - }).then(function (response) { + }).done(function (response) { if (nf.Common.isDefinedAndNotNull(response.clusterRemoteProcessGroupStatus)) { var clusterRemoteProcessGroupStatus = response.clusterRemoteProcessGroupStatus; @@ -1957,7 +1957,7 @@ nf.SummaryTable = (function () { // update the stats last refreshed timestamp $('#cluster-remote-process-group-summary-last-refreshed').text(clusterRemoteProcessGroupStatus.statsLastRefreshed); } - }, nf.Common.handleAjaxError); + }).fail(nf.Common.handleAjaxError); }; return { @@ -1965,10 +1965,12 @@ nf.SummaryTable = (function () { * URL for loading system diagnostics. */ systemDiagnosticsUrl: null, + /** * URL for loading the summary. */ url: null, + /** * Initializes the status table. * @@ -1980,18 +1982,19 @@ nf.SummaryTable = (function () { nf.SummaryTable.systemDiagnosticsUrl = config.urls.systemDiagnostics; return $.Deferred(function (deferred) { - loadChartCapabilities().then(function () { + loadChartCapabilities().done(function () { // initialize the processor/connection details dialog nf.ProcessorDetails.init(false); nf.ConnectionDetails.init(false); initSummaryTable(isClustered); deferred.resolve(); - }, function () { + }).fail(function () { deferred.reject(); }); }).promise(); }, + /** * Update the size of the grid based on its container's current size. */ @@ -2021,6 +2024,7 @@ nf.SummaryTable = (function () { remoteProcessGroupGrid.resizeCanvas(); } }, + /** * Load the processor status table. */ @@ -2032,7 +2036,7 @@ nf.SummaryTable = (function () { recursive: true }, dataType: 'json' - }).then(function (response) { + }).done(function (response) { var processGroupStatus = response.processGroupStatus; if (nf.Common.isDefinedAndNotNull(processGroupStatus)) { @@ -2103,8 +2107,9 @@ nf.SummaryTable = (function () { } else { $('#total-items').text('0'); } - }, nf.Common.handleAjaxError); + }).fail(nf.Common.handleAjaxError); }, + // processor actions /** @@ -2120,6 +2125,7 @@ nf.SummaryTable = (function () { nf.ProcessorDetails.showDetails(item.groupId, item.id); } }, + /** * Goes to the specified processor. * @@ -2133,6 +2139,7 @@ nf.SummaryTable = (function () { goTo(item.groupId, item.id); } }, + /** * Shows the processor status history for a cluster. * @@ -2146,6 +2153,7 @@ nf.SummaryTable = (function () { nf.StatusHistory.showClusterProcessorChart(item.groupId, item.id); } }, + /** * Shows the processor status history. * @@ -2159,6 +2167,7 @@ nf.SummaryTable = (function () { nf.StatusHistory.showStandaloneProcessorChart(item.groupId, item.id); } }, + /** * Shows the cluster processor details dialog for the specified processor. * @@ -2180,6 +2189,7 @@ nf.SummaryTable = (function () { $('#cluster-processor-summary-dialog').modal('show'); } }, + // connection actions /** @@ -2195,6 +2205,7 @@ nf.SummaryTable = (function () { nf.ConnectionDetails.showDetails(item.groupId, item.id); } }, + /** * Goes to the specified connection. * @@ -2208,6 +2219,7 @@ nf.SummaryTable = (function () { goTo(item.groupId, item.id); } }, + /** * Shows the connection status history for a cluster. * @@ -2221,6 +2233,7 @@ nf.SummaryTable = (function () { nf.StatusHistory.showClusterConnectionChart(item.groupId, item.id); } }, + /** * Shows the connection status history. * @@ -2234,6 +2247,7 @@ nf.SummaryTable = (function () { nf.StatusHistory.showStandaloneConnectionChart(item.groupId, item.id); } }, + /** * Shows the cluster connection details dialog for the specified connection. * @@ -2255,6 +2269,7 @@ nf.SummaryTable = (function () { $('#cluster-connection-summary-dialog').modal('show'); } }, + // input actions /** @@ -2270,6 +2285,7 @@ nf.SummaryTable = (function () { goTo(item.groupId, item.id); } }, + /** * Shows the cluster input port details dialog for the specified connection. * @@ -2291,6 +2307,7 @@ nf.SummaryTable = (function () { $('#cluster-input-port-summary-dialog').modal('show'); } }, + // output actions /** @@ -2306,6 +2323,7 @@ nf.SummaryTable = (function () { goTo(item.groupId, item.id); } }, + /** * Shows the cluster output port details dialog for the specified connection. * @@ -2327,6 +2345,7 @@ nf.SummaryTable = (function () { $('#cluster-output-port-summary-dialog').modal('show'); } }, + // remote process group actions /** @@ -2342,6 +2361,7 @@ nf.SummaryTable = (function () { goTo(item.groupId, item.id); } }, + /** * Shows the remote process group status history for a cluster. * @@ -2355,6 +2375,7 @@ nf.SummaryTable = (function () { nf.StatusHistory.showClusterRemoteProcessGroupChart(item.groupId, item.id); } }, + /** * Shows the remote process group status history. * @@ -2368,6 +2389,7 @@ nf.SummaryTable = (function () { nf.StatusHistory.showStandaloneRemoteProcessGroupChart(item.groupId, item.id); } }, + /** * Shows the cluster remote process group details dialog for the specified connection. * http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/2965258e/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-summary.js ---------------------------------------------------------------------- diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-summary.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-summary.js index d28f751..7b90a0f 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-summary.js +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-summary.js @@ -40,17 +40,17 @@ nf.Summary = (function () { $.ajax({ type: 'HEAD', url: config.urls.cluster - }).then(function () { - nf.SummaryTable.init(true).then(function () { + }).done(function () { + nf.SummaryTable.init(true).done(function () { deferred.resolve(); - }, function () { + }).fail(function () { deferred.reject(); }); - }, function (xhr, status, error) { + }).fail(function (xhr, status, error) { if (xhr.status === 404) { - nf.SummaryTable.init(false).then(function () { + nf.SummaryTable.init(false).done(function () { deferred.resolve(); - }, function () { + }).fail(function () { deferred.reject(); }); } else { @@ -84,7 +84,7 @@ nf.Summary = (function () { type: 'GET', url: config.urls.banners, dataType: 'json' - }).then(function (response) { + }).done(function (response) { // ensure the banners response is specified if (nf.Common.isDefinedAndNotNull(response.banners)) { if (nf.Common.isDefinedAndNotNull(response.banners.headerText) && response.banners.headerText !== '') { @@ -116,7 +116,7 @@ nf.Summary = (function () { } deferred.resolve(); - }, function (xhr, status, error) { + }).fail(function (xhr, status, error) { nf.Common.handleAjaxError(xhr, status, error); deferred.reject(); }); @@ -145,14 +145,14 @@ nf.Summary = (function () { type: 'GET', url: config.urls.controllerAbout, dataType: 'json' - }).then(function (response) { + }).done(function (response) { var aboutDetails = response.about; var statusTitle = aboutDetails.title + ' Summary'; // set the document title and the about title document.title = statusTitle; $('#status-header-text').text(statusTitle); - }, nf.Common.handleAjaxError); + }).fail(nf.Common.handleAjaxError); var setBodySize = function () { $('body').css({ http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/2965258e/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/templates/nf-templates-table.js ---------------------------------------------------------------------- diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/templates/nf-templates-table.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/templates/nf-templates-table.js index da40002..7f486de 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/templates/nf-templates-table.js +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/templates/nf-templates-table.js @@ -63,11 +63,11 @@ nf.TemplatesTable = (function () { type: 'DELETE', url: config.urls.templates + '/' + encodeURIComponent(templateId), dataType: 'json' - }).then(function () { + }).done(function () { var templatesGrid = $('#templates-table').data('gridInstance'); var templatesData = templatesGrid.getData(); templatesData.deleteItem(templateId); - }, nf.Common.handleAjaxError); + }).fail(nf.Common.handleAjaxError); }; /** @@ -249,6 +249,7 @@ nf.TemplatesTable = (function () { // initialize the number of displayed items $('#displayed-templates').text('0'); }, + /** * Update the size of the grid based on its container's current size. */ @@ -258,6 +259,7 @@ nf.TemplatesTable = (function () { templateGrid.resizeCanvas(); } }, + /** * Exports the specified template. * @@ -271,6 +273,7 @@ nf.TemplatesTable = (function () { nf.Common.submit('GET', config.urls.templates + '/' + encodeURIComponent(item.id)); } }, + /** * Prompts the user before attempting to delete the specified template. * @@ -292,6 +295,7 @@ nf.TemplatesTable = (function () { }); } }, + /** * Load the processor templates table. */ @@ -303,7 +307,7 @@ nf.TemplatesTable = (function () { verbose: false }, dataType: 'json' - }).then(function (response) { + }).done(function (response) { // ensure there are groups specified if (nf.Common.isDefinedAndNotNull(response.templates)) { var templatesGrid = $('#templates-table').data('gridInstance'); @@ -322,7 +326,7 @@ nf.TemplatesTable = (function () { } else { $('#total-templates').text('0'); } - }, nf.Common.handleAjaxError); + }).fail(nf.Common.handleAjaxError); } }; }()); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/2965258e/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/templates/nf-templates.js ---------------------------------------------------------------------- diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/templates/nf-templates.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/templates/nf-templates.js index 9fff79a..0602c37 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/templates/nf-templates.js +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/templates/nf-templates.js @@ -41,7 +41,7 @@ nf.Templates = (function () { type: 'GET', url: config.urls.authorities, dataType: 'json' - }).then(function (response) { + }).done(function (response) { if (nf.Common.isDefinedAndNotNull(response.authorities)) { // record the users authorities nf.Common.setAuthorities(response.authorities); @@ -49,7 +49,7 @@ nf.Templates = (function () { } else { deferred.reject(); } - }, function (xhr, status, error) { + }).fail(function (xhr, status, error) { nf.Common.handleAjaxError(xhr, status, error); deferred.reject(); }); @@ -154,7 +154,7 @@ nf.Templates = (function () { type: 'GET', url: config.urls.banners, dataType: 'json' - }).then(function (response) { + }).done(function (response) { // ensure the banners response is specified if (nf.Common.isDefinedAndNotNull(response.banners)) { if (nf.Common.isDefinedAndNotNull(response.banners.headerText) && response.banners.headerText !== '') { @@ -186,7 +186,7 @@ nf.Templates = (function () { } deferred.resolve(); - }, function (xhr, status, error) { + }).fail(function (xhr, status, error) { nf.Common.handleAjaxError(xhr, status, error); deferred.reject(); }); @@ -219,14 +219,14 @@ nf.Templates = (function () { type: 'GET', url: config.urls.controllerAbout, dataType: 'json' - }).then(function (response) { + }).done(function (response) { var aboutDetails = response.about; var templatesTitle = aboutDetails.title + ' Templates'; // set the document title and the about title document.title = templatesTitle; $('#templates-header-text').text(templatesTitle); - }, nf.Common.handleAjaxError); + }).fail(nf.Common.handleAjaxError); }); }); }); http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/2965258e/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/users/nf-users-table.js ---------------------------------------------------------------------- diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/users/nf-users-table.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/users/nf-users-table.js index dd78eb5..996544f 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/users/nf-users-table.js +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/users/nf-users-table.js @@ -114,7 +114,7 @@ nf.UsersTable = (function () { data: JSON.stringify(userEntity), contentType: 'application/json', dataType: 'json' - }).then(function (response) { + }).done(function (response) { if (nf.Common.isDefinedAndNotNull(response.user)) { var user = response.user; @@ -123,7 +123,7 @@ nf.UsersTable = (function () { var usersData = usersGrid.getData(); usersData.updateItem(user.id, user); } - }, nf.Common.handleAjaxError); + }).fail(nf.Common.handleAjaxError); // hide the dialog $('#user-roles-dialog').modal('hide'); @@ -203,9 +203,9 @@ nf.UsersTable = (function () { data: JSON.stringify(userGroupEntity), contentType: 'application/json', dataType: 'json' - }).then(function () { + }).done(function () { nf.UsersTable.loadUsersTable(); - }, nf.Common.handleAjaxError); + }).fail(nf.Common.handleAjaxError); // hide the dialog $('#group-roles-dialog').modal('hide'); @@ -244,9 +244,9 @@ nf.UsersTable = (function () { type: 'DELETE', url: config.urls.users + '/' + encodeURIComponent(userId), dataType: 'json' - }).then(function () { + }).done(function () { nf.UsersTable.loadUsersTable(); - }, nf.Common.handleAjaxError); + }).fail(nf.Common.handleAjaxError); // hide the dialog $('#user-delete-dialog').modal('hide'); @@ -291,7 +291,7 @@ nf.UsersTable = (function () { 'status': 'DISABLED' }, dataType: 'json' - }).then(function (response) { + }).done(function (response) { if (nf.Common.isDefinedAndNotNull(response.user)) { var user = response.user; @@ -300,7 +300,7 @@ nf.UsersTable = (function () { var usersData = usersGrid.getData(); usersData.updateItem(user.id, user); } - }, nf.Common.handleAjaxError); + }).fail(nf.Common.handleAjaxError); // hide the dialog $('#user-revoke-dialog').modal('hide'); @@ -345,9 +345,9 @@ nf.UsersTable = (function () { 'status': 'DISABLED' }, dataType: 'json' - }).then(function () { + }).done(function () { nf.UsersTable.loadUsersTable(); - }, nf.Common.handleAjaxError); + }).fail(nf.Common.handleAjaxError); // hide the dialog $('#group-revoke-dialog').modal('hide'); @@ -407,9 +407,9 @@ nf.UsersTable = (function () { data: JSON.stringify(userGroupEntity), contentType: 'application/json', dataType: 'json' - }).then(function () { + }).done(function () { nf.UsersTable.loadUsersTable(); - }, nf.Common.handleAjaxError); + }).fail(nf.Common.handleAjaxError); } // hide the dialog @@ -815,6 +815,7 @@ nf.UsersTable = (function () { initGroupRevokeDialog(); initUsersTable(); }, + /** * Disables the specified user's account. * @@ -834,6 +835,7 @@ nf.UsersTable = (function () { $('#user-revoke-dialog').modal('show'); } }, + /** * Delete's the specified user's account. * @@ -853,6 +855,7 @@ nf.UsersTable = (function () { $('#user-delete-dialog').modal('show'); } }, + /** * Disables the specified group's account. * @@ -871,6 +874,7 @@ nf.UsersTable = (function () { $('#group-revoke-dialog').modal('show'); } }, + /** * Updates the specified users's level of access. * @@ -913,6 +917,7 @@ nf.UsersTable = (function () { $('#user-roles-dialog').modal('show'); } }, + /** * Updates the specified groups level of access. * @@ -931,6 +936,7 @@ nf.UsersTable = (function () { $('#group-roles-dialog').modal('show'); } }, + /** * Prompts to verify group removal. * @@ -951,13 +957,14 @@ nf.UsersTable = (function () { type: 'DELETE', url: config.urls.userGroups + '/' + encodeURIComponent(item.userGroup) + '/users/' + encodeURIComponent(item.id), dataType: 'json' - }).then(function (response) { + }).done(function (response) { nf.UsersTable.loadUsersTable(); - }, nf.Common.handleAjaxError); + }).fail(nf.Common.handleAjaxError); } }); } }, + /** * Ungroups the specified group. * @@ -978,13 +985,14 @@ nf.UsersTable = (function () { type: 'DELETE', url: config.urls.userGroups + '/' + encodeURIComponent(item.userGroup), dataType: 'json' - }).then(function (response) { + }).done(function (response) { nf.UsersTable.loadUsersTable(); - }, nf.Common.handleAjaxError); + }).fail(nf.Common.handleAjaxError); } }); } }, + /** * Update the size of the grid based on its container's current size. */ @@ -994,6 +1002,7 @@ nf.UsersTable = (function () { grid.resizeCanvas(); } }, + /** * Load the processor status table. */ @@ -1005,7 +1014,7 @@ nf.UsersTable = (function () { 'grouped': $('#group-collaspe-checkbox').hasClass('checkbox-checked') }, dataType: 'json' - }).then(function (response) { + }).done(function (response) { // ensure there are users if (nf.Common.isDefinedAndNotNull(response.users)) { var usersGrid = $('#users-table').data('gridInstance'); @@ -1027,8 +1036,9 @@ nf.UsersTable = (function () { } else { $('#total-users').text('0'); } - }, nf.Common.handleAjaxError); + }).fail(nf.Common.handleAjaxError); }, + /** * Shows details for the specified user. * http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/2965258e/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/users/nf-users.js ---------------------------------------------------------------------- diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/users/nf-users.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/users/nf-users.js index c1fac39..96f73a5 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/users/nf-users.js +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/users/nf-users.js @@ -41,7 +41,7 @@ nf.Users = (function () { type: 'GET', url: config.urls.authorities, dataType: 'json' - }).then(function (response) { + }).done(function (response) { if (nf.Common.isDefinedAndNotNull(response.authorities)) { // record the users authorities nf.Common.setAuthorities(response.authorities); @@ -49,7 +49,7 @@ nf.Users = (function () { } else { deferred.reject(); } - }, function (xhr, status, error) { + }).fail(function (xhr, status, error) { nf.Common.handleAjaxError(xhr, status, error); deferred.reject(); }); @@ -69,7 +69,7 @@ nf.Users = (function () { type: 'GET', url: config.urls.banners, dataType: 'json' - }).then(function (bannerResponse) { + }).done(function (bannerResponse) { // ensure the banners response is specified if (nf.Common.isDefinedAndNotNull(bannerResponse.banners)) { if (nf.Common.isDefinedAndNotNull(bannerResponse.banners.headerText) && bannerResponse.banners.headerText !== '') { @@ -101,7 +101,7 @@ nf.Users = (function () { } deferred.resolve(); - }, function (xhr, status, error) { + }).fail(function (xhr, status, error) { nf.Common.handleAjaxError(xhr, status, error); deferred.reject(); }); @@ -133,14 +133,14 @@ nf.Users = (function () { type: 'GET', url: config.urls.controllerAbout, dataType: 'json' - }).then(function (response) { + }).done(function (response) { var aboutDetails = response.about; var countersTitle = aboutDetails.title + ' Users'; // set the document title and the about title document.title = countersTitle; $('#users-header-text').text(countersTitle); - }, nf.Common.handleAjaxError); + }).fail(nf.Common.handleAjaxError); }); }); });