Merge "fix external nic name miss match bug"
This commit is contained in:
commit
83f0f26589
@ -333,6 +333,8 @@ define(['./baseController'], ()->
|
|||||||
|
|
||||||
$scope.updateExternalNetwork = (network_name) ->
|
$scope.updateExternalNetwork = (network_name) ->
|
||||||
nic = $scope.external[network_name]
|
nic = $scope.external[network_name]
|
||||||
|
try
|
||||||
|
if $scope.interfaces[nic]
|
||||||
$scope.ips[network_name].cidr = $scope.interfaces[nic].subnet
|
$scope.ips[network_name].cidr = $scope.interfaces[nic].subnet
|
||||||
$scope.ips[network_name].start = $scope.ips[network_name].cidr.split('.').slice(0,3).join('.') +
|
$scope.ips[network_name].start = $scope.ips[network_name].cidr.split('.').slice(0,3).join('.') +
|
||||||
'.' + $scope.ips[network_name].start.split('.')[3]
|
'.' + $scope.ips[network_name].start.split('.')[3]
|
||||||
@ -343,6 +345,8 @@ define(['./baseController'], ()->
|
|||||||
'.' + $scope.ips.external.public_vip.split('.')[3]
|
'.' + $scope.ips.external.public_vip.split('.')[3]
|
||||||
$scope.ips.external.gw_ip = $scope.ips[network_name].cidr.split('.').slice(0,3).join('.') +
|
$scope.ips.external.gw_ip = $scope.ips[network_name].cidr.split('.').slice(0,3).join('.') +
|
||||||
'.' + $scope.ips.external.gw_ip.split('.')[3]
|
'.' + $scope.ips.external.gw_ip.split('.')[3]
|
||||||
|
catch error
|
||||||
|
console.log(error)
|
||||||
return
|
return
|
||||||
|
|
||||||
defaultCfg = ->
|
defaultCfg = ->
|
||||||
|
@ -428,15 +428,22 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
$scope.updateExternalNetwork = function(network_name) {
|
$scope.updateExternalNetwork = function(network_name) {
|
||||||
var nic;
|
var error, nic;
|
||||||
nic = $scope.external[network_name];
|
nic = $scope.external[network_name];
|
||||||
|
try {
|
||||||
|
if ($scope.interfaces[nic]) {
|
||||||
$scope.ips[network_name].cidr = $scope.interfaces[nic].subnet;
|
$scope.ips[network_name].cidr = $scope.interfaces[nic].subnet;
|
||||||
|
}
|
||||||
$scope.ips[network_name].start = $scope.ips[network_name].cidr.split('.').slice(0, 3).join('.') + '.' + $scope.ips[network_name].start.split('.')[3];
|
$scope.ips[network_name].start = $scope.ips[network_name].cidr.split('.').slice(0, 3).join('.') + '.' + $scope.ips[network_name].start.split('.')[3];
|
||||||
$scope.ips[network_name].end = $scope.ips[network_name].cidr.split('.').slice(0, 3).join('.') + '.' + $scope.ips[network_name].end.split('.')[3];
|
$scope.ips[network_name].end = $scope.ips[network_name].cidr.split('.').slice(0, 3).join('.') + '.' + $scope.ips[network_name].end.split('.')[3];
|
||||||
if (network_name === 'external') {
|
if (network_name === 'external') {
|
||||||
$scope.ips.external.public_vip = $scope.ips[network_name].cidr.split('.').slice(0, 3).join('.') + '.' + $scope.ips.external.public_vip.split('.')[3];
|
$scope.ips.external.public_vip = $scope.ips[network_name].cidr.split('.').slice(0, 3).join('.') + '.' + $scope.ips.external.public_vip.split('.')[3];
|
||||||
$scope.ips.external.gw_ip = $scope.ips[network_name].cidr.split('.').slice(0, 3).join('.') + '.' + $scope.ips.external.gw_ip.split('.')[3];
|
$scope.ips.external.gw_ip = $scope.ips[network_name].cidr.split('.').slice(0, 3).join('.') + '.' + $scope.ips.external.gw_ip.split('.')[3];
|
||||||
}
|
}
|
||||||
|
} catch (_error) {
|
||||||
|
error = _error;
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
defaultCfg = function() {
|
defaultCfg = function() {
|
||||||
$scope.internal = {
|
$scope.internal = {
|
||||||
|
Loading…
Reference in New Issue
Block a user