settings: move ipv6/ipv4 config into network
this also rename sysinfo_config to ipv4_config
This commit is contained in:
@@ -1094,8 +1094,8 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
|
||||
};
|
||||
|
||||
// network
|
||||
Client.prototype.setSysinfoConfig = function (config, callback) {
|
||||
post('/api/v1/settings/sysinfo_config', config, null, function (error, data, status) {
|
||||
Client.prototype.setIPv4Config = function (config, callback) {
|
||||
post('/api/v1/network/ipv4_config', config, null, function (error, data, status) {
|
||||
if (error) return callback(error);
|
||||
if (status !== 200) return callback(new ClientError(status, data));
|
||||
|
||||
@@ -1103,8 +1103,8 @@ 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.getIPv4Config = function (callback) {
|
||||
get('/api/v1/network/ipv4_config', null, function (error, data, status) {
|
||||
if (error) return callback(error);
|
||||
if (status !== 200) return callback(new ClientError(status, data));
|
||||
|
||||
@@ -1182,7 +1182,7 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
|
||||
};
|
||||
|
||||
Client.prototype.setIPv6Config = function (config, callback) {
|
||||
post('/api/v1/settings/ipv6_config', config, null, function (error, data, status) {
|
||||
post('/api/v1/network/ipv6_config', config, null, function (error, data, status) {
|
||||
if (error) return callback(error);
|
||||
if (status !== 200) return callback(new ClientError(status, data));
|
||||
callback(null);
|
||||
@@ -1190,7 +1190,7 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
|
||||
};
|
||||
|
||||
Client.prototype.getIPv6Config = function (callback) {
|
||||
get('/api/v1/settings/ipv6_config', null, function (error, data, status) {
|
||||
get('/api/v1/network/ipv6_config', null, function (error, data, status) {
|
||||
if (error) return callback(error);
|
||||
if (status !== 200) return callback(new ClientError(status, data));
|
||||
|
||||
@@ -1427,12 +1427,12 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
|
||||
});
|
||||
};
|
||||
|
||||
Client.prototype.restore = function (backupConfig, remotePath, version, sysinfoConfig, skipDnsSetup, setupToken, callback) {
|
||||
Client.prototype.restore = function (backupConfig, remotePath, version, ipv4Config, skipDnsSetup, setupToken, callback) {
|
||||
var data = {
|
||||
backupConfig: backupConfig,
|
||||
remotePath: remotePath,
|
||||
version: version,
|
||||
sysinfoConfig: sysinfoConfig,
|
||||
ipv4Config: ipv4Config,
|
||||
skipDnsSetup: skipDnsSetup,
|
||||
setupToken: setupToken
|
||||
};
|
||||
|
||||
@@ -249,7 +249,7 @@ app.controller('SetupDNSController', ['$scope', '$http', '$timeout', 'Client', f
|
||||
config: config,
|
||||
tlsConfig: tlsConfig
|
||||
},
|
||||
sysinfoConfig: sysinfoConfig,
|
||||
ipv4Config: sysinfoConfig,
|
||||
providerToken: $scope.instanceId,
|
||||
setupToken: $scope.setupToken
|
||||
};
|
||||
|
||||
@@ -265,7 +265,7 @@ angular.module('Application').controller('NetworkController', ['$scope', '$locat
|
||||
newIfname: '',
|
||||
|
||||
refresh: function () {
|
||||
Client.getSysinfoConfig(function (error, result) {
|
||||
Client.getIPv4Config(function (error, result) {
|
||||
if (error) return console.error(error);
|
||||
|
||||
$scope.sysinfo.provider = result.provider;
|
||||
@@ -303,7 +303,7 @@ angular.module('Application').controller('NetworkController', ['$scope', '$locat
|
||||
config.ifname = $scope.sysinfo.newIfname;
|
||||
}
|
||||
|
||||
Client.setSysinfoConfig(config, function (error) {
|
||||
Client.setIPv4Config(config, function (error) {
|
||||
$scope.sysinfo.busy = false;
|
||||
if (error && error.message.indexOf('ipv') !== -1) {
|
||||
$scope.sysinfo.error.ipv4 = error.message;
|
||||
|
||||
Reference in New Issue
Block a user