Use addon log routes in logviewer
This commit is contained in:
@@ -653,6 +653,18 @@ angular.module('Application').service('Client', ['$http', '$interval', 'md5', 'N
|
||||
}
|
||||
};
|
||||
|
||||
Client.prototype.getAddonLogs = function (addonName, follow, lines, callback) {
|
||||
if (follow) {
|
||||
var eventSource = new EventSource(client.apiOrigin + '/api/v1/addons/' + addonName + '/logstream?lines=' + lines + '&access_token=' + token);
|
||||
callback(null, eventSource);
|
||||
} else {
|
||||
get('/api/v1/addons/' + addonName + '/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.getApps = function (callback) {
|
||||
get('/api/v1/apps').success(function (data, status) {
|
||||
if (status !== 200 || typeof data !== 'object') return callback(new ClientError(status, data));
|
||||
|
||||
Reference in New Issue
Block a user