Merge branch 'client-side-log-pagination' into open-appsec-integration

This commit is contained in:
Rami Winestock
2023-12-12 13:18:52 +02:00
parent 3741c52366
commit 80deae99d6
7 changed files with 280 additions and 36 deletions

View File

@@ -112,7 +112,7 @@ function makeExpansionString(expand) {
* @param {String} [query]
* @returns {Promise}
*/
function getAllObjects(path, expand, query) {
function getAllObjects(path, expand, query, page, perPage) {
let params = [];
if (typeof expand === 'object' && expand !== null && expand.length) {
@@ -123,7 +123,13 @@ function getAllObjects(path, expand, query) {
params.push('query=' + query);
}
return fetch('get', path + (params.length ? '?' + params.join('&') : ''));
if (page && perPage) {
params.push('page=' + page);
params.push('perPage=' + perPage);
}
let url = path + (params.length ? '?' + params.join('&') : '');
return fetch('get', url);
}
function FileUpload(path, fd) {
@@ -724,7 +730,7 @@ module.exports = {
*/
getAll: function (expand, query) {
return getAllObjects('openappsec-log', expand, query);
}
},
},
Reports: {