rename addon route to services
This commit is contained in:
+6
-6
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user