Updated status pages

This commit is contained in:
Martin Schröder 2015-05-25 14:42:59 +02:00 committed by Martin Schröder
parent eedfec2aa6
commit 6dcdf95368
10 changed files with 29 additions and 20 deletions

View file

@ -93,7 +93,7 @@ JUCI.app
$rpc.$logout().done(function(){
console.log("Logged out!");
//$state.go("home", {}, {reload: true});
$juci.redirect("overview"); //$window.location.href="/";
JUCI.redirect("overview"); //$window.location.href="/";
deferred.resolve();
}).fail(function(){
console.error("Error logging out!");

View file

@ -19,13 +19,13 @@ describe("UCI.firewall", function(){
done();
});
});
it("should have dmz section of type include", function(){
it("should have dmz section of type dmz", function(){
expect($uci.firewall.dmz).to.be.ok();
expect($uci.firewall.dmz[".type"]).to.be("include");
expect($uci.firewall.dmz[".type"]).to.be("dmz");
});
it("should have dmzhost section of type dmzhost", function(){
it("should have dmzhost section of type include", function(){
expect($uci.firewall).to.have.property("dmzhost");
expect($uci.firewall.dmzhost[".type"]).to.be("dmzhost");
expect($uci.firewall.dmzhost[".type"]).to.be("include");
});
it("should have Allow-Ping firewall rule set to visible (hidden=0)", function(done){
var ping_rule = $uci.firewall["@rule"].filter(function(x){ return x.name.value == "Allow-Ping"; });

View file

@ -3,9 +3,9 @@ require("../../../../tests/lib-juci");
var completed = {
"configuration": 1,
"energy": 1,
"network": 0,
"network": 1,
"password": 1,
"upgrade": 0
"upgrade": 1
}
describe("Settings", function(){

View file

@ -20,7 +20,7 @@
</luci-config-line>
</luci-config-lines>
</luci-expandable>
<luci-expandable title="DSL" status="dsl_status">
<luci-expandable title="DSL" status="dsl_status" ng-show="dsl_status != 'disabled'">
<luci-config-lines >
<luci-config-line title="{{'Line Status'|translate}}">
<strong>{{dslinfo.status}}</strong>

View file

@ -2,9 +2,9 @@ require("../../../../tests/lib-juci");
var completed = {
"about": 1,
"diagnostics": 0,
"events": 0,
"nat": 0,
//"diagnostics": 0,
"events": 1,
"nat": 1,
"restart": 1,
"status.dsl": 1,
"status.status": 1,
@ -25,6 +25,16 @@ describe("Status", function(){
expect($rpc.router.igmptable).to.be.ok();
$rpc.router.igmptable()
.done(function(){ done(); })
.fail(function(){ throw new Error("Was unable to call router.igmptable"); });
.fail(function(){ });
});
it("should have correct boardpanel.network settings", function(done){
$rpc.network.interface.dump().done(function(results){
expect(results.interface).to.be.ok();
var devs = results.interface.map(function(x){ return x.interface; });
expect(devs).to.contain($uci.boardpanel.network.internet.value);
expect(devs).to.contain($uci.boardpanel.network.voice.value);
expect(devs).to.contain($uci.boardpanel.network.iptv.value);
done();
});
});
});

View file

@ -7,7 +7,7 @@ var completed = {
"mac_filter": 1,
"schedule": 1,
"settings": 1,
"wps": 0
"wps": 1
}
describe("Wireless", function(){

View file

@ -44,7 +44,8 @@
"router": [
"dslstats",
"info",
"clients"
"clients",
"igmptable"
],
"system": [
"info",

View file

@ -13,11 +13,6 @@
"acls": [ "status" ],
"index": 9
},
"status/status/network": {
"title": "Network",
"acls": [ "status" ],
"index": 9
},
"status/status/dsl": {
"title": "DSL",
"acls": [ "status" ],

View file

@ -62,6 +62,9 @@ function JUCIMock(){
},
config: function(){}
}
self.redirect = function(url){
console.log("JUCIMock redirect: "+url);
}
function LocalStorageMock(){
var _items = {};
this.getItem = function(name){

View file

@ -46,7 +46,7 @@ describe("UCI", function(){
Object.keys(values).filter(function(x){
return x.indexOf(".") != 0; // filter out hidden values
}).map(function(x){
expect(type).to.have.property(x);
expect(Object.keys(type)).to.contain(x);
});
});
next();