Always return all box backups

This commit is contained in:
Johannes Zellner
2023-01-26 12:42:05 +01:00
parent ea8e6d3969
commit 22208b9fa6
2 changed files with 26 additions and 6 deletions
+26 -5
View File
@@ -1311,12 +1311,33 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
};
Client.prototype.getBackups = function (callback) {
get('/api/v1/backups', null, function (error, data, status) {
if (error) return callback(error);
if (status !== 200) return callback(new ClientError(status, data));
var page = 1;
var perPage = 100;
var backups = [];
callback(null, data.backups);
});
function fetchMore() {
var config = {
params: {
page: page,
per_page: perPage
}
};
get('/api/v1/backups', config, function (error, data, status) {
if (error) return callback(error);
if (status !== 200) return callback(new ClientError(status, data));
backups = backups.concat(data.backups);
if (data.backups.length < perPage) return callback(null, backups);
page++;
fetchMore();
});
}
fetchMore();
};
Client.prototype.getLatestTaskByType = function (type, callback) {