Fix ipv4 and ipv6 routes

This commit is contained in:
Girish Ramakrishnan
2022-02-15 12:51:06 -08:00
parent 7af69e080f
commit 41099c1131
2 changed files with 18 additions and 19 deletions

View File

@@ -898,8 +898,8 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
});
};
Client.prototype.getServerIp = function (callback) {
get('/api/v1/cloudron/server_ip', null, function (error, data, status) {
Client.prototype.getSysinfoConfig = function (callback) {
get('/api/v1/settings/sysinfo_config', null, function (error, data, status) {
if (error) return callback(error);
if (status !== 200) return callback(new ClientError(status, data));
@@ -907,8 +907,17 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
});
};
Client.prototype.getSysinfoConfig = function (callback) {
get('/api/v1/settings/sysinfo_config', null, function (error, data, status) {
Client.prototype.getServerIpv4 = function (callback) {
get('/api/v1/cloudron/server_ipv4', null, function (error, data, status) {
if (error) return callback(error);
if (status !== 200) return callback(new ClientError(status, data));
callback(null, data);
});
};
Client.prototype.getServerIpv6 = function (callback) {
get('/api/v1/cloudron/server_ipv6', null, function (error, data, status) {
if (error) return callback(error);
if (status !== 200) return callback(new ClientError(status, data));
@@ -952,8 +961,8 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
});
};
Client.prototype.setIPv6Config = function (enabled, callback) {
post('/api/v1/settings/ipv6', { enabled: enabled }, null, function (error, data, status) {
Client.prototype.setIPv6Config = function (config, callback) {
post('/api/v1/settings/ipv6', config, null, function (error, data, status) {
if (error) return callback(error);
if (status !== 200) return callback(new ClientError(status, data));
callback(null);
@@ -965,7 +974,7 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
if (error) return callback(error);
if (status !== 200) return callback(new ClientError(status, data));
callback(null, data.enabled);
callback(null, data);
});
};