Remove old logs viewer

This commit is contained in:
Johannes Zellner
2023-07-18 17:44:22 +02:00
parent ac33570645
commit 024a9c6e2b
4 changed files with 1 additions and 374 deletions

View File

@@ -748,14 +748,6 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
return token;
};
Client.prototype.makeURL = function (url) {
if (url.indexOf('?') === -1) {
return this.apiOrigin + url + '?access_token=' + token;
} else {
return this.apiOrigin + url + '&access_token=' + token;
}
};
/*
* Rest API wrappers
*/
@@ -1415,21 +1407,6 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
});
};
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);
eventSource.onerror = callback;
eventSource.onopen = function () { callback(null, eventSource); };
} else {
get('/api/v1/services/' + taskId + '/logs?lines=' + lines, null, function (error, data, status) {
if (error) return callback(error);
if (status !== 200) return callback(new ClientError(status, data));
callback(null, data);
});
}
};
Client.prototype.editBackup = function (backupId, label, preserveSecs, callback) {
post('/api/v1/backups/' + backupId, { label: label, preserveSecs: preserveSecs }, null, function (error, data, status) {
if (error) return callback(error);
@@ -1553,36 +1530,6 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
});
};
Client.prototype.getPlatformLogs = function (unit, follow, lines, callback) {
if (follow) {
var eventSource = new EventSource(client.apiOrigin + '/api/v1/cloudron/logstream/' + unit + '?lines=' + lines + '&access_token=' + token);
eventSource.onerror = callback;
eventSource.onopen = function () { callback(null, eventSource); };
} else {
get('/api/v1/cloudron/logs/' + unit + '?lines=' + lines, null, function (error, data, status) {
if (error) return callback(error);
if (status !== 200) return callback(new ClientError(status, data));
callback(null, data);
});
}
};
Client.prototype.getServiceLogs = function (serviceName, follow, lines, callback) {
if (follow) {
var eventSource = new EventSource(client.apiOrigin + '/api/v1/services/' + serviceName + '/logstream?lines=' + lines + '&access_token=' + token);
eventSource.onerror = callback;
eventSource.onopen = function () { callback(null, eventSource); };
} else {
get('/api/v1/services/' + serviceName + '/logs?lines=' + lines, null, function (error, data, status) {
if (error) return callback(error);
if (status !== 200) return callback(new ClientError(status, data));
callback(null, data);
});
}
};
Client.prototype.getApps = function (callback) {
var that = this;
@@ -1599,21 +1546,6 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
});
};
Client.prototype.getAppLogs = function (appId, follow, lines, callback) {
if (follow) {
var eventSource = new EventSource(client.apiOrigin + '/api/v1/apps/' + appId + '/logstream?lines=' + lines + '&access_token=' + token);
eventSource.onerror = callback;
eventSource.onopen = function () { callback(null, eventSource); };
} else {
get('/api/v1/apps/' + appId + '/logs', null, function (error, data, status) {
if (error) return callback(error);
if (status !== 200) return callback(new ClientError(status, data));
callback(null, data);
});
}
};
Client.prototype.getAppBackups = function (appId, callback) {
var page = 1;
var perPage = 100;