diff --git a/src/js/client.js b/src/js/client.js index 96a445c1c..b1e2a74a9 100644 --- a/src/js/client.js +++ b/src/js/client.js @@ -629,10 +629,10 @@ 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); + var eventSource = new EventSource(client.apiOrigin + '/api/v1/services/' + addonName + '/logstream?lines=' + lines + '&access_token=' + token); callback(null, eventSource); } else { - get('/api/v1/addons/' + addonName + '/logs?lines=100').success(function (data, status) { + get('/api/v1/services/' + 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)); @@ -666,28 +666,28 @@ angular.module('Application').service('Client', ['$http', '$interval', 'md5', 'N }; Client.prototype.getAddons = function (callback) { - get('/api/v1/addons').success(function (data, status) { + get('/api/v1/services').success(function (data, status) { if (status !== 200 || typeof data !== 'object') return callback(new ClientError(status, data)); callback(null, data.addons); }).error(defaultErrorHandler(callback)); }; Client.prototype.getAddon = function (addonName, callback) { - get('/api/v1/addons/' + addonName).success(function (data, status) { + get('/api/v1/services/' + addonName).success(function (data, status) { if (status !== 200 || typeof data !== 'object') return callback(new ClientError(status, data)); callback(null, data.addon); }).error(defaultErrorHandler(callback)); }; Client.prototype.configureAddon = function (addonName, memoryLimit, callback) { - post('/api/v1/addons/' + addonName, { memory: memoryLimit }).success(function (data, status) { + post('/api/v1/services/' + addonName, { memory: memoryLimit }).success(function (data, status) { if (status !== 202) return callback(new ClientError(status, data)); callback(null); }).error(defaultErrorHandler(callback)); }; Client.prototype.restartAddon = function (addonName, callback) { - post('/api/v1/addons/' + addonName + '/restart').success(function (data, status) { + post('/api/v1/services/' + addonName + '/restart').success(function (data, status) { if (status !== 202) return callback(new ClientError(status, data)); callback(null); }).error(defaultErrorHandler(callback)); diff --git a/src/js/logs.js b/src/js/logs.js index be6338abd..4c9d9c6be 100644 --- a/src/js/logs.js +++ b/src/js/logs.js @@ -70,11 +70,11 @@ app.controller('LogsController', ['$scope', '$timeout', '$location', 'Client', f { name: 'Box', type: 'platform', value: 'box', url: Client.makeURL('/api/v1/cloudron/logs/box') }, { name: 'Mail', type: 'platform', value: 'mail', url: Client.makeURL('/api/v1/cloudron/logs/mail') }, { name: 'Backup', type: 'platform', value: 'backup', url: Client.makeURL('/api/v1/cloudron/logs/backup') }, - { name: 'MongoDB', type: 'addon', value: 'mongodb', url: Client.makeURL('/api/v1/addons/mongodb/logs') }, - { name: 'MySQL', type: 'addon', value: 'mysql', url: Client.makeURL('/api/v1/addons/mysql/logs') }, - { name: 'PostgreSQL', type: 'addon', value: 'postgresql', url: Client.makeURL('/api/v1/addons/postgresql/logs') }, - { name: 'Email', type: 'addon', value: 'email', url: Client.makeURL('/api/v1/addons/email/logs') }, - { name: 'Docker', type: 'addon', value: 'docker', url: Client.makeURL('/api/v1/addons/docker/logs') } + { name: 'MongoDB', type: 'addon', value: 'mongodb', url: Client.makeURL('/api/v1/services/mongodb/logs') }, + { name: 'MySQL', type: 'addon', value: 'mysql', url: Client.makeURL('/api/v1/services/mysql/logs') }, + { name: 'PostgreSQL', type: 'addon', value: 'postgresql', url: Client.makeURL('/api/v1/services/postgresql/logs') }, + { name: 'Email', type: 'addon', value: 'email', url: Client.makeURL('/api/v1/services/email/logs') }, + { name: 'Docker', type: 'addon', value: 'docker', url: Client.makeURL('/api/v1/services/docker/logs') } ]; $scope.selected = BUILT_IN_LOGS.find(function (e) { return e.value === id; });