diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-utils.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-utils.js index 3dce37e5a2..9347bd4995 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-utils.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-utils.js @@ -251,7 +251,8 @@ var query = function (ids) { var url = new URL(window.location); - var endpoint = url.origin + '/nifi-api/flow/bulletin-board?' + $.param({ + var origin = nfCommon.substringBeforeLast(url.href, '/nifi'); + var endpoint = origin + '/nifi-api/flow/bulletin-board?' + $.param({ sourceId: ids.join('|') }); 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 a1a3fc69d3..f89c4aa427 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 @@ -1022,7 +1022,7 @@ }, /** - * Extracts the contents of the specified str after the strToFind. If the + * Extracts the contents of the specified str after the last strToFind. If the * strToFind is not found or the last part of the str, an empty string is * returned. * @@ -1062,13 +1062,30 @@ }, /** - * Extracts the contents of the specified str before the strToFind. If the + * Extracts the contents of the specified str before the last strToFind. If the * strToFind is not found or the first part of the str, an empty string is * returned. * * @argument {string} str The full string * @argument {string} strToFind The substring to find */ + substringBeforeLast: function (str, strToFind) { + var result = ''; + var indexOfStrToFind = str.lastIndexOf(strToFind); + if (indexOfStrToFind >= 0) { + result = str.substr(0, indexOfStrToFind); + } + return result; + }, + + /** + * Extracts the contents of the specified str before the strToFind. If the + * strToFind is not found or the first path of the str, an empty string is + * returned. + * + * @argument {string} str The full string + * @argument {string} strToFind The substring to find + */ substringBeforeFirst: function (str, strToFind) { var result = ''; var indexOfStrToFind = str.indexOf(strToFind);