fix task logs
This commit is contained in:
@@ -579,6 +579,18 @@ angular.module('Application').service('Client', ['$http', '$interval', 'md5', 'N
|
||||
}).error(defaultErrorHandler(callback));
|
||||
};
|
||||
|
||||
Client.prototype.getTaskLogs = function (taskId, follow, lines, callback) {
|
||||
if (follow) {
|
||||
var eventSource = new EventSource(client.apiOrigin + '/api/v1/tasks/' + taskId + '/logstream?lines=' + lines + '&access_token=' + token);
|
||||
callback(null, eventSource);
|
||||
} else {
|
||||
get('/api/v1/services/' + taskId + '/logs?lines=100').success(function (data, status) {
|
||||
if (status !== 200 || typeof data !== 'object') return callback(new ClientError(status, data));
|
||||
callback(null, data);
|
||||
}).error(defaultErrorHandler(callback));
|
||||
}
|
||||
};
|
||||
|
||||
Client.prototype.startBackup = function (callback) {
|
||||
post('/api/v1/backups').success(function(data, status) {
|
||||
if (status !== 202 || typeof data !== 'object') return callback(new ClientError(status, data));
|
||||
|
||||
Reference in New Issue
Block a user