Fixed bridge settings

This commit is contained in:
Martin Schröder 2015-09-04 12:23:57 +02:00
parent eefa0b06de
commit 0d932bf87b
4 changed files with 28 additions and 14 deletions

View File

@ -98,6 +98,9 @@ debug: prepare $(UBUS_MODS) $(DIRS-y)
grunt
./juci-update $(BIN)/www DEBUG
install:
$(CP) $(BIN)/* /
#node_modules: package.json
# npm install

View File

@ -13,6 +13,11 @@
<li ng-repeat="err in conn.$info.errors">Error ({{err.subsystem}}): {{err.code}}</li>
</ul>
</div>
<juci-config-lines>
<juci-config-line title="{{'Interface Type'|translate}}">
<juci-select ng-model="conn.type.value" ng-items="allInterfaceTypes"/>
</juci-config-line>
</juci-config-lines>
<table class="table table-condensed">
<tr><td translate>Interface UP:</td><td>{{(conn.$info.up)?"YES":"NO"}}</td></tr>
<tr><td translate>Device:</td><td>{{conn.$info.l3_device}}</td></tr>

View File

@ -16,6 +16,12 @@ JUCI.app
$scope.expanded = true;
$scope.existingHost = { };
$scope.allInterfaceTypes = [
{ label: "Standard", value: "" },
{ label: "AnyWAN", value: "anywan" },
{ label: "Bridge", value: "bridge" }
];
$scope.protocolTypes = [
{ label: "Static Address", value: "static" },
{ label: "DHCP v4", value: "dhcp" },

View File

@ -19,7 +19,7 @@ JUCI.app
function updateDevices(net){
if(!net) return;
$network.getAdapters().done(function(devs){
var devlist = net.ifname.value.split(" ");
var devlist = (net.ifname.value != "")?net.ifname.value.split(" "):[];
var addable = [];
net.$addedDevices = devlist.map(function(dev){
return { name: dev };
@ -69,20 +69,20 @@ JUCI.app
else if(dev == data) return false;
return true;
}).join(" ");
if(keep_device) return;
$scope.connection.ifname.value += " " + data;
$scope.connection.ifname.value.split(" ").map(function(dev_name){
var dev = devs.find(function(d){ return d.id == dev_name; });
if(!$scope.doNotMarkBridgedDevices){
// mark devies that are part of the bridge as bridged
if(dev) dev.bridged = true;
}
});
updateDevices($scope.connection);
});
if(keep_device) return;
$scope.connection.ifname.value += " " + data;
$scope.connection.ifname.value.split(" ").map(function(dev_name){
var dev = devs.find(function(d){ return d.id == dev_name; });
if(!$scope.doNotMarkBridgedDevices){
// mark devies that are part of the bridge as bridged
if(dev) dev.bridged = true;
}
});
updateDevices($scope.connection);
});
});
}, function () {