Use new support API

Part of cloudron/box#600
This commit is contained in:
Girish Ramakrishnan
2018-12-19 13:22:27 -08:00
parent bb575fff5b
commit 0816af3cf1
2 changed files with 13 additions and 31 deletions

View File

@@ -630,17 +630,17 @@ angular.module('Application').service('Client', ['$http', '$interval', 'md5', 'N
});
};
Client.prototype.addAuthorizedKey = function (key, callback) {
put('/api/v1/cloudron/ssh/authorized_keys', { key: key }, null, function (error, data, status) {
Client.prototype.getRemoteSupport = function (callback) {
get('/api/v1/support/remote_support', null, function (error, data, status) {
if (error) return callback(error);
if (status !== 201) return callback(new ClientError(status, data));
if (status !== 200) return callback(new ClientError(status, data));
callback(null);
callback(null, data.enabled);
});
};
Client.prototype.delAuthorizedKey = function (identifier, callback) {
del('/api/v1/cloudron/ssh/authorized_keys/' + identifier, null, function (error, data, status) {
Client.prototype.enableRemoteSupport = function (enable, callback) {
post('/api/v1/support/remote_support', { enable: enable }, null, function (error, data, status) {
if (error) return callback(error);
if (status !== 202) return callback(new ClientError(status, data));
@@ -648,15 +648,6 @@ angular.module('Application').service('Client', ['$http', '$interval', 'md5', 'N
});
};
Client.prototype.getAuthorizedKeys = function (callback) {
get('/api/v1/cloudron/ssh/authorized_keys', null, function (error, data, status) {
if (error) return callback(error);
if (status !== 200) return callback(new ClientError(status, data));
callback(null, data.keys);
});
};
Client.prototype.getBackups = function (callback) {
get('/api/v1/backups', null, function (error, data, status) {
if (error) return callback(error);