Fixed dmzhost

This commit is contained in:
Martin Schröder 2015-05-22 17:13:51 +02:00 committed by Martin Schröder
parent 36152071b7
commit 6ed5b72432
3 changed files with 7 additions and 7 deletions

View file

@ -476,7 +476,7 @@
var self = this;
if(!(".type" in item)) throw new Error("Missing '.type' parameter!");
var type = section_types[self[".name"]][item[".type"]];
if(!type) throw Error("Trying to create section of unrecognized type!");
if(!type) throw Error("Trying to create section of unrecognized type ("+self[".name"]+"."+item[".type"]+")");
// TODO: validate values!
var values = {};

View file

@ -7,11 +7,11 @@
<luci-config-info>{{'internet.exposed_host.info'|translate}}</luci-config-info>
<luci-config-lines>
<luci-config-line title="{{'Exposed Host Function'|translate}}">
<switch id="enabled" name="enabled" ng-model="firewall.dmzhost.enabled.value" class="green"></switch>
<switch id="enabled" name="enabled" ng-model="firewall.dmz.enabled.value" class="green"></switch>
</luci-config-line>
</luci-config-lines>
</luci-config-section>
<luci-config-section ng-show="firewall.dmzhost.enabled.value">
<luci-config-section ng-show="firewall.dmz.enabled.value">
<div class="alert alert-danger">
<p translate><span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span> Warning: By using the exposed host function you bypass the firewall of your {{config.friendly_name}}. Please make sure that your computer is protected against attacks from Internet. The following ports will not be forwarded: {{ nonforwardedPorts || 'None'}}.</p>
</div>
@ -21,7 +21,7 @@
<strong>{{wan.ip}}</strong>
</luci-config-line>
<luci-config-line title="{{'Local IP Address'|translate}}">
<input type="text" class="form-control" placeholder="{{'ip.address.label'|translate}}" ng-model="firewall.dmzhost.host.value"/>
<input type="text" class="form-control" placeholder="{{'ip.address.label'|translate}}" ng-model="firewall.dmz.host.value"/>
</luci-config-line>
</luci-config-lines>
<luci-config-apply></luci-config-apply>

View file

@ -10,11 +10,11 @@ $juci.module("internet")
}).always(function(){ next(); });
},
function(next){
if($uci.firewall.dmzhost == undefined){
$uci.firewall.create({".type": "dmzhost", ".name": "dmzhost"}).done(function(){
if($uci.firewall.dmz == undefined){
$uci.firewall.create({".type": "dmz", ".name": "dmz"}).done(function(){
next();
}).fail(function(){
throw new Error("Could not create required dmzhost section in config firewall!");
throw new Error("Could not create required dmz section in config firewall!");
});
} else {
next();