NIFI-4894:

- Ensuring that any proxy paths are retained when querying for bulletins.

This closes #2482

Signed-off-by: Scott Aslan <scottyaslan@gmail.com>
This commit is contained in:
Matt Gilman 2018-02-20 10:28:50 -05:00 committed by Scott Aslan
parent ff95be2a11
commit d75f118ae1
2 changed files with 21 additions and 3 deletions

View File

@ -251,7 +251,8 @@
var query = function (ids) { var query = function (ids) {
var url = new URL(window.location); 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('|') sourceId: ids.join('|')
}); });

View File

@ -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 * strToFind is not found or the last part of the str, an empty string is
* returned. * 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 * strToFind is not found or the first part of the str, an empty string is
* returned. * returned.
* *
* @argument {string} str The full string * @argument {string} str The full string
* @argument {string} strToFind The substring to find * @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) { substringBeforeFirst: function (str, strToFind) {
var result = ''; var result = '';
var indexOfStrToFind = str.indexOf(strToFind); var indexOfStrToFind = str.indexOf(strToFind);